FPDFText_LoadFont method

FPDF_FONT FPDFText_LoadFont(
  1. FPDF_DOCUMENT document,
  2. Pointer<Uint8> data,
  3. int size,
  4. int font_type,
  5. int cid,
)

Returns a font object loaded from a stream of data. The font is loaded into the document. Various font data structures, such as the ToUnicode data, are auto-generated based on the inputs.

document - handle to the document. data - the stream of font data, which will be copied by the font object. size - the size of the font data, in bytes. font_type - FPDF_FONT_TYPE1 or FPDF_FONT_TRUETYPE depending on the font type. cid - a boolean specifying if the font is a CID font or not.

The loaded font can be closed using FPDFFont_Close().

Returns NULL on failure

Implementation

FPDF_FONT FPDFText_LoadFont(
  FPDF_DOCUMENT document,
  ffi.Pointer<ffi.Uint8> data,
  int size,
  int font_type,
  int cid,
) {
  return _FPDFText_LoadFont(document, data, size, font_type, cid);
}