Skip to main content

Interface: TextBlockOptions

Options for laying out wrapped text blocks.

Properties

PropertyTypeDescription
align?TextAlignHorizontal alignment for laid-out content.
bold?booleanSelects the bold variant of font. See TextOptions.bold.
characterSpacing?numberAdditional spacing between characters in PDF points.
color?ColorInputColor used for drawing, text, or highlighting.
direction?TextDirectionText direction used for shaping and layout.
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.
fallbackFonts?PdfFont[]Fallback fonts used when the primary font lacks a glyph.
font?PdfFontFont used to render text.
fontSize?numberFont size in PDF points.
height?numberBox height in PDF points. When set together with verticalAlign, the wrapped lines are positioned within a box of this height starting at y and extending downward. Has no effect unless verticalAlign is given.
italic?booleanSelects the italic variant of font. See TextOptions.italic.
kerning?booleanWhether kerning should be applied where supported.
lineHeight?numberLine height in PDF points.
maxLines?numberMaximum number of lines to render.
strike?booleanDraws a strike-through line over the text.
structure?PdfStructureOptionsAdditional structure metadata for tagged PDF output.
tag?PdfTextStructureTag | "Artifact"Structure tag used for tagged PDF output.
underline?booleanDraws an underline beneath the text.
verticalAlign?VerticalAlignVertical alignment of the wrapped text within height. Requires height. Defaults to "top".
widthnumberWidth in PDF points.
wordSpacing?numberAdditional spacing between words in PDF points.
writingMode?"horizontal" | "vertical"Text writing mode. "horizontal" (default) places characters left-to-right. "vertical" stacks characters top-to-bottom.
xnumberHorizontal position in PDF points.
ynumberVertical position in PDF points.