Final v2.6 doc fixes

This commit is contained in:
John Whitington 2023-07-27 13:33:44 +01:00
parent 057434fb6a
commit 3816da6083
2 changed files with 11 additions and 7 deletions

View File

@ -1,3 +1,5 @@
(** Embed a TrueType font in a PDF *)
(* Embed a TrueType font for the given set of unicode codepoints in the given (* Embed a TrueType font for the given set of unicode codepoints in the given
encoding, adding the fontfiles to the PDF and returning a list of font objects, 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 *) together with a unicode codepoint --> (font number in list, charcode) table *)
@ -9,13 +11,16 @@ type cpdffont =
| EmbedInfo of {fontfile : Pdfio.bytes; fontname : string; encoding : Pdftext.encoding} | EmbedInfo of {fontfile : Pdfio.bytes; fontname : string; encoding : Pdftext.encoding}
| ExistingNamedFont | ExistingNamedFont
(** Build a fontpack for a Standard 14 font *)
val fontpack_of_standardfont : Pdftext.font -> t val fontpack_of_standardfont : Pdftext.font -> t
(* Returns (charcode, fontnumber, font) *) (** Look up a unicode codepoint in a font page. Returns (charcode, fontnumber, font) *)
val get_char : t -> int -> (int * int * Pdftext.font) option val get_char : t -> int -> (int * int * Pdftext.font) option
(** Build a fontpack from a TrueType font and list of codepoints, embedding its fonts in the document *)
val embed_truetype : val embed_truetype :
Pdf.t -> fontfile:Pdfio.bytes -> fontname:string -> codepoints:int list -> Pdf.t -> fontfile:Pdfio.bytes -> fontname:string -> codepoints:int list ->
encoding:Pdftext.encoding -> t encoding:Pdftext.encoding -> t
(** Collate outputs of [get_char] with like font *)
val collate_runs : ('a * 'b * 'c) list -> ('a * 'b * 'c) list list val collate_runs : ('a * 'b * 'c) list -> ('a * 'b * 'c) list list

View File

@ -1,6 +1,6 @@
(* Parse and subset TrueType fonts *) (** Parse and subset TrueType fonts *)
(* The type of a single parsed font, including everything needed to build a PDF font. *) (** The type of a single parsed font, including everything needed to build a PDF font. *)
type t = type t =
{flags : int; {flags : int;
minx : int; minx : int;
@ -22,9 +22,8 @@ type t =
subset : int list; subset : int list;
tounicode : (int, string) Hashtbl.t option} tounicode : (int, string) Hashtbl.t option}
(* Parse the given TrueType font file. It will return one or more fonts. The (** Parse the given TrueType font file. It will return one or more fonts. The
first, a plain Latin font in the given encoding. Others are for the first, a plain Latin font in the given encoding. Others are for the
additional characters in the font. For subsetting, or to return a full additional characters in the font. You should supply a subset (a list of
font-pack, you should supply a subset (a list of unicode codepoints whose unicode codepoints whose corresponding glyphs are required). *)
corresponding glyphs are required). *)
val parse : subset:int list -> Pdfio.bytes -> Pdftext.encoding -> t list val parse : subset:int list -> Pdfio.bytes -> Pdftext.encoding -> t list