modern-pdf-lib / layoutSinglelineText
Function: layoutSinglelineText()
layoutSinglelineText(
text,options):LayoutSinglelineResult
Defined in: src/core/layout.ts:209
Layout a single line of text with optional alignment within bounds.
Unlike layoutMultilineText, this does not perform any wrapping. It simply measures the text, computes alignment offsets, and returns the positioned line.
Parameters
text
string
The text to lay out (single line, no newlines).
options
Font, size, bounds, alignment.
Returns
The measured line and its position offsets.