cpdf-source/cpdfembed.mli

22 lines
804 B
OCaml
Raw Normal View History

2022-09-20 15:54:45 +02:00
(* Embed a TrueType font for the given set of unicode codepoints in the given
2022-10-13 18:00:33 +02:00
encoding, adding the fontfiles to the PDF and returning a list of font objects,
together with a unicode codepoint --> (font number in list, charcode) table *)
type t = Pdftext.font list * (int, int * int) Hashtbl.t
2022-10-10 17:08:07 +02:00
2022-10-18 20:13:02 +02:00
type cpdffont =
PreMadeFontPack of t
2022-10-19 14:48:13 +02:00
| EmbedInfo of {fontfile : Pdfio.bytes; fontname : string; encoding : Pdftext.encoding}
2022-10-19 17:45:52 +02:00
| ExistingNamedFont
2022-10-18 20:13:02 +02:00
2023-02-20 13:56:59 +01:00
val fontpack_of_standardfont : Pdftext.font -> t
(* Returns (charcode, fontnumber, font) *)
2022-10-19 15:47:20 +02:00
val get_char : t -> int -> (int * int * Pdftext.font) option
2022-09-12 18:02:48 +02:00
val embed_truetype :
2022-09-20 15:54:45 +02:00
Pdf.t -> fontfile:Pdfio.bytes -> fontname:string -> codepoints:int list ->
2022-10-13 18:00:33 +02:00
encoding:Pdftext.encoding -> t
val collate_runs : ('a * 'b * 'c) list -> ('a * 'b * 'c) list list