text/shaped.go

Structs

Structs

type ShapedGlyph struct

ShapedGlyph represents a positioned glyph ready for GPU rendering.

Unlike Glyph which contains CPU rasterization data (Mask), ShapedGlyph

is minimal and designed for efficient GPU text rendering pipelines.

type ShapedGlyph struct {
	// GID is the glyph index in the font.
	GID	GlyphID

	// Cluster is the source character index in the original text.
	// Used for hit testing and cursor positioning.
	Cluster	int

	// IsCJK indicates that this glyph belongs to a CJK script (Han, Hiragana,
	// Katakana, Hangul). Used for script-aware rendering: CJK glyphs use
	// reduced hinting and bypass bucket quantization (ADR-027).
	IsCJK	bool

	// X is the horizontal position relative to the text origin.
	X	float64

	// Y is the vertical position relative to the baseline.
	Y	float64

	// XAdvance is the horizontal advance to the next glyph.
	XAdvance	float64

	// YAdvance is the vertical advance (for vertical text).
	YAdvance	float64
}