From 300a2c504bb68594802af8187a9903a464d59939 Mon Sep 17 00:00:00 2001 From: John Whitington Date: Tue, 4 Jul 2023 15:58:38 +0100 Subject: [PATCH] more --- cpdftruetype.ml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cpdftruetype.ml b/cpdftruetype.ml index f392591..8f898e2 100644 --- a/cpdftruetype.ml +++ b/cpdftruetype.ml @@ -386,10 +386,12 @@ let subset_font major minor tables indexToLocFormat subset encoding cmap loca mk (fun i (tag, checkSum, offset, ttlength) -> if !dbg then Printf.printf "tag = %li = %s, offset = %li\n" tag (string_of_tag tag) offset; if mem (string_of_tag tag) required_tables then - tablesout := (tag, checkSum, i32sub offset !cut, ttlength)::!tablesout + tablesout := (tag, checkSum, i32sub offset !cut, ttlength)::!tablesout else - cut := i32add !cut (match tables.(i + 1) with (_, _, offset', _) -> i32sub offset' offset)) + if i < Array.length tables - 1 then + cut := i32add !cut (match tables.(i + 1) with (_, _, offset', _) -> i32sub offset' offset)) tables; + Printf.printf "*********** after iteri\n"; (* Reduce offsets by the reduction in header table size *) let header_size_reduction = i32ofi (16 * (Array.length tables - length !tablesout)) in let glyf_table_size_reduction = ref 0l in