@@ -57,15 +57,15 @@ def cmap_subtable_format4 : Repr platform_id -> Format = fun platform => {
5757 length < - u16be ,
5858 language < - cmap_language_id platform ,
5959 seg_count_x2 < - u16be ,
60- let seg_count : U16 = seg_count_x2 / (2 : U16 ),
60+ let seg_count : U64 = u16_extend_u64 ( seg_count_x2 / (2 : U16 ) ),
6161 search_range < - u16be ,
6262 entry_selector < - u16be ,
6363 range_shift < - u16be ,
64- end_code < - repeat_len64 ( u16_extend_u64 seg_count ) u16be ,
64+ end_code < - repeat_len64 seg_count u16be ,
6565 _reserved_pad < - reserved s16be 0 ,
66- start_code < - repeat_len64 ( u16_extend_u64 seg_count ) u16be ,
67- id_delta < - repeat_len64 ( u16_extend_u64 seg_count ) s16be ,
68- id_range_offsets < - repeat_len64 ( u16_extend_u64 seg_count ) u16be ,
66+ start_code < - repeat_len64 seg_count u16be ,
67+ id_delta < - repeat_len64 seg_count s16be ,
68+ id_range_offsets < - repeat_len64 seg_count u16be ,
6969};
7070def cmap_subtable_format6 : Repr platform_id - > Format = fun platform => {
7171 length < - u16be ,
@@ -384,7 +384,8 @@ def simple_glyph : U16 -> Format = fun number_of_contours => {
384384 end_pts_of_contours < - repeat_len64 (u16_extend_u64 number_of_contours ) u16be ,
385385 instruction_length < - u16be ,
386386 instructions < - repeat_len64 (u16_extend_u64 instruction_length ) u8 ,
387- let last_end_point_index : U16 = array64_index @(u16_extend_u64 number_of_contours ) @U16 (u16_extend_u64 number_of_contours - u16_extend_u64 1 ) end_pts_of_contours ,
387+ let last_end_point_index : U16 = array64_index @(u16_extend_u64 number_of_contours ) @U16 (u16_extend_u64 (number_of_contours - (1 :
388+ U16 ))) end_pts_of_contours ,
388389 let number_of_coords : U16 = last_end_point_index + (1 : U16 ),
389390};
390391def glyph : Format = {
0 commit comments