mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-13 00:32:59 +00:00
[subset/cff1] Micro-optimize
This commit is contained in:
parent
40a1c08f4c
commit
aed215639a
2 changed files with 3 additions and 3 deletions
|
@ -330,7 +330,7 @@ struct Charset0
|
|||
{
|
||||
mapping->resize (num_glyphs, false);
|
||||
for (hb_codepoint_t gid = 1; gid < num_glyphs; gid++)
|
||||
mapping->arrayZ[gid] = {sids[gid - 1], gid + 1};
|
||||
mapping->arrayZ[gid] = {sids[gid - 1], gid};
|
||||
}
|
||||
|
||||
hb_codepoint_t get_glyph (hb_codepoint_t sid, unsigned int num_glyphs) const
|
||||
|
@ -438,7 +438,7 @@ struct Charset1_2 {
|
|||
unsigned count = ranges[i].nLeft + 1;
|
||||
unsigned last = gid + count;
|
||||
for (unsigned j = 0; j < count; j++)
|
||||
mapping->arrayZ[gid++] = {sid++, last};
|
||||
mapping->arrayZ[gid++] = {sid++, last - 1};
|
||||
|
||||
if (gid >= num_glyphs)
|
||||
break;
|
||||
|
|
|
@ -557,7 +557,7 @@ struct cff1_subset_plan
|
|||
|
||||
if (glyph == old_glyph && skip)
|
||||
{
|
||||
glyph = hb_min (_.first - 1, glyph_to_sid_map->arrayZ[old_glyph].glyph - 1);
|
||||
glyph = hb_min (_.first - 1, glyph_to_sid_map->arrayZ[old_glyph].glyph);
|
||||
sid += glyph - old_glyph;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue