Appearance
zeropdf / TextOptions
Interface: TextOptions
Defined in: src/types.ts:762
Options for placing a single line of text.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
artifactType? | "Pagination" | "Layout" | "Page" | Artifact type classification for tagged PDF content. "Pagination" for headers/footers, "Layout" for typographic ornaments, "Page" for watermarks. Emitted as /Type in the /Artifact BMC/EMC pair. | src/types.ts:816 |
bold? | boolean | Selects the bold variant of font. For a built-in family (Helvetica, Times-Roman, Courier) this resolves to the matching bold base font. For a font family registered with PdfDocument.registerFontFamily it selects the registered bold face. Ignored when font is an explicit embedded-font handle. | src/types.ts:776 |
characterSpacing? | number | Additional spacing between characters in PDF points. | src/types.ts:795 |
color? | ColorInput | Color used for drawing, text, or highlighting. | src/types.ts:793 |
direction? | TextDirection | Text direction used for shaping and layout. | src/types.ts:789 |
encoding? | "winansi" | "macroman" | "pdfdoc" | Built-in font encoding. When set, the font dictionary emits an /Encoding entry with the specified encoding (e.g. /WinAnsiEncoding). When undefined, the default encoding is used. | src/types.ts:822 |
fallbackFonts? | PdfFont[] | Fallback fonts used when the primary font lacks a glyph. | src/types.ts:787 |
font? | PdfFont | Font used to render text. | src/types.ts:768 |
fontSize? | number | Font size in PDF points. | src/types.ts:791 |
italic? | boolean | Selects the italic/oblique variant of font, following the same resolution rules as bold. Combine with bold for bold italic. | src/types.ts:781 |
kerning? | boolean | Whether kerning should be applied where supported. | src/types.ts:801 |
leading? | number | Text leading value in PDF points. | src/types.ts:799 |
strike? | boolean | Draws a strike-through line over the text. | src/types.ts:785 |
structure? | PdfStructureOptions | Additional structure metadata for tagged PDF output. | src/types.ts:810 |
tag? | | PdfTextStructureTag | "Artifact" | Structure tag used for tagged PDF output. | src/types.ts:808 |
underline? | boolean | Draws an underline beneath the text. | src/types.ts:783 |
wordSpacing? | number | Additional spacing between words in PDF points. | src/types.ts:797 |
writingMode? | "horizontal" | "vertical" | Text writing mode. "horizontal" (default) places characters left-to-right. "vertical" stacks characters top-to-bottom. | src/types.ts:806 |
x | number | Horizontal position in PDF points. | src/types.ts:764 |
y | number | Vertical position in PDF points. | src/types.ts:766 |