Skip to content

Commit

Permalink
[cmap] Don’t reject subtables with surrogate pairs
Browse files Browse the repository at this point in the history
They are still valid fonts, though it might not be the best practice
Unicode-compliance wise.

Fixes #80.
  • Loading branch information
khaledhosny committed Oct 28, 2015
1 parent 2cd7fab commit 937c9c3
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/cmap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -304,21 +304,6 @@ bool Parse31012(ots::Font *font,
groups[i].start_range, groups[i].end_range, groups[i].start_glyph_id);
}

// [0xD800, 0xDFFF] are surrogate code points.
if (groups[i].start_range >= 0xD800 &&
groups[i].start_range <= 0xDFFF) {
return OTS_FAILURE_MSG("format 12 subtable out of range group startCharCode (0x%4X)", groups[i].start_range);
}
if (groups[i].end_range >= 0xD800 &&
groups[i].end_range <= 0xDFFF) {
return OTS_FAILURE_MSG("format 12 subtable out of range group endCharCode (0x%4X)", groups[i].end_range);
}
if (groups[i].start_range < 0xD800 &&
groups[i].end_range > 0xDFFF) {
return OTS_FAILURE_MSG("bad format 12 subtable group startCharCode (0x%4X) or endCharCode (0x%4X)",
groups[i].start_range, groups[i].end_range);
}

// We assert that the glyph value is within range. Because of the range
// limits, above, we don't need to worry about overflow.
if (groups[i].end_range < groups[i].start_range) {
Expand Down

0 comments on commit 937c9c3

Please sign in to comment.