DynaPDF Manual - Page 63
Previous Page 62 Index Next Page 64
Content parsing & editing
Page 63 of 860
SetAltFont(). However, a font loaded by SetFont(), SetFontEx() or SetCIDFont() works too. In
order to activate a font loaded by a regular font loading function call ChangeAltFont().
It is possible to load more than one alternate font but only the active font will be used when
replacing text. If more than one font must be loaded, store the handle returned by SetAltFont()
and change the font with ChangeAltFont() whenever needed.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
SetAltFont
Syntax:
SI32 psrSetAltFont(
const PPDF* IPDF, // PDF instance pointer
const IPSR* Ctx,
// Parser instance pointer
const char* Name, // Font name
TFStyle Style,
// Font style
double Size,
// Font size (must be greater zero)
LBOOL Embed,
// If true, the font will be embedded
TCodepage CP)
// Code page to be used
The function sets the font as alternate font that is used by ReplaceText() if the original font is not
available.
Although the parameter Size must be greater zero, the value is in fact not used when replacing
text. The parameter is reserved for future use.
Please note that the replacement text must be defined in the code page with which the font was
loaded.
To effiently change the font whenever needed, call ChangeAltFont(). It is also possible to call
SetAltFont() but this would require more processing time.
Return values:
If the function succeeds the return value is the font handle, a value greater of equal zero. If the
function fails the return value is 0.
Previous topic: ReplaceSelText, Font substitution
Next topic: WriteToPage