<< Click to Display Table of Contents >> VpeSetFontControl |
[VPE Professional Edition and above]
Allows to set several parameters for an individual font. This function overrides the settings of VpeSetEmbedAllFonts() and VpeSetSubsetAllFonts().
void VpeSetFontControl(
VpeHandle hDoc,
LPCSTR font_name,
LPCSTR subst_font_name,
int do_embed,
int do_subset
)
VpeHandle hDoc
Document Handle
LPCSTR font_name
the font you want to set the parameters for
LPCSTR subst_font_name
the font with which you want to substitute the original font with
int do_embed
Value |
Description |
True |
if the font is a True-Type font, it will be embedded into the document |
False |
the font will not be embedded into the document |
int do_subset
Value |
Description |
True |
if the font is a True-Type font, and it is embedded, it will be subsetted |
False |
the font will not be subsetted |
Remarks:
You can call this method repeatedly for each font you want to set individual parameters for. The settings can be deleted by calling the method VpeResetFontControl().
Embedding for specific fonts can only be turned off, if global embedding is turned on (see VpeSetEmbedAllFonts()).
Subsetting for specific fonts can only be turned off, if global subsetting is turned on (see VpeSetSubsetAllFonts()).
Whilst the settings for font substitution of this method are only active during the export to PDF documents, there is a second method to substitute fonts VpeSetFontSubstitution(), which is always active.
For important details about fonts and font handling, please see the Programmer's Manual, chapter "Programming Techniques", subchapter "Fonts and Font Handling".
Example:
VpeSetFontControl(hDoc, "Arial", "Helvetica", FALSE, FALSE);
VpeSetFontControl(hDoc, "Times New Roman", "Times", FALSE, FALSE);
Instructs VPE to substitute "Arial" with "Helvetica" and "Times New Roman" with "Times".
Since Helvetica as well as Times are PostScript fonts, VPE can neither embed nor subset them. But because both fonts are standard Base 14 PostScript fonts, they are supported by PDF Readers on any platform, so embedding (and therefore subsetting) is not required.
Example 2:
VpeSetEmbedAllFonts(hDoc, TRUE);
VpeSetSubsetAllFonts(hDoc, TRUE);
VpeSetFontControl(hDoc, "Arial", "Arial", TRUE, FALSE);
VpeSetFontControl(hDoc, "Times New Roman", "Times New Roman", TRUE, TRUE);
VpeSetFontControl(hDoc, "Verdana", "Verdana", FALSE, FALSE);
In the code above, no font substitution is used.
For Arial embedding is enabled and subsetting is disabled.
For Times New Roman embedding and subsetting is enabled.
For Verdana embedding and subsetting is disabled.
Note that the calls to VpeEmbedAllFonts(hDoc, TRUE) and VpeSetSubsetAllFonts(hDoc, TRUE) are required to be able to specify embedding and subsetting for specific fonts.