package cpdf

  1. Overview
  2. Docs

Parse and subset TrueType fonts

type t = {
  1. flags : int;
  2. minx : int;
  3. miny : int;
  4. maxx : int;
  5. maxy : int;
  6. italicangle : int;
  7. ascent : int;
  8. descent : int;
  9. capheight : int;
  10. stemv : int;
  11. xheight : int;
  12. avgwidth : int;
  13. maxwidth : int;
  14. firstchar : int;
  15. lastchar : int;
  16. widths : int array;
  17. subset_fontfile : Pdfio.bytes;
  18. subset : int list;
  19. tounicode : (int, string) Hashtbl.t option;
}

The type of a single parsed font, including everything needed to build a PDF font.

val parse : subset:int list -> Pdfio.bytes -> Pdftext.encoding -> t list

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 additional characters in the font. You should supply a subset (a list of unicode codepoints whose corresponding glyphs are required).

OCaml

Innovation. Community. Security.