cpdf-source/cpdftruetype.mli

33 lines
1021 B
OCaml
Raw Normal View History

2023-07-27 14:33:44 +02:00
(** Parse and subset TrueType fonts *)
2022-10-04 23:15:14 +02:00
2023-07-27 14:33:44 +02:00
(** The type of a single parsed font, including everything needed to build a PDF font. *)
2022-09-11 15:52:08 +02:00
type t =
{flags : int;
minx : int;
miny : int;
maxx : int;
maxy : int;
italicangle : int;
ascent : int;
descent : int;
capheight : int;
stemv : int;
xheight : int;
avgwidth : int;
maxwidth : int;
firstchar : int;
lastchar : int;
widths : int array;
2022-10-10 15:51:58 +02:00
subset_fontfile : Pdfio.bytes;
subset : int list;
2022-10-10 17:40:57 +02:00
tounicode : (int, string) Hashtbl.t option}
2022-09-11 15:52:08 +02:00
2023-07-27 14:33:44 +02:00
(** Parse the given TrueType font file. It will return one or more fonts. The
2022-10-04 23:15:14 +02:00
first, a plain Latin font in the given encoding. Others are for the
2023-07-27 14:33:44 +02:00
additional characters in the font. You should supply a subset (a list of
unicode codepoints whose corresponding glyphs are required). *)
2023-07-06 17:26:33 +02:00
val parse : subset:int list -> Pdfio.bytes -> Pdftext.encoding -> t list
2024-06-21 18:27:40 +02:00
(** Return the list of cmaps from a font file (used for PDF/UA verification). *)
val cmaps : Pdfio.bytes -> (int * int) list