本文整理匯總了TypeScript中jspdf.setFontSize函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript setFontSize函數的具體用法?TypeScript setFontSize怎麽用?TypeScript setFontSize使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了setFontSize函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: test_font_sizes
function test_font_sizes() {
var doc = new jsPDF();
doc.setFontSize(22);
doc.text(20, 20, 'This is a title');
doc.setFontSize(16);
doc.text(20, 30, 'This is some normal sized text underneath.');
doc.save('Test.pdf');
}
示例2: onPdf
onPdf() {
console.log('create pdf putzplan');
/*jshint newcap: false */
// noinspection JSPotentiallyInvalidConstructorUsage
const pdf = new jsPDF('landscape');
pdf.setFontSize(22);
pdf.text(50, 15, 'Putzplan ' + this.year);
let x = 5;
let y = 50;
const xOffset = 24;
const yOffset = 5;
// iterate over month
for (let month = 0; month < this.month.length; month++) {
y = 30;
pdf.setFontSize(12);
pdf.text(x, y, this.month[month]);
// horizontal line around month names
pdf.line(x - 1, y - 5, x + xOffset - 1, y - 5);
pdf.line(x - 1, y + 1, x + xOffset - 1, y + 1);
y = 35;
// vertical lines
pdf.line(x - 1, y - 10, x - 1, y + 30 * yOffset + 1);
// iterate over days in month
for (let day = 0; day < this.daysInMonth(month + 1); day++) {
// horizontal lines
pdf.line(x - 1, y + 1, x + xOffset - 1, y + 1);
pdf.setFontSize(6);
pdf.text(x, y, this.nameOfDay(day + 1, month + 1) + ', ' + (day + 1) + '.' + (month + 1) + '.');
if (this.nameOfDay(day + 1, month + 1) === 'Sa') {
pdf.setFontSize(8);
pdf.text((x + 10), y, this.workers[this.KalenderWoche(day + 1, month + 1) % this.workers.length]);
}
y += yOffset;
}
x += xOffset;
}
// last vertical line
y = 35;
pdf.line(x - 1, y - 10, x - 1, y + 30 * yOffset + 1);
pdf.save('putzplan.pdf');
}
示例3: addLine
const addLeftHeader = (
doc: jsPDF,
page: number,
pages: number,
date: string | null,
type: string
) => {
const addLine = (text: string, fontSize = 9) => {
doc.text(text, leftPadding, currentLine, { charSpace: 0.75 });
currentLine += fontSize;
};
let currentLine = 55;
doc.setFontSize(9);
doc.setFont(baseFont);
addLine(`Page ${page} of ${pages}`);
if (date) {
addLine(`${type} Date: ${date}`);
}
doc.setFontStyle('bold');
addLine('Remit to:');
doc.setFontStyle('normal');
addLine(`Linode, LLC`);
addLine('249 Arch St.');
addLine('Philadelphia, PA 19106');
addLine('USA');
};
示例4:
const addTitle = (doc: jsPDF, title: string) => {
doc.setFontSize(12);
doc.setFontStyle('bold');
doc.text(title, leftPadding, 130, { charSpace: 0.75 });
// reset text format
doc.setFontStyle('normal');
};