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