|
|
@ -97,7 +97,7 @@ struct CaretValueFormat1 |
|
|
|
friend struct CaretValue; |
|
|
|
friend struct CaretValue; |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
inline hb_position_t get_caret_value (hb_font_t *font, hb_direction_t direction, hb_codepoint_t glyph_id HB_UNUSED) const |
|
|
|
inline hb_position_t get_caret_value (hb_font_t *font, hb_direction_t direction) const |
|
|
|
{ |
|
|
|
{ |
|
|
|
return HB_DIRECTION_IS_HORIZONTAL (direction) ? font->em_scale_x (coordinate) : font->em_scale_y (coordinate); |
|
|
|
return HB_DIRECTION_IS_HORIZONTAL (direction) ? font->em_scale_x (coordinate) : font->em_scale_y (coordinate); |
|
|
|
} |
|
|
|
} |
|
|
@ -146,11 +146,11 @@ struct CaretValueFormat3 |
|
|
|
{ |
|
|
|
{ |
|
|
|
friend struct CaretValue; |
|
|
|
friend struct CaretValue; |
|
|
|
|
|
|
|
|
|
|
|
inline hb_position_t get_caret_value (hb_font_t *font, hb_direction_t direction, hb_codepoint_t glyph_id HB_UNUSED) const |
|
|
|
inline hb_position_t get_caret_value (hb_font_t *font, hb_direction_t direction, const VarStore &var_store) const |
|
|
|
{ |
|
|
|
{ |
|
|
|
return HB_DIRECTION_IS_HORIZONTAL (direction) ? |
|
|
|
return HB_DIRECTION_IS_HORIZONTAL (direction) ? |
|
|
|
font->em_scale_x (coordinate) + (this+deviceTable).get_x_delta (font) : |
|
|
|
font->em_scale_x (coordinate) + (this+deviceTable).get_x_delta (font, var_store) : |
|
|
|
font->em_scale_y (coordinate) + (this+deviceTable).get_y_delta (font); |
|
|
|
font->em_scale_y (coordinate) + (this+deviceTable).get_y_delta (font, var_store); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
inline bool sanitize (hb_sanitize_context_t *c) const |
|
|
|
inline bool sanitize (hb_sanitize_context_t *c) const |
|
|
@ -172,12 +172,15 @@ struct CaretValueFormat3 |
|
|
|
|
|
|
|
|
|
|
|
struct CaretValue |
|
|
|
struct CaretValue |
|
|
|
{ |
|
|
|
{ |
|
|
|
inline hb_position_t get_caret_value (hb_font_t *font, hb_direction_t direction, hb_codepoint_t glyph_id) const |
|
|
|
inline hb_position_t get_caret_value (hb_font_t *font, |
|
|
|
|
|
|
|
hb_direction_t direction, |
|
|
|
|
|
|
|
hb_codepoint_t glyph_id, |
|
|
|
|
|
|
|
const VarStore &var_store) const |
|
|
|
{ |
|
|
|
{ |
|
|
|
switch (u.format) { |
|
|
|
switch (u.format) { |
|
|
|
case 1: return u.format1.get_caret_value (font, direction, glyph_id); |
|
|
|
case 1: return u.format1.get_caret_value (font, direction); |
|
|
|
case 2: return u.format2.get_caret_value (font, direction, glyph_id); |
|
|
|
case 2: return u.format2.get_caret_value (font, direction, glyph_id); |
|
|
|
case 3: return u.format3.get_caret_value (font, direction, glyph_id); |
|
|
|
case 3: return u.format3.get_caret_value (font, direction, var_store); |
|
|
|
default:return 0; |
|
|
|
default:return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -210,6 +213,7 @@ struct LigGlyph |
|
|
|
inline unsigned int get_lig_carets (hb_font_t *font, |
|
|
|
inline unsigned int get_lig_carets (hb_font_t *font, |
|
|
|
hb_direction_t direction, |
|
|
|
hb_direction_t direction, |
|
|
|
hb_codepoint_t glyph_id, |
|
|
|
hb_codepoint_t glyph_id, |
|
|
|
|
|
|
|
const VarStore &var_store, |
|
|
|
unsigned int start_offset, |
|
|
|
unsigned int start_offset, |
|
|
|
unsigned int *caret_count /* IN/OUT */, |
|
|
|
unsigned int *caret_count /* IN/OUT */, |
|
|
|
hb_position_t *caret_array /* OUT */) const |
|
|
|
hb_position_t *caret_array /* OUT */) const |
|
|
@ -218,7 +222,7 @@ struct LigGlyph |
|
|
|
const OffsetTo<CaretValue> *array = carets.sub_array (start_offset, caret_count); |
|
|
|
const OffsetTo<CaretValue> *array = carets.sub_array (start_offset, caret_count); |
|
|
|
unsigned int count = *caret_count; |
|
|
|
unsigned int count = *caret_count; |
|
|
|
for (unsigned int i = 0; i < count; i++) |
|
|
|
for (unsigned int i = 0; i < count; i++) |
|
|
|
caret_array[i] = (this+array[i]).get_caret_value (font, direction, glyph_id); |
|
|
|
caret_array[i] = (this+array[i]).get_caret_value (font, direction, glyph_id, var_store); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return carets.len; |
|
|
|
return carets.len; |
|
|
@ -244,6 +248,7 @@ struct LigCaretList |
|
|
|
inline unsigned int get_lig_carets (hb_font_t *font, |
|
|
|
inline unsigned int get_lig_carets (hb_font_t *font, |
|
|
|
hb_direction_t direction, |
|
|
|
hb_direction_t direction, |
|
|
|
hb_codepoint_t glyph_id, |
|
|
|
hb_codepoint_t glyph_id, |
|
|
|
|
|
|
|
const VarStore &var_store, |
|
|
|
unsigned int start_offset, |
|
|
|
unsigned int start_offset, |
|
|
|
unsigned int *caret_count /* IN/OUT */, |
|
|
|
unsigned int *caret_count /* IN/OUT */, |
|
|
|
hb_position_t *caret_array /* OUT */) const |
|
|
|
hb_position_t *caret_array /* OUT */) const |
|
|
@ -256,7 +261,7 @@ struct LigCaretList |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
const LigGlyph &lig_glyph = this+ligGlyph[index]; |
|
|
|
const LigGlyph &lig_glyph = this+ligGlyph[index]; |
|
|
|
return lig_glyph.get_lig_carets (font, direction, glyph_id, start_offset, caret_count, caret_array); |
|
|
|
return lig_glyph.get_lig_carets (font, direction, glyph_id, var_store, start_offset, caret_count, caret_array); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
inline bool sanitize (hb_sanitize_context_t *c) const |
|
|
|
inline bool sanitize (hb_sanitize_context_t *c) const |
|
|
@ -367,7 +372,9 @@ struct GDEF |
|
|
|
unsigned int start_offset, |
|
|
|
unsigned int start_offset, |
|
|
|
unsigned int *caret_count /* IN/OUT */, |
|
|
|
unsigned int *caret_count /* IN/OUT */, |
|
|
|
hb_position_t *caret_array /* OUT */) const |
|
|
|
hb_position_t *caret_array /* OUT */) const |
|
|
|
{ return (this+ligCaretList).get_lig_carets (font, direction, glyph_id, start_offset, caret_count, caret_array); } |
|
|
|
{ return (this+ligCaretList).get_lig_carets (font, |
|
|
|
|
|
|
|
direction, glyph_id, get_var_store(), |
|
|
|
|
|
|
|
start_offset, caret_count, caret_array); } |
|
|
|
|
|
|
|
|
|
|
|
inline bool has_mark_sets (void) const { return version.to_int () >= 0x00010002u && markGlyphSetsDef != 0; } |
|
|
|
inline bool has_mark_sets (void) const { return version.to_int () >= 0x00010002u && markGlyphSetsDef != 0; } |
|
|
|
inline bool mark_set_covers (unsigned int set_index, hb_codepoint_t glyph_id) const |
|
|
|
inline bool mark_set_covers (unsigned int set_index, hb_codepoint_t glyph_id) const |
|
|
|