[cmap] Use -1 as Unicode sentinel, not U+FFFF in Format12 serialize

This commit is contained in:
Behdad Esfahbod 2022-05-05 11:21:24 -06:00
parent 8a19968c8b
commit f10ddb8dd8
1 changed files with 2 additions and 2 deletions

View File

@ -798,12 +798,12 @@ struct CmapSubtableFormat12 : CmapSubtableLongSegmented<CmapSubtableFormat12>
unsigned table_initpos = c->length ();
if (unlikely (!c->extend_min (this))) return;
hb_codepoint_t startCharCode = 0xFFFF, endCharCode = 0xFFFF;
hb_codepoint_t startCharCode = (hb_codepoint_t) -1, endCharCode = (hb_codepoint_t) -1;
hb_codepoint_t glyphID = 0;
for (const auto& _ : +it)
{
if (startCharCode == 0xFFFF)
if (startCharCode == (hb_codepoint_t) -1)
{
startCharCode = _.first;
endCharCode = _.first;