THPDFPage Fallback and Vertical Text Methods

Emits Unicode text with document fallback chains or a native vertical CID writing mode

Declarations

procedure TextOutWithFallback(X, Y: Single; angle: Extended;
  const Text: WideString);
procedure TextOutVertical(X, Y: Single; const Text: WideString);
function GetVerticalTextAdvance(const Text: WideString): Single;

Member topics

TextOutWithFallback

Uses the current face as the primary font, resolves each Unicode scalar through THotPDF fallback chains, and emits maximal adjacent runs with the same resolved face

The current style, charset, size, and vertical state are applied to every fallback run and restored before the method returns

Unresolved scalars remain assigned to the primary face and are added to THotPDF.GetUnresolvedGlyphs

TextOutVertical

Temporarily selects the current face with IsVertical=True and writes the complete run through Identity-V

The emitted CID font uses OpenType vertical advances and origins when present and valid /DW2 and /W2 defaults otherwise

GetVerticalTextAdvance

Returns the sum of each Unicode scalar's vertical advance in page user-space units

Use the result to position a following fallback run, annotation, or parallel vertical column

Example

PDF.CurrentPage.SetFont('Arial', [], 12);
PDF.CurrentPage.TextOutWithFallback(72, 72, 0, MixedText);

PDF.CurrentPage.SetFont('Yu Gothic UI', [], 14);
PDF.CurrentPage.TextOutVertical(420, 72, VerticalText);
NextY := 72 + PDF.CurrentPage.GetVerticalTextAdvance(VerticalText);

Related APIs