This commit is contained in:
John Whitington 2021-11-12 13:56:41 -08:00
parent 7df08c1f1c
commit 8d54241bfe
1 changed files with 6 additions and 2 deletions

View File

@ -3352,8 +3352,9 @@ let print_font_encoding pdf fontname pagenumber =
match !font with Some f -> f | None -> failwith (Printf.sprintf "print_font_encoding: font %s not found" fontname) match !font with Some f -> f | None -> failwith (Printf.sprintf "print_font_encoding: font %s not found" fontname)
end end
in in
let pdftextfont = Pdftext.read_font pdf font in
let charset = let charset =
match Pdftext.read_font pdf font with match pdftextfont with
| Pdftext.SimpleFont {Pdftext.fontdescriptor = Some {Pdftext.charset = Some cs}} -> Some cs | Pdftext.SimpleFont {Pdftext.fontdescriptor = Some {Pdftext.charset = Some cs}} -> Some cs
| _ -> None | _ -> None
in in
@ -3371,7 +3372,10 @@ let print_font_encoding pdf fontname pagenumber =
x.Cpdfunicodedata.iso_10646_comment_field)) x.Cpdfunicodedata.iso_10646_comment_field))
unicodedata; unicodedata;
for x = 0 to 255 do for x = 0 to 255 do
let str = string_of_char (char_of_int x) in let str =
(if Pdftext.is_identity_h pdftextfont then "\000" else "")
^ string_of_char (char_of_int x)
in
let codepoints = Pdftext.codepoints_of_text extractor str in let codepoints = Pdftext.codepoints_of_text extractor str in
let unicodenumber, unicodename, is_control = let unicodenumber, unicodename, is_control =
match codepoints with match codepoints with