本文整理汇总了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');
};