|
Embeds a font into the document.
The font name, a description of the font style and the the font
glyph descriptions themselves are placed into the document. This
ensures that the document will always display perfectly on every
system and that font substitutions will never need to be made.
There are a number of reasons you may not wish to embed fonts
and, instead, use the AddFont method.
Embedding fonts can increase the size of your PDF considerably.
Additionally, by distributing a PDF with an embedded font, you are
actually redistributing the font itself. You should check with your
font supplier or legal department that you have permission to do
this.
For information on how to specify font names, see the AddFont method.
The EmbedFont method returns the Object ID of the newly added
Font object. Typically, you will want to assign this return value
to the document Font property using code of the form.
theDoc.Font = theDoc.AddFont("Courier")
If the specified font could not be found, then you will get an
Object ID of zero returned. You may wish to check for this
possibility. Otherwise, a default font will be used.
Fonts are cached so newly added fonts will not be available to
ABCpdf until the application is restarted. If you need to
dynamically load a font, you can pass this method a path to your
font file. This will add the font to the cache and make it
available for use. You should not move, rename or delete a font
file which has been dynamically loaded using this technique.
|