Documentation
¶
Overview ¶
Package glyphless is a minimal TrueType font whose glyphs carry no outlines: every character prints nothing, but still occupies exactly as much horizontal space as a normal proportional glyph would. This is the asset byb-b4 (StampTextLayer) needs to write invisible text -- an OCR-style layer at PDF text render mode 3 -- without a reader complaining that the font is broken or a naive one drawing black boxes.
The font is built once by gen.go and the resulting glyphless.ttf is committed. Nothing in this package constructs a font at runtime: gen.go is build-tagged //go:build ignore, the same convention testdata/oracle/gen.go uses, so it never compiles into the module and CI never runs it. See gen.go for how to regenerate the asset (never necessary unless the glyph coverage or width table changes).
Index ¶
Constants ¶
const ( FirstRune = ' ' // 0x20 LastRune = '~' // 0x7E )
FirstRune and LastRune bound the codepoints this font covers: printable ASCII, space through tilde. That is what an invisible OCR text layer needs to reproduce recognized words; it is not meant to cover the codepoints a visible body font would.
const NumGlyphs = LastRune - FirstRune + 2
NumGlyphs is the font's glyph count: one glyph per covered rune, plus glyph 0, which every TrueType font reserves for .notdef (ISO/IEC 14496-22 / OpenType spec, "glyf" table). GlyphID never returns 0 for a covered rune.
const UnitsPerEm = 1000
UnitsPerEm is the font's design grid. It is 1000, not the TrueType-typical 2048, so that a glyph's PDF /Widths entry -- always expressed in 1000ths of text space per ISO 32000-1 9.2.4 -- equals its hmtx advance width with no conversion at the call site that embeds this font.
Variables ¶
var Font []byte
Functions ¶
Types ¶
This section is empty.