Added missing baseline property to TextOptions (#37458)

This commit is contained in:
Jeroen Vervaeke
2019-08-08 18:07:21 +02:00
committed by Nathan Shively-Sanders
parent 7a51b5f4c1
commit 94c1ab99fb
2 changed files with 8 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
// Project: http://pdfkit.org
// Definitions by: Eric Hillah <https://github.com/erichillah>
// Erik Berreßem <https://github.com/she11sh0cked>
// Jeroen Vervaeke <https://github.com/jeroenvervaeke/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
@@ -146,6 +147,8 @@ declare namespace PDFKit.Mixins {
/** the alignment of the text (center, justify, left, right) */
//TODO check this
align?: 'center' | 'justify' | 'left' | 'right' | string;
/** the vertical alignment of the text with respect to its insertion point */
baseline?: number | "svg-middle" | "middle" | "svg-central" | "bottom" | "ideographic" | "alphabetic" | "mathematical" | "hanging" | "top"
}
interface PDFText<TDocument> {

View File

@@ -162,11 +162,15 @@ doc.image(
},
{
scale: 0.25,
}
},
).text('Scale', 320, 265);
doc.text('Scale', { align: 'justify' });
doc.text('Baseline - string literal', { baseline: 'alphabetic' });
doc.text('Baseline - numeric', { baseline: 10 });
doc.goTo(0, 0, 0, 0, 'lorem');
doc.image('path/to/image.png', {