|
|
@ -52,11 +52,11 @@ HB_INTERNAL bool postV2Tail::serialize (hb_serialize_context_t *c, |
|
|
|
{ |
|
|
|
{ |
|
|
|
unsigned glyph_id = _.first; |
|
|
|
unsigned glyph_id = _.first; |
|
|
|
unsigned new_index = _.second; |
|
|
|
unsigned new_index = _.second; |
|
|
|
|
|
|
|
|
|
|
|
if (new_index < 258) continue; |
|
|
|
if (new_index < 258) continue; |
|
|
|
if (copied_indices.has (new_index)) continue; |
|
|
|
if (copied_indices.has (new_index)) continue; |
|
|
|
copied_indices.add (new_index); |
|
|
|
copied_indices.add (new_index); |
|
|
|
|
|
|
|
|
|
|
|
hb_bytes_t s = reinterpret_cast<const post::accelerator_t*> (_post)->find_glyph_name (glyph_id); |
|
|
|
hb_bytes_t s = reinterpret_cast<const post::accelerator_t*> (_post)->find_glyph_name (glyph_id); |
|
|
|
HBUINT8 *o = c->allocate_size<HBUINT8> (HBUINT8::static_size * (s.length + 1)); |
|
|
|
HBUINT8 *o = c->allocate_size<HBUINT8> (HBUINT8::static_size * (s.length + 1)); |
|
|
|
if (unlikely (!o)) return_trace (false); |
|
|
|
if (unlikely (!o)) return_trace (false); |
|
|
@ -87,9 +87,10 @@ HB_INTERNAL bool postV2Tail::subset (hb_subset_context_t *c) const |
|
|
|
unsigned new_index; |
|
|
|
unsigned new_index; |
|
|
|
const unsigned *new_index2; |
|
|
|
const unsigned *new_index2; |
|
|
|
if (old_index <= 257) new_index = old_index; |
|
|
|
if (old_index <= 257) new_index = old_index; |
|
|
|
else if (!old_new_index_map.has (old_index, &new_index2)) |
|
|
|
else if (old_new_index_map.has (old_index, &new_index2)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
new_index = *new_index2; |
|
|
|
new_index = *new_index2; |
|
|
|
|
|
|
|
} else { |
|
|
|
hb_bytes_t s = _post.find_glyph_name (old_gid); |
|
|
|
hb_bytes_t s = _post.find_glyph_name (old_gid); |
|
|
|
new_index = glyph_name_to_new_index.get (s); |
|
|
|
new_index = glyph_name_to_new_index.get (s); |
|
|
|
if (new_index == (unsigned)-1) |
|
|
|
if (new_index == (unsigned)-1) |
|
|
|