more
This commit is contained in:
parent
d6a564daae
commit
e29add66b1
|
@ -535,7 +535,7 @@ let
|
|||
map (fun c -> unicode_codepoint_of_pdfcode encoding_table glyphlist_table (int_of_char c)) charcodes
|
||||
in
|
||||
let objnum = match fontpdfobj with Pdf.Indirect i -> i | _ -> failwith "bad fontpdfobj" in
|
||||
let font = snd (hd (Cpdfembed.embed_truetype !pdf ~fontfile ~fontname ~codepoints ~encoding)) in
|
||||
let font = hd (fst (Cpdfembed.embed_truetype !pdf ~fontfile ~fontname ~codepoints ~encoding)) in
|
||||
ignore (Pdftext.write_font ~objnum !pdf font)
|
||||
end;
|
||||
!pdf
|
||||
|
|
|
@ -3059,7 +3059,7 @@ let embed_font pdf =
|
|||
Pdfio.bytes_of_string (contents_of_file (Filename.concat dirname filename)),
|
||||
Filename.remove_extension filename
|
||||
in
|
||||
let font = snd (hd (Cpdfembed.embed_truetype pdf ~fontfile ~fontname ~codepoints:[] ~encoding:args.fontencoding)) in
|
||||
let font = hd (fst (Cpdfembed.embed_truetype pdf ~fontfile ~fontname ~codepoints:[] ~encoding:args.fontencoding)) in
|
||||
Some font, Some (pdf, fontfile, fontname, args.fontencoding)
|
||||
with
|
||||
e -> error (Printf.sprintf "Can't load font for embedding: %s\n" (Printexc.to_string e))
|
||||
|
@ -3069,7 +3069,7 @@ let embed_font pdf =
|
|||
end
|
||||
| OtherFont f -> None, None (* it's in fontname *)
|
||||
| FontToEmbed fontfile ->
|
||||
Some (snd (hd (Cpdfembed.embed_truetype pdf ~fontfile ~fontname:args.fontname ~codepoints:[] ~encoding:args.fontencoding))),
|
||||
Some (hd (fst (Cpdfembed.embed_truetype pdf ~fontfile ~fontname:args.fontname ~codepoints:[] ~encoding:args.fontencoding))),
|
||||
Some (pdf, fontfile, args.fontname, args.fontencoding)
|
||||
|
||||
(* Main function *)
|
||||
|
|
|
@ -44,7 +44,7 @@ let typeset ?embedinfo ~papersize ~font ~fontsize text =
|
|||
match embedinfo with
|
||||
| None -> font
|
||||
| Some (pdf, fontfile, fontname, encoding) ->
|
||||
snd (hd (Cpdfembed.embed_truetype pdf ~fontfile ~fontname ~codepoints ~encoding))
|
||||
hd (fst (Cpdfembed.embed_truetype pdf ~fontfile ~fontname ~codepoints ~encoding))
|
||||
in
|
||||
let pages =
|
||||
Cpdftype.typeset
|
||||
|
|
|
@ -115,7 +115,7 @@ let typeset_table_of_contents ?embedinfo ~font ~fontsize ~title ~bookmark pdf =
|
|||
match embedinfo with
|
||||
| None -> font
|
||||
| Some (pdf, fontfile, fontname, encoding) ->
|
||||
snd (hd (Cpdfembed.embed_truetype pdf ~fontfile ~fontname ~codepoints ~encoding))
|
||||
hd (fst (Cpdfembed.embed_truetype pdf ~fontfile ~fontname ~codepoints ~encoding))
|
||||
in
|
||||
Cpdftype.typeset lm rm tm bm firstpage_papersize pdf
|
||||
([Cpdftype.Font (font, bfs); Cpdftype.BeginDocument] @ title @
|
||||
|
|
Loading…
Reference in New Issue