<< Click to Display Table of Contents >> Navigation: GDI Print Directives > Fonts |
Font embedding is a fairly complicated topic that has a major impact on the size of a PDF file. By electing to embed fonts, you guarantee that the document will be reproduced exactly on other computers as it appears on this computer—but the price you pay for that precision is a larger file, sometimes very much larger. Where absolute font fidelity is not required, NOT embedding fonts is recommended; in this case, the computer on which the document is displayed does a "best guess" substitution of available fonts for the one(s) you specified.
This section contains properties which define embedding and other options for fonts to be used in the PDF document.
Name |
Values |
Description |
PDFXv3 |
---|---|---|---|
EmbedAll or |
Boolean |
Embed all fonts in the PDF file. Default = False. |
Embedd.All |
EmbedProtected or |
Boolean |
Embed protected fonts in the PDF file. Default = False. |
Embedd.Protected |
WriteToUnicode |
Boolean |
Store characters as Unicode in PDF file. Default = False. |
ExtraInfo |
Subset |
Boolean |
If this option is enabled and if the percentage of characters used from the font specified is less than that specified in the SubsetLevel property, only the actually used characters from the font will be embedded within the PDF document. Otherwise the complete font file will be embedded within the PDF—resulting in a larger PDF file—but this will ensure consistent formatting/viewing is always possible. Default = True |
(new) |
SubsetLevel |
1-100 |
Default = 100 |
(new) |
Additionally there are two identical subsections AlwaysEmbed and NeverEmbed, which define lists of fonts which should always be embedded or which never should be embedded.
AlwaysEmbed
Name |
Values |
Description |
PDFXv3 |
---|---|---|---|
Enable |
Boolean |
Enable using the list defined by the Fonts property. Default = False |
(new) |
Fonts |
String |
Quoted comma separated list of fonts. Default = empty list. |
Embedd.Always |
PDFX5 will automatically convert the PDFX3-style command
//PDFX,Fonts.Embedd.Always,<font list>
to
//PDFX,Fonts.AlwaysEmbed.Enabled,True
//PDFX,Fonts.AlwaysEmbed.Fonts,<font list>
NeverEmbed
Name |
Values |
Description |
PDFXv3 |
---|---|---|---|
Enable |
Boolean |
Enable using the list defined by the Fonts property. Default = False |
(new) |
Fonts |
String |
Quoted comma separated list of fonts. Default = empty list. |
Embedd.Never |
PDFX5 will automatically convert the PDFX3-style command:
//PDFX,Fonts.Embedd.Never,<font list>
to
//PDFX,Fonts.NeverEmbed.Enabled,True
//PDFX,Fonts.NeverEmbed.Fonts,<font list>
Compatibility
Although there was limited support for font embedding options in PDFXv3, the options and syntax have been greatly expanded in PDFXv5+. The old PDFXv3 syntax, while deprecated, is still supported.
Note that in the case of PDFXv3, the driver consumes all of the //PDFX commands, whether it understands them or not. Conversely, in PDFXv5+, the //PDFX commands are converted by A-Shell into API calls to the driver, with the result that any unrecognized commands will appear as plain text in the document.
Examples
The following example sets some general Fonts embedding options, and then specifically forces the Calibri font to always be embedded, and the Garamond font to never be embedded. The Helvetica font may or may not be embedded, depending on the general options and environment.
//;PDFX5 Fonts property testing
//PDFX,Fonts.EmbedAll,False
//PDFX,Fonts.EmbedProtected,False
//PDFX,Fonts.WriteToUnicode,True
//PDFX,Fonts.Subset,True
//PDFX,Fonts.SubsetLevel,50
//PDFX,Fonts.AlwaysEmbed.Enable,true
//PDFX,Fonts.AlwaysEmbed.Fonts,"Calibri"
//PDFX,Fonts.NeverEmbed.Enable,true
//PDFX,Fonts.NeverEmbed.Fonts,"Garamond,Helvetica"
//SETFONT,120,Calibri
This is Calibri
//SETFONT,120,Garamond
This is Garamond
//SETFONT,120,Helvetica
This is Helvetica
The following examples show two variations: the first uses the PDFX5 syntax, while the second, although somewhat more limited, is compatible with both PDFX3 and PDFX5.
//;Embedd.All and Embedd.Always work in both PDFX3 and PDFX5
//PDFX,Fonts.Embedd.All,0
//PDFX,Fonts.Embedd.Always,Free 3 of 9 Regular
//; Version of above that is both PDFX3 and PDFX5 compatible
//PDFX,Fonts.Embedd.All,False
//PDFX,Fonts.Embedd.Protected,False
//; WriteToUnicode not supported by PDFX3 and ExtraInfo not by PDFX5 (just omit)
//; PDFX,Fonts.WriteToUnicode,1
//; Subset not supported by PDFX3
//; PDFX,Fonts.Subset,True
//; PDFX,Fonts.SubsetLevel,50
//PDFX,Fonts.Embedd.Always,"Calibri"
//PDFX,Fonts.Embedd.Never,"Garamond,Helvetica"
//SETFONT,120,Calibri
This is Calibri
//SETFONT,120,Garamond
This is Garamond
//SETFONT,120,Helvetica
This is Helvetica