TextGlyph

data class TextGlyph(val byteOffset: Int, val byteCount: Int, val gid: Int, val text: String, val advanceWidth: Double, val outline: PdfPath?, val isWordSpace: Boolean)

One glyph laid out from a Tj / TJ show-text byte string.

The presence of TextGlyph lets the renderer walk a code-unit-aware sequence rather than iterating bytes one at a time — necessary for Type 0 composite fonts where each glyph consumes 2 bytes (Identity-H) or other variable-length CMap encodings.

Simple fonts produce one TextGlyph per byte; CIDFonts produce one per (1- or 2-byte) code unit consumed from the input.

Constructors

Link copied to clipboard
constructor(byteOffset: Int, byteCount: Int, gid: Int, text: String, advanceWidth: Double, outline: PdfPath?, isWordSpace: Boolean)

Properties

Link copied to clipboard

Glyph advance width in font design units (1/1000 em for most fonts).

Link copied to clipboard

How many bytes this code unit consumed (1 for simple, 2 for Identity-H).

Link copied to clipboard

Byte offset in the input where this code unit started.

Link copied to clipboard
val gid: Int

Glyph index in the embedded font (TrueType / CFF / Type 1), or -1 if unresolved.

Link copied to clipboard

True iff this code unit corresponds to ASCII space (0x20) — needed for Tw word spacing.

Link copied to clipboard

Outline ready to draw (TTF/CFF/Type 1 already resolved), or null if no embedded font.

Link copied to clipboard

Decoded unicode text for this glyph — empty if no mapping is known.