diff options
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff-common.hh')
-rw-r--r-- | Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff-common.hh | 296 |
1 files changed, 147 insertions, 149 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff-common.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff-common.hh index 820a0908509..915b4c45287 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff-common.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset-cff-common.hh @@ -35,16 +35,16 @@ namespace CFF { /* Used for writing a temporary charstring */ -struct StrEncoder +struct str_encoder_t { - StrEncoder (StrBuff &buff_) + str_encoder_t (str_buff_t &buff_) : buff (buff_), error (false) {} void reset () { buff.resize (0); } void encode_byte (unsigned char b) { - if (unlikely (buff.push ((const char)b) == &Crap(char))) + if (unlikely (buff.push (b) == &Crap(unsigned char))) set_error (); } @@ -79,7 +79,7 @@ struct StrEncoder } } - void encode_num (const Number& n) + void encode_num (const number_t& n) { if (n.in_int_range ()) { @@ -96,7 +96,7 @@ struct StrEncoder } } - void encode_op (OpCode op) + void encode_op (op_code_t op) { if (Is_OpCode_ESC (op)) { @@ -107,16 +107,16 @@ struct StrEncoder encode_byte (op); } - void copy_str (const ByteStr &str) + void copy_str (const byte_str_t &str) { - unsigned int offset = buff.len; - buff.resize (offset + str.len); - if (unlikely (buff.len < offset + str.len)) + unsigned int offset = buff.length; + buff.resize (offset + str.length); + if (unlikely (buff.length < offset + str.length)) { set_error (); return; } - memcpy (&buff[offset], &str.str[0], str.len); + memcpy (&buff[offset], &str[0], str.length); } bool is_error () const { return error; } @@ -124,12 +124,12 @@ struct StrEncoder protected: void set_error () { error = true; } - StrBuff &buff; + str_buff_t &buff; bool error; }; -struct CFFSubTableOffsets { - CFFSubTableOffsets () : privateDictsOffset (0) +struct cff_sub_table_offsets_t { + cff_sub_table_offsets_t () : privateDictsOffset (0) { topDictInfo.init (); FDSelectInfo.init (); @@ -139,23 +139,23 @@ struct CFFSubTableOffsets { localSubrsInfos.init (); } - ~CFFSubTableOffsets () { localSubrsInfos.fini (); } + ~cff_sub_table_offsets_t () { localSubrsInfos.fini (); } - TableInfo topDictInfo; - TableInfo FDSelectInfo; - TableInfo FDArrayInfo; - TableInfo charStringsInfo; + table_info_t topDictInfo; + table_info_t FDSelectInfo; + table_info_t FDArrayInfo; + table_info_t charStringsInfo; unsigned int privateDictsOffset; - TableInfo globalSubrsInfo; - hb_vector_t<TableInfo> localSubrsInfos; + table_info_t globalSubrsInfo; + hb_vector_t<table_info_t> localSubrsInfos; }; -template <typename OPSTR=OpStr> -struct CFFTopDict_OpSerializer : OpSerializer +template <typename OPSTR=op_str_t> +struct cff_top_dict_op_serializer_t : op_serializer_t { bool serialize (hb_serialize_context_t *c, const OPSTR &opstr, - const CFFSubTableOffsets &offsets) const + const cff_sub_table_offsets_t &offsets) const { TRACE_SERIALIZE (this); @@ -186,16 +186,16 @@ struct CFFTopDict_OpSerializer : OpSerializer return OpCode_Size (OpCode_longintdict) + 4 + OpCode_Size (opstr.op); default: - return opstr.str.len; + return opstr.str.length; } } }; -struct CFFFontDict_OpSerializer : OpSerializer +struct cff_font_dict_op_serializer_t : op_serializer_t { bool serialize (hb_serialize_context_t *c, - const OpStr &opstr, - const TableInfo &privateDictInfo) const + const op_str_t &opstr, + const table_info_t &privateDictInfo) const { TRACE_SERIALIZE (this); @@ -215,34 +215,34 @@ struct CFFFontDict_OpSerializer : OpSerializer } else { - HBUINT8 *d = c->allocate_size<HBUINT8> (opstr.str.len); + HBUINT8 *d = c->allocate_size<HBUINT8> (opstr.str.length); if (unlikely (d == nullptr)) return_trace (false); - memcpy (d, &opstr.str.str[0], opstr.str.len); + memcpy (d, &opstr.str[0], opstr.str.length); } return_trace (true); } - unsigned int calculate_serialized_size (const OpStr &opstr) const + unsigned int calculate_serialized_size (const op_str_t &opstr) const { if (opstr.op == OpCode_Private) return OpCode_Size (OpCode_longintdict) + 4 + OpCode_Size (OpCode_shortint) + 2 + OpCode_Size (OpCode_Private); else - return opstr.str.len; + return opstr.str.length; } }; -struct CFFPrivateDict_OpSerializer : OpSerializer +struct cff_private_dict_op_serializer_t : op_serializer_t { - CFFPrivateDict_OpSerializer (bool desubroutinize_, bool drop_hints_) + cff_private_dict_op_serializer_t (bool desubroutinize_, bool drop_hints_) : desubroutinize (desubroutinize_), drop_hints (drop_hints_) {} bool serialize (hb_serialize_context_t *c, - const OpStr &opstr, + const op_str_t &opstr, const unsigned int subrsOffset) const { TRACE_SERIALIZE (this); - if (drop_hints && DictOpSet::is_hint_op (opstr.op)) + if (drop_hints && dict_opset_t::is_hint_op (opstr.op)) return true; if (opstr.op == OpCode_Subrs) { @@ -255,10 +255,10 @@ struct CFFPrivateDict_OpSerializer : OpSerializer return_trace (copy_opstr (c, opstr)); } - unsigned int calculate_serialized_size (const OpStr &opstr, + unsigned int calculate_serialized_size (const op_str_t &opstr, bool has_localsubr=true) const { - if (drop_hints && DictOpSet::is_hint_op (opstr.op)) + if (drop_hints && dict_opset_t::is_hint_op (opstr.op)) return 0; if (opstr.op == OpCode_Subrs) { @@ -268,7 +268,7 @@ struct CFFPrivateDict_OpSerializer : OpSerializer return OpCode_Size (OpCode_shortint) + 2 + OpCode_Size (opstr.op); } else - return opstr.str.len; + return opstr.str.length; } protected: @@ -276,39 +276,36 @@ struct CFFPrivateDict_OpSerializer : OpSerializer const bool drop_hints; }; -struct FlattenParam +struct flatten_param_t { - StrBuff &flatStr; + str_buff_t &flatStr; bool drop_hints; }; template <typename ACC, typename ENV, typename OPSET> -struct SubrFlattener +struct subr_flattener_t { - SubrFlattener (const ACC &acc_, - const hb_vector_t<hb_codepoint_t> &glyphs_, - bool drop_hints_) - : acc (acc_), - glyphs (glyphs_), - drop_hints (drop_hints_) - {} + subr_flattener_t (const ACC &acc_, + const hb_vector_t<hb_codepoint_t> &glyphs_, + bool drop_hints_) : acc (acc_), glyphs (glyphs_), + drop_hints (drop_hints_) {} - bool flatten (StrBuffArray &flat_charstrings) + bool flatten (str_buff_vec_t &flat_charstrings) { - if (!flat_charstrings.resize (glyphs.len)) + if (!flat_charstrings.resize (glyphs.length)) return false; - for (unsigned int i = 0; i < glyphs.len; i++) + for (unsigned int i = 0; i < glyphs.length; i++) flat_charstrings[i].init (); - for (unsigned int i = 0; i < glyphs.len; i++) + for (unsigned int i = 0; i < glyphs.length; i++) { hb_codepoint_t glyph = glyphs[i]; - const ByteStr str = (*acc.charStrings)[glyph]; + const byte_str_t str = (*acc.charStrings)[glyph]; unsigned int fd = acc.fdSelect->get_fd (glyph); if (unlikely (fd >= acc.fdCount)) return false; - CSInterpreter<ENV, OPSET, FlattenParam> interp; + cs_interpreter_t<ENV, OPSET, flatten_param_t> interp; interp.env.init (str, acc, fd); - FlattenParam param = { flat_charstrings[i], drop_hints }; + flatten_param_t param = { flat_charstrings[i], drop_hints }; if (unlikely (!interp.interpret (param))) return false; } @@ -320,9 +317,9 @@ struct SubrFlattener bool drop_hints; }; -struct SubrClosures +struct subr_closures_t { - SubrClosures () : valid (false), global_closure (nullptr) + subr_closures_t () : valid (false), global_closure (nullptr) { local_closures.init (); } void init (unsigned int fd_count) @@ -334,7 +331,7 @@ struct SubrClosures if (!local_closures.resize (fd_count)) valid = false; - for (unsigned int i = 0; i < local_closures.len; i++) + for (unsigned int i = 0; i < local_closures.length; i++) { local_closures[i] = hb_set_create (); if (local_closures[i] == hb_set_get_empty ()) @@ -345,7 +342,7 @@ struct SubrClosures void fini () { hb_set_destroy (global_closure); - for (unsigned int i = 0; i < local_closures.len; i++) + for (unsigned int i = 0; i < local_closures.length; i++) hb_set_destroy (local_closures[i]); local_closures.fini (); } @@ -353,7 +350,7 @@ struct SubrClosures void reset () { hb_set_clear (global_closure); - for (unsigned int i = 0; i < local_closures.len; i++) + for (unsigned int i = 0; i < local_closures.length; i++) hb_set_clear (local_closures[i]); } @@ -363,18 +360,18 @@ struct SubrClosures hb_vector_t<hb_set_t *> local_closures; }; -struct ParsedCSOp : OpStr +struct parsed_cs_op_t : op_str_t { void init (unsigned int subr_num_ = 0) { - OpStr::init (); + op_str_t::init (); subr_num = subr_num_; drop_flag = false; keep_flag = false; skip_flag = false; } - void fini () { OpStr::fini (); } + void fini () { op_str_t::fini (); } bool for_drop () const { return drop_flag; } void set_drop () { if (!for_keep ()) drop_flag = true; } @@ -393,7 +390,7 @@ struct ParsedCSOp : OpStr bool skip_flag : 1; }; -struct ParsedCStr : ParsedValues<ParsedCSOp> +struct parsed_cs_str_t : parsed_values_t<parsed_cs_op_t> { void init () { @@ -403,13 +400,13 @@ struct ParsedCStr : ParsedValues<ParsedCSOp> has_prefix_ = false; } - void add_op (OpCode op, const SubByteStr& substr) + void add_op (op_code_t op, const byte_str_ref_t& str_ref) { if (!is_parsed ()) - SUPER::add_op (op, substr); + SUPER::add_op (op, str_ref); } - void add_call_op (OpCode op, const SubByteStr& substr, unsigned int subr_num) + void add_call_op (op_code_t op, const byte_str_ref_t& str_ref, unsigned int subr_num) { if (!is_parsed ()) { @@ -417,13 +414,13 @@ struct ParsedCStr : ParsedValues<ParsedCSOp> if (likely (parsed_len > 0)) values[parsed_len-1].set_skip (); - ParsedCSOp val; + parsed_cs_op_t val; val.init (subr_num); - SUPER::add_op (op, substr, val); + SUPER::add_op (op, str_ref, val); } } - void set_prefix (const Number &num, OpCode op = OpCode_Invalid) + void set_prefix (const number_t &num, op_code_t op = OpCode_Invalid) { has_prefix_ = true; prefix_op_ = op; @@ -432,7 +429,7 @@ struct ParsedCStr : ParsedValues<ParsedCSOp> bool at_end (unsigned int pos) const { - return ((pos + 1 >= values.len) /* CFF2 */ + return ((pos + 1 >= values.length) /* CFF2 */ || (values[pos + 1].op == OpCode_return)); } @@ -446,42 +443,42 @@ struct ParsedCStr : ParsedValues<ParsedCSOp> void set_vsindex_dropped () { vsindex_dropped = true; } bool has_prefix () const { return has_prefix_; } - OpCode prefix_op () const { return prefix_op_; } - const Number &prefix_num () const { return prefix_num_; } + op_code_t prefix_op () const { return prefix_op_; } + const number_t &prefix_num () const { return prefix_num_; } protected: bool parsed; bool hint_dropped; bool vsindex_dropped; bool has_prefix_; - OpCode prefix_op_; - Number prefix_num_; + op_code_t prefix_op_; + number_t prefix_num_; private: - typedef ParsedValues<ParsedCSOp> SUPER; + typedef parsed_values_t<parsed_cs_op_t> SUPER; }; -struct ParsedCStrs : hb_vector_t<ParsedCStr> +struct parsed_cs_str_vec_t : hb_vector_t<parsed_cs_str_t> { void init (unsigned int len_ = 0) { SUPER::init (); resize (len_); - for (unsigned int i = 0; i < len; i++) + for (unsigned int i = 0; i < length; i++) (*this)[i].init (); } void fini () { SUPER::fini_deep (); } private: - typedef hb_vector_t<ParsedCStr> SUPER; + typedef hb_vector_t<parsed_cs_str_t> SUPER; }; -struct SubrSubsetParam +struct subr_subset_param_t { - void init (ParsedCStr *parsed_charstring_, - ParsedCStrs *parsed_global_subrs_, ParsedCStrs *parsed_local_subrs_, - hb_set_t *global_closure_, hb_set_t *local_closure_, - bool drop_hints_) + void init (parsed_cs_str_t *parsed_charstring_, + parsed_cs_str_vec_t *parsed_global_subrs_, parsed_cs_str_vec_t *parsed_local_subrs_, + hb_set_t *global_closure_, hb_set_t *local_closure_, + bool drop_hints_) { parsed_charstring = parsed_charstring_; current_parsed_str = parsed_charstring; @@ -492,7 +489,7 @@ struct SubrSubsetParam drop_hints = drop_hints_; } - ParsedCStr *get_parsed_str_for_context (CallContext &context) + parsed_cs_str_t *get_parsed_str_for_context (call_context_t &context) { switch (context.type) { @@ -500,12 +497,12 @@ struct SubrSubsetParam return parsed_charstring; case CSType_LocalSubr: - if (likely (context.subr_num < parsed_local_subrs->len)) + if (likely (context.subr_num < parsed_local_subrs->length)) return &(*parsed_local_subrs)[context.subr_num]; break; case CSType_GlobalSubr: - if (likely (context.subr_num < parsed_global_subrs->len)) + if (likely (context.subr_num < parsed_global_subrs->length)) return &(*parsed_global_subrs)[context.subr_num]; break; } @@ -515,13 +512,13 @@ struct SubrSubsetParam template <typename ENV> void set_current_str (ENV &env, bool calling) { - ParsedCStr *parsed_str = get_parsed_str_for_context (env.context); + parsed_cs_str_t *parsed_str = get_parsed_str_for_context (env.context); if (likely (parsed_str != nullptr)) { /* If the called subroutine is parsed partially but not completely yet, * it must be because we are calling it recursively. * Handle it as an error. */ - if (unlikely (calling && !parsed_str->is_parsed () && (parsed_str->values.len > 0))) + if (unlikely (calling && !parsed_str->is_parsed () && (parsed_str->values.length > 0))) env.set_error (); else current_parsed_str = parsed_str; @@ -530,17 +527,17 @@ struct SubrSubsetParam env.set_error (); } - ParsedCStr *current_parsed_str; + parsed_cs_str_t *current_parsed_str; - ParsedCStr *parsed_charstring; - ParsedCStrs *parsed_global_subrs; - ParsedCStrs *parsed_local_subrs; + parsed_cs_str_t *parsed_charstring; + parsed_cs_str_vec_t *parsed_global_subrs; + parsed_cs_str_vec_t *parsed_local_subrs; hb_set_t *global_closure; hb_set_t *local_closure; bool drop_hints; }; -struct SubrRemap : Remap +struct subr_remap_t : remap_t { void create (hb_set_t *closure) { @@ -548,7 +545,7 @@ struct SubrRemap : Remap * no optimization based on usage counts. fonttools doesn't appear doing that either. */ reset (closure->get_max () + 1); - for (hb_codepoint_t old_num = 0; old_num < len; old_num++) + for (hb_codepoint_t old_num = 0; old_num < length; old_num++) { if (hb_set_has (closure, old_num)) add (old_num); @@ -564,10 +561,10 @@ struct SubrRemap : Remap hb_codepoint_t operator[] (unsigned int old_num) const { - if (old_num >= len) + if (old_num >= length) return CFF_UNDEF_CODE; else - return Remap::operator[] (old_num); + return remap_t::operator[] (old_num); } int biased_num (unsigned int old_num) const @@ -580,15 +577,15 @@ struct SubrRemap : Remap int bias; }; -struct SubrRemaps +struct subr_remap_ts { - SubrRemaps () + subr_remap_ts () { global_remap.init (); local_remaps.init (); } - ~SubrRemaps () { fini (); } + ~subr_remap_ts () { fini (); } void init (unsigned int fdCount) { @@ -597,10 +594,10 @@ struct SubrRemaps local_remaps[i].init (); } - void create (SubrClosures& closures) + void create (subr_closures_t& closures) { global_remap.create (closures.global_closure); - for (unsigned int i = 0; i < local_remaps.len; i++) + for (unsigned int i = 0; i < local_remaps.length; i++) local_remaps[i].create (closures.local_closures[i]); } @@ -610,21 +607,21 @@ struct SubrRemaps local_remaps.fini_deep (); } - SubrRemap global_remap; - hb_vector_t<SubrRemap> local_remaps; + subr_remap_t global_remap; + hb_vector_t<subr_remap_t> local_remaps; }; template <typename SUBSETTER, typename SUBRS, typename ACC, typename ENV, typename OPSET> -struct SubrSubsetter +struct subr_subsetter_t { - SubrSubsetter () + subr_subsetter_t () { parsed_charstrings.init (); parsed_global_subrs.init (); parsed_local_subrs.init (); } - ~SubrSubsetter () + ~subr_subsetter_t () { closures.fini (); remaps.fini (); @@ -652,7 +649,7 @@ struct SubrSubsetter closures.init (acc.fdCount); remaps.init (acc.fdCount); - parsed_charstrings.init (glyphs.len); + parsed_charstrings.init (glyphs.length); parsed_global_subrs.init (acc.globalSubrs->count); parsed_local_subrs.resize (acc.fdCount); for (unsigned int i = 0; i < acc.fdCount; i++) @@ -663,18 +660,18 @@ struct SubrSubsetter return false; /* phase 1 & 2 */ - for (unsigned int i = 0; i < glyphs.len; i++) + for (unsigned int i = 0; i < glyphs.length; i++) { hb_codepoint_t glyph = glyphs[i]; - const ByteStr str = (*acc.charStrings)[glyph]; + const byte_str_t str = (*acc.charStrings)[glyph]; unsigned int fd = acc.fdSelect->get_fd (glyph); if (unlikely (fd >= acc.fdCount)) return false; - CSInterpreter<ENV, OPSET, SubrSubsetParam> interp; + cs_interpreter_t<ENV, OPSET, subr_subset_param_t> interp; interp.env.init (str, acc, fd); - SubrSubsetParam param; + subr_subset_param_t param; param.init (&parsed_charstrings[i], &parsed_global_subrs, &parsed_local_subrs[fd], closures.global_closure, closures.local_closures[fd], @@ -690,18 +687,18 @@ struct SubrSubsetter if (drop_hints) { /* mark hint ops and arguments for drop */ - for (unsigned int i = 0; i < glyphs.len; i++) + for (unsigned int i = 0; i < glyphs.length; i++) { unsigned int fd = acc.fdSelect->get_fd (glyphs[i]); if (unlikely (fd >= acc.fdCount)) return false; - SubrSubsetParam param; + subr_subset_param_t param; param.init (&parsed_charstrings[i], &parsed_global_subrs, &parsed_local_subrs[fd], closures.global_closure, closures.local_closures[fd], drop_hints); - DropHintsParam drop; + drop_hints_param_t drop; if (drop_hints_in_str (parsed_charstrings[i], param, drop)) { parsed_charstrings[i].set_hint_dropped (); @@ -712,12 +709,12 @@ struct SubrSubsetter /* after dropping hints recreate closures of actually used subrs */ closures.reset (); - for (unsigned int i = 0; i < glyphs.len; i++) + for (unsigned int i = 0; i < glyphs.length; i++) { unsigned int fd = acc.fdSelect->get_fd (glyphs[i]); if (unlikely (fd >= acc.fdCount)) return false; - SubrSubsetParam param; + subr_subset_param_t param; param.init (&parsed_charstrings[i], &parsed_global_subrs, &parsed_local_subrs[fd], closures.global_closure, closures.local_closures[fd], @@ -731,11 +728,11 @@ struct SubrSubsetter return true; } - bool encode_charstrings (ACC &acc, const hb_vector_t<hb_codepoint_t> &glyphs, StrBuffArray &buffArray) const + bool encode_charstrings (ACC &acc, const hb_vector_t<hb_codepoint_t> &glyphs, str_buff_vec_t &buffArray) const { - if (unlikely (!buffArray.resize (glyphs.len))) + if (unlikely (!buffArray.resize (glyphs.length))) return false; - for (unsigned int i = 0; i < glyphs.len; i++) + for (unsigned int i = 0; i < glyphs.length; i++) { unsigned int fd = acc.fdSelect->get_fd (glyphs[i]); if (unlikely (fd >= acc.fdCount)) @@ -746,13 +743,13 @@ struct SubrSubsetter return true; } - bool encode_subrs (const ParsedCStrs &subrs, const SubrRemap& remap, unsigned int fd, StrBuffArray &buffArray) const + bool encode_subrs (const parsed_cs_str_vec_t &subrs, const subr_remap_t& remap, unsigned int fd, str_buff_vec_t &buffArray) const { unsigned int count = remap.get_count (); if (unlikely (!buffArray.resize (count))) return false; - for (unsigned int old_num = 0; old_num < subrs.len; old_num++) + for (unsigned int old_num = 0; old_num < subrs.length; old_num++) { hb_codepoint_t new_num = remap[old_num]; if (new_num != CFF_UNDEF_CODE) @@ -764,20 +761,20 @@ struct SubrSubsetter return true; } - bool encode_globalsubrs (StrBuffArray &buffArray) + bool encode_globalsubrs (str_buff_vec_t &buffArray) { return encode_subrs (parsed_global_subrs, remaps.global_remap, 0, buffArray); } - bool encode_localsubrs (unsigned int fd, StrBuffArray &buffArray) const + bool encode_localsubrs (unsigned int fd, str_buff_vec_t &buffArray) const { return encode_subrs (parsed_local_subrs[fd], remaps.local_remaps[fd], fd, buffArray); } protected: - struct DropHintsParam + struct drop_hints_param_t { - DropHintsParam () + drop_hints_param_t () : seen_moveto (false), ends_in_hint (false), vsindex_dropped (false) {} @@ -787,9 +784,9 @@ struct SubrSubsetter bool vsindex_dropped; }; - bool drop_hints_in_subr (ParsedCStr &str, unsigned int pos, - ParsedCStrs &subrs, unsigned int subr_num, - const SubrSubsetParam ¶m, DropHintsParam &drop) + bool drop_hints_in_subr (parsed_cs_str_t &str, unsigned int pos, + parsed_cs_str_vec_t &subrs, unsigned int subr_num, + const subr_subset_param_t ¶m, drop_hints_param_t &drop) { drop.ends_in_hint = false; bool has_hint = drop_hints_in_str (subrs[subr_num], param, drop); @@ -809,11 +806,11 @@ struct SubrSubsetter } /* returns true if it sees a hint op before the first moveto */ - bool drop_hints_in_str (ParsedCStr &str, const SubrSubsetParam ¶m, DropHintsParam &drop) + bool drop_hints_in_str (parsed_cs_str_t &str, const subr_subset_param_t ¶m, drop_hints_param_t &drop) { bool seen_hint = false; - for (unsigned int pos = 0; pos < str.values.len; pos++) + for (unsigned int pos = 0; pos < str.values.length; pos++) { bool has_hint = false; switch (str.values[pos].op) @@ -868,7 +865,7 @@ struct SubrSubsetter { for (int i = pos - 1; i >= 0; i--) { - ParsedCSOp &csop = str.values[(unsigned)i]; + parsed_cs_op_t &csop = str.values[(unsigned)i]; if (csop.for_drop ()) break; csop.set_drop (); @@ -882,18 +879,18 @@ struct SubrSubsetter return seen_hint; } - void collect_subr_refs_in_subr (ParsedCStr &str, unsigned int pos, - unsigned int subr_num, ParsedCStrs &subrs, + void collect_subr_refs_in_subr (parsed_cs_str_t &str, unsigned int pos, + unsigned int subr_num, parsed_cs_str_vec_t &subrs, hb_set_t *closure, - const SubrSubsetParam ¶m) + const subr_subset_param_t ¶m) { hb_set_add (closure, subr_num); collect_subr_refs_in_str (subrs[subr_num], param); } - void collect_subr_refs_in_str (ParsedCStr &str, const SubrSubsetParam ¶m) + void collect_subr_refs_in_str (parsed_cs_str_t &str, const subr_subset_param_t ¶m) { - for (unsigned int pos = 0; pos < str.values.len; pos++) + for (unsigned int pos = 0; pos < str.values.length; pos++) { if (!str.values[pos].for_drop ()) { @@ -917,10 +914,10 @@ struct SubrSubsetter } } - bool encode_str (const ParsedCStr &str, const unsigned int fd, StrBuff &buff) const + bool encode_str (const parsed_cs_str_t &str, const unsigned int fd, str_buff_t &buff) const { buff.init (); - StrEncoder encoder (buff); + str_encoder_t encoder (buff); encoder.reset (); /* if a prefix (CFF1 width or CFF2 vsindex) has been removed along with hints, * re-insert it at the beginning of charstreing */ @@ -932,7 +929,7 @@ struct SubrSubsetter } for (unsigned int i = 0; i < str.get_count(); i++) { - const ParsedCSOp &opstr = str.values[i]; + const parsed_cs_op_t &opstr = str.values[i]; if (!opstr.for_drop () && !opstr.for_skip ()) { switch (opstr.op) @@ -957,18 +954,19 @@ struct SubrSubsetter } protected: - SubrClosures closures; + subr_closures_t closures; - ParsedCStrs parsed_charstrings; - ParsedCStrs parsed_global_subrs; - hb_vector_t<ParsedCStrs> parsed_local_subrs; + parsed_cs_str_vec_t parsed_charstrings; + parsed_cs_str_vec_t parsed_global_subrs; + hb_vector_t<parsed_cs_str_vec_t> parsed_local_subrs; - SubrRemaps remaps; + subr_remap_ts remaps; private: typedef typename SUBRS::count_type subr_count_type; }; -}; /* namespace CFF */ + +} /* namespace CFF */ HB_INTERNAL bool hb_plan_subset_cff_fdselect (const hb_vector_t<hb_codepoint_t> &glyphs, @@ -977,8 +975,8 @@ hb_plan_subset_cff_fdselect (const hb_vector_t<hb_codepoint_t> &glyphs, unsigned int &subset_fd_count /* OUT */, unsigned int &subset_fdselect_size /* OUT */, unsigned int &subset_fdselect_format /* OUT */, - hb_vector_t<CFF::code_pair> &fdselect_ranges /* OUT */, - CFF::Remap &fdmap /* OUT */); + hb_vector_t<CFF::code_pair_t> &fdselect_ranges /* OUT */, + CFF::remap_t &fdmap /* OUT */); HB_INTERNAL bool hb_serialize_cff_fdselect (hb_serialize_context_t *c, @@ -987,6 +985,6 @@ hb_serialize_cff_fdselect (hb_serialize_context_t *c, unsigned int fd_count, unsigned int fdselect_format, unsigned int size, - const hb_vector_t<CFF::code_pair> &fdselect_ranges); + const hb_vector_t<CFF::code_pair_t> &fdselect_ranges); #endif /* HB_SUBSET_CFF_COMMON_HH */ |