FSCRT_FONTMAPPERHANDLER Struct Reference

Structure for font mapping. More...

#include <fs_base_r.h>

Public Attributes

FS_LPVOID clientData
 User-defined data. More...
 
FS_RESULT(* MapFont )(FS_LPVOID clientData, FS_LPCSTR fontName, FS_DWORD fontStyles, FS_INT32 weight, FS_INT32 charset, FSCRT_FILE *fontFile, FS_INT32 *faceIndex)
 Find a font for a particular PDF font. More...
 

Detailed Description

Structure for font mapping.

Note
This is a handler and it is implemented by applications. It is used to find a mapping font object for the given conditions.

Member Data Documentation

FS_LPVOID FSCRT_FONTMAPPERHANDLER::clientData

User-defined data.

Note
Applications can use this field to track controls.
FS_RESULT(* FSCRT_FONTMAPPERHANDLER::MapFont) (FS_LPVOID clientData, FS_LPCSTR fontName, FS_DWORD fontStyles, FS_INT32 weight, FS_INT32 charset, FSCRT_FILE *fontFile, FS_INT32 *faceIndex)

Find a font for a particular PDF font.

Parameters
[in]clientDataPointer to user-supplied data.
[in]fontNamePointer to a zero-terminated string for the given font name.
[in]fontStylesFont Flags. Please refer to macro definitions of FSCRT_FONTSTYLE_XXX and this can be one or a combination of these macros.
[in]weightWeight of a font. Range from 100 to 900. 400 is normal, 700 is bold.
[in]charsetCharset ID. Please refer to macro definitions of FSCRT_CHARSET_XXX and this should be one of these macros.
[out]fontFilePointer to a FSCRT_FILE handle that receives a file object.
[out]faceIndexPointer to a FS_INT32 object that receives a zero-based index value for a font face, if the mapped font file is a "collection" (meaning a number of faces are stored in the same file). If the font file is not a collection, the index value shall be zero.
Note
When implementing this callback function, user should pay attention to manage parameter fontFile:
  • User is strongly recommended to return the same FSCRT_FILE object if the same font is mapped in this callback fuction.
  • The FSCRT_FILE object should be kept valid in application level during the entire life cycle of Foxit PDF SDK, and should be released in application level before Foxit PDF SDK is destroyed.
Returns
FSCRT_ERRCODE_SUCCESS means a substitution font has been specified. Others means if a mapper cannot be mapped to a font, or something is wrong. For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.

The documentation for this struct was generated from the following file:

Foxit Corporation