Fixes #112.
Text containing characters outside the Basic Multilingual Plane (code points
= U+10000, such as emoji) causes a panic during
Output(). Two code paths
index intoCharWidths, a fixed 65536-element slice, without proper bounds
checking.
Bug 1: generateCIDFontMap (fpdf.go)
LastRune can exceed 65535 when non-BMP characters are used, causing the
iteration for cid := startCid; cid < LastRune+1; cid++ to index past the
end of font.Cw. Fixed by capping cwLen to len(font.Cw).
Bug 2: parseHMTXTable (utf8fontfile.go)
The bounds guard char < 196608 allows indexing well beyond the 65536-element
CharWidths slice during font loading. Fixed by replacing the hardcoded
constant with len(utf.CharWidths).
Non-BMP characters are now silently skipped (treated as zero-width) rather
than causing a panic.
Made-with: Cursor