DynaPDF Manual - Page 676

Previous Page 675   Index   Next Page 677

Function Reference
Page 676 of 839
SetAltFonts
Syntax:
LBOOL pdfSetAltFonts(
const PPDF* IPDF,
// Instance pointer
UI32 ListHandle,
// Handle returned by CreateAltFontList().
struct char** List, // Array of font names
UI32 Count)
// Number of values in the array
The function fills an alternate font list created by CreateAltFontList() with data. Alternate font list
are tested if one more glyphs were not found in the current font. Since the fonts in the list are used
as fallback they should be compatible to the active font in regard to properties like serif, sans serif,
proportional or fixed pitch, and so on.
The names in a font list must be Family Names since DynaPDF must be able to load different styles
of a font.
A list should be sorted by priority and not by name. That means index 0 should contain a font name
that is most probably the best match. If this one was not available or incompatible then the next font
in the list will be tested until the end of the list was reached. If no suitable font was found then
system fonts are tested.
The fonts in the list should support the language that must be output. Otherwise, the fonts can
never be selected. An alternate font list can be arbitrary large but it is usually best to restrict the
number fonts in a list to speed up processing.
A list can contain font names which are not available on the system. This causes no error. Non
existing fonts are simply ignored. This makes it possible to define suitable alternate font lists
statically. Such lists can then be loaded on demand.
After a list was filled with data it can be activated with ActivateAltFontList(). If a list is no longer
needed delete it with DeleteAltFontList().
Remarks:
This function is implemented in an Ansi and Unicode compatible variant. Since font names are
Unicode strings, the Unicode variant is preferred.
Please note that alternate font lists are used only, if complex text layout was enabled. This can be
done by setting the flag gfComplexText with SetGStateFlags().
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
 

Previous topic: Set3DAnnotScript, SetAllocBy

Next topic: SetAnnotBorderEffect, SetAnnotBorderStyle