summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQunxin Liu <qxliu@google.com>2019-03-26 09:15:56 -0700
committerGarret Rieger <grieger@google.com>2019-03-26 13:39:33 -0700
commit3147133b6173487c26813a2a406aebd067b53fbf (patch)
treeac9e029363150217955ff1545f65b1fda9ad4d56
parent79a6c258497e80be15245a7b576e34443d9f7bff (diff)
update arguments in_populate_gids_to_retain() and _create_old_gid_to_new_gid_map()
so they don't use deprecated variable
-rw-r--r--src/hb-subset-plan.cc36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/hb-subset-plan.cc b/src/hb-subset-plan.cc
index a001ebc1..3857c2c8 100644
--- a/src/hb-subset-plan.cc
+++ b/src/hb-subset-plan.cc
@@ -99,8 +99,7 @@ _populate_gids_to_retain (hb_face_t *face,
const hb_set_t *input_glyphs_to_retain,
bool close_over_gsub,
hb_set_t *unicodes_to_retain,
- hb_map_t *codepoint_to_glyph,
- hb_vector_t<hb_codepoint_t> *glyphs)
+ hb_map_t *codepoint_to_glyph)
{
OT::cmap::accelerator_t cmap;
OT::glyf::accelerator_t glyf;
@@ -145,10 +144,10 @@ _populate_gids_to_retain (hb_face_t *face,
_remove_invalid_gids (all_gids_to_retain, face->get_num_glyphs ());
- glyphs->alloc (all_gids_to_retain->get_population ());
- gid = HB_SET_VALUE_INVALID;
- while (all_gids_to_retain->next (&gid))
- glyphs->push (gid);
+ //glyphs->alloc (all_gids_to_retain->get_population ());
+ //gid = HB_SET_VALUE_INVALID;
+ //while (all_gids_to_retain->next (&gid))
+ //glyphs->push (gid);
cff.fini ();
glyf.fini ();
@@ -160,26 +159,29 @@ _populate_gids_to_retain (hb_face_t *face,
static void
_create_old_gid_to_new_gid_map (const hb_face_t *face,
bool retain_gids,
- const hb_vector_t<hb_codepoint_t> &glyphs,
+ hb_set_t *all_gids_to_retain,
hb_map_t *glyph_map, /* OUT */
hb_map_t *reverse_glyph_map, /* OUT */
unsigned int *num_glyphs /* OUT */)
{
- for (unsigned int i = 0; i < glyphs.length; i++) {
+ hb_codepoint_t gid = HB_SET_VALUE_INVALID;
+ unsigned int length = 0;
+ for (unsigned int i = 0; all_gids_to_retain->next (&gid); i++) {
if (!retain_gids)
{
- glyph_map->set (glyphs[i], i);
- reverse_glyph_map->set (i, glyphs[i]);
+ glyph_map->set (gid, i);
+ reverse_glyph_map->set (i, gid);
}
else
{
- glyph_map->set (glyphs[i], glyphs[i]);
- reverse_glyph_map->set (glyphs[i], glyphs[i]);
+ glyph_map->set (gid, gid);
+ reverse_glyph_map->set (gid, gid);
}
+ ++length;
}
- if (!retain_gids || glyphs.length == 0)
+ if (!retain_gids || length == 0)
{
- *num_glyphs = glyphs.length;
+ *num_glyphs = length;
}
else
{
@@ -213,18 +215,16 @@ hb_subset_plan_create (hb_face_t *face,
plan->codepoint_to_glyph = hb_map_create();
plan->glyph_map = hb_map_create();
plan->reverse_glyph_map = hb_map_create();
- hb_vector_t<hb_codepoint_t> glyphs;
plan->_glyphset = _populate_gids_to_retain (face,
input->unicodes,
input->glyphs,
!plan->drop_layout,
plan->unicodes,
- plan->codepoint_to_glyph,
- &glyphs);
+ plan->codepoint_to_glyph);
_create_old_gid_to_new_gid_map (face,
input->retain_gids,
- glyphs,
+ plan->_glyphset,
plan->glyph_map,
plan->reverse_glyph_map,
&plan->_num_output_glyphs);