FPDFText_LoadFont function

  1. @Native<FPDF_FONT Function(FPDF_DOCUMENT, Pointer<Uint8>, Uint32, Int, FPDF_BOOL)>(FPDF_DOCUMENT, ffi.Pointer<ffi.Uint8>, ffi.Uint32, ffi.Int, FPDF_BOOL)>()
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

@ffi.Native<
  FPDF_FONT Function(
    FPDF_DOCUMENT,
    ffi.Pointer<ffi.Uint8>,
    ffi.Uint32,
    ffi.Int,
    FPDF_BOOL,
  )
>()
external FPDF_FONT FPDFText_LoadFont(
  FPDF_DOCUMENT document,
  ffi.Pointer<ffi.Uint8> data,
  int size,
  int font_type,
  int cid,
);