From 3af58990e8c0afee1e3068f03d73aa92a510a2ff Mon Sep 17 00:00:00 2001 From: John Whitington Date: Fri, 16 Sep 2022 17:18:17 +0100 Subject: [PATCH] more --- cpdfembed.ml | 1 - cpdftruetype.ml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/cpdfembed.ml b/cpdfembed.ml index 359a844..5dcb21b 100644 --- a/cpdfembed.ml +++ b/cpdfembed.ml @@ -50,7 +50,6 @@ let string_of_encoding = function | Pdftext.StandardEncoding -> "/StandardEncoding" | _ -> failwith "unknown encoding" -(* FIXME add "" = full subset *) let embed_truetype pdf ~fontfile ~fontname ~text ~encoding = let unicodepoints = Pdftext.codepoints_of_utf8 text in let glyphlist_table = Pdfglyphlist.reverse_glyph_hashes () in diff --git a/cpdftruetype.ml b/cpdftruetype.ml index 899d858..09a33ab 100644 --- a/cpdftruetype.ml +++ b/cpdftruetype.ml @@ -195,7 +195,7 @@ let calculate_widths firstchar lastchar subset (cmapdata : (int, int) Hashtbl.t) (fun pos -> let code = pos + firstchar in if !dbg then Printf.printf "code %i --> " code; - if not (mem code subset) then 0 else + if subset <> [] && not (mem code subset) then 0 else try let glyphnum = Hashtbl.find cmapdata code in if !dbg then Printf.printf "glyph number %i --> " glyphnum;