From 0628cb02514a9c2ad68baa263bd5e7c75c9a4a49 Mon Sep 17 00:00:00 2001 From: John Whitington Date: Wed, 5 Jul 2023 13:22:25 +0100 Subject: [PATCH] Fix (1, 0) cmap --- cpdftruetype.ml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cpdftruetype.ml b/cpdftruetype.ml index 4c1d97c..3ed40bc 100644 --- a/cpdftruetype.ml +++ b/cpdftruetype.ml @@ -322,7 +322,7 @@ let write_cmap_table subset cmap bs = putval bs 16 0l; (* table version number *) putval bs 16 1l; (* number of encoding tables *) putval bs 16 1l; (* platform ID *) - putval bs 16 1l; (* platform encoding ID *) + putval bs 16 0l; (* platform encoding ID *) putval bs 32 12l; (* subtable offset = 12 bytes from beginning of table *) putval bs 16 6l; (* Table format 6 *) putval bs 16 (i32ofi (10 + 2 * length glyphindexes)); (* subtable length *) @@ -518,10 +518,11 @@ let write_font filename data = close_out fh let find_main encoding subset = - let encoding_table = Pdftext.table_of_encoding encoding in + cleave subset 3 + (*let encoding_table = Pdftext.table_of_encoding encoding in List.partition (fun u -> try ignore (Hashtbl.find encoding_table u); true with Not_found -> false) - subset + subset*) let parse ?(subset=[]) data encoding = if !dbg then