[lcar] Use dagger

This commit is contained in:
Ebrahim Byagowi 2020-06-19 19:22:47 +04:30
parent 6fbb59aba6
commit bb9a40da65
1 changed files with 13 additions and 10 deletions

View File

@ -53,9 +53,10 @@ struct lcarFormat0
const LigCaretClassEntry& array = entry_offset ? base+*entry_offset : Null (LigCaretClassEntry); const LigCaretClassEntry& array = entry_offset ? base+*entry_offset : Null (LigCaretClassEntry);
if (caret_count) if (caret_count)
{ {
hb_array_t<const HBINT16> arr = array.sub_array (start_offset, caret_count); + array.sub_array (start_offset, caret_count)
for (unsigned int i = 0; i < arr.length; ++i) | hb_map ([&] (int v) { return font->em_scale_dir (v, direction); })
caret_array[i] = font->em_scale_dir (arr[i], direction); | hb_sink (hb_array (caret_array, *caret_count))
;
} }
return array.len; return array.len;
} }
@ -88,13 +89,15 @@ struct lcarFormat1
const LigCaretClassEntry& array = entry_offset ? base+*entry_offset : Null (LigCaretClassEntry); const LigCaretClassEntry& array = entry_offset ? base+*entry_offset : Null (LigCaretClassEntry);
if (caret_count) if (caret_count)
{ {
hb_array_t<const HBINT16> arr = array.sub_array (start_offset, caret_count); + array.sub_array (start_offset, caret_count)
for (unsigned int i = 0; i < arr.length; ++i) | hb_map ([&] (unsigned int point_index)
{ {
hb_position_t x = 0, y = 0; hb_position_t x = 0, y = 0;
font->get_glyph_contour_point_for_origin (glyph, arr[i], direction, &x, &y); font->get_glyph_contour_point_for_origin (glyph, point_index, direction, &x, &y);
caret_array[i] = HB_DIRECTION_IS_HORIZONTAL (direction) ? x : y; return HB_DIRECTION_IS_HORIZONTAL (direction) ? x : y;
} })
| hb_sink (hb_array (caret_array, *caret_count))
;
} }
return array.len; return array.len;
} }