26 #ifndef HB_OT_POST_TABLE_V2SUBSET_HH
27 #define HB_OT_POST_TABLE_V2SUBSET_HH
38 template<
typename Iterator>
41 const void* _post)
const
44 auto *
out =
c->start_embed (
this);
46 if (!
out->glyphNameIndex.serialize (
c, +
it
51 for (
const auto&
_ : +
it )
53 unsigned glyph_id =
_.first;
54 unsigned new_index =
_.second;
56 if (new_index < 258)
continue;
57 if (copied_indices.
has (new_index))
continue;
58 copied_indices.
add (new_index);
64 memcpy (
o+1,
s.arrayZ, HBUINT8::static_size *
s.length);
74 const hb_map_t &reverse_glyph_map = *
c->plan->reverse_glyph_map;
75 unsigned num_glyphs =
c->plan->num_output_glyphs ();
76 hb_map_t old_new_index_map, old_gid_new_index_map;
81 hb_hashmap_t<
hb_bytes_t, unsigned, std::nullptr_t, unsigned,
nullptr, (unsigned)-1> glyph_name_to_new_index;
88 if (old_index <= 257) new_index = old_index;
89 else if (old_new_index_map.
has (old_index)) new_index = old_new_index_map.
get (old_index);
93 new_index = glyph_name_to_new_index.get (
s);
94 if (new_index == (
unsigned)-1)
96 int standard_glyph_index = -1;
97 for (
unsigned i = 0;
i < format1_names_length;
i++)
99 if (
s == format1_names (
i))
101 standard_glyph_index =
i;
106 if (standard_glyph_index == -1)
112 { new_index = standard_glyph_index; }
113 glyph_name_to_new_index.set (
s, new_index);
115 old_new_index_map.
set (old_index, new_index);
117 old_gid_new_index_map.
set (old_gid, new_index);
121 + hb_range (num_glyphs)
122 |
hb_map (reverse_glyph_map)
125 unsigned new_index = old_gid_new_index_map.
get (old_gid);
small capitals from c petite p scientific i
[1]
hb_array_t< const char > hb_bytes_t
#define TRACE_SERIALIZE(this)
#define return_trace(RET)
#define TRACE_SUBSET(this)
auto it hb_map(hb_second)) template< typename Type > inline hb_array_t< Type > operator()(hb_array_t< Type > array
@ HB_SERIALIZE_ERROR_INT_OVERFLOW
QTextStream out(stdout)
[7]
hb_bytes_t find_glyph_name(hb_codepoint_t glyph) const
bool serialize(hb_serialize_context_t *c, Iterator it, const void *_post) const
bool subset(hb_subset_context_t *c) const
Array16Of< HBUINT16 > glyphNameIndex
bool set(K key, const V &value)
bool has(K k, V *vp=nullptr) const
bool has(hb_codepoint_t k) const
void add(hb_codepoint_t g)