From 794bedb91fcb1507f49a909702ff174da61a5c1d Mon Sep 17 00:00:00 2001 From: John Whitington Date: Tue, 11 Oct 2022 19:48:30 +0100 Subject: [PATCH] more --- cpdftruetype.ml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cpdftruetype.ml b/cpdftruetype.ml index fa7398c..31ed9a8 100644 --- a/cpdftruetype.ml +++ b/cpdftruetype.ml @@ -529,13 +529,16 @@ let parse ?(subset=[]) data encoding = subset_font major minor !tables indexToLocFormat (if subset = [] then [] else [hd subset]) encoding !glyphcodes loca mk_b glyfoffset data in - (*let subset_tounicode = - if subset = [] then None else Some (tounicode_map 0 [hd subset]) - in*) - (*begin match subset_tounicode with Some x -> Printf.printf "%S\n" (string_of_bytes x) | None -> () end;*) + let second_tounicode = + if subset = [] then None else + let h = null_hash () in + Hashtbl.add h 0 (string_of_int (hd subset)); + Some h + in [{flags; minx; miny; maxx; maxy; italicangle; ascent; descent; capheight; stemv; xheight; avgwidth; maxwidth; firstchar; lastchar; widths; subset_fontfile = main_subset; subset = if subset = [] then [] else tl subset; tounicode = None}; {flags; minx; miny; maxx; maxy; italicangle; ascent; descent; capheight; stemv; xheight; avgwidth; maxwidth; firstchar; lastchar; - widths; subset_fontfile = second_subset; subset = if subset = [] then [] else [hd subset]; tounicode = None}] + widths; subset_fontfile = second_subset; subset = if subset = [] then [] else [hd subset]; + tounicode = second_tounicode}]