SetFontSubstitution

<< Click to Display Table of Contents >>

Navigation:  Text Functions >

SetFontSubstitution

Previous pageReturn to chapter overviewNext page

Substitutes a given font with another font. By using this method, VPE will substitute fonts immediately when creating a document. This is especially useful on Non-Windows platforms when importing RTF (Rich Text) documents. Often RTF documents are created on Windows platforms and use Windows specific True-Type fonts. With this method you can instruct VPE to substitute for example the True-Type font "Arial" with the Base 14 font "Helvetica", so Helvetica is used in place of Arial.

method void VPE.SetFontSubstitution(

string OriginalFont,

string SubstFont

)

string OriginalFont

the font which shall be subtituted by the SubstFont

string SubstFont

the font which shall be used in place of the OriginalFont

Remarks:

In contrast to nearly all other methods, the font substitution is not related to the current document! It is active during the lifetime of your application for ALL documents which are currently open, as well as for ALL documents you are going to create after calling this method! Use this method with care.

 

You can reset all font substitution settings at once by calling the method PurgeFontSubstitution().

 

On Windows, this method also affects the preview and printing. This method does not affect the document export to other formats than PDF. There is a second method SetFontControl() to substitute fonts, which is only active during the export to PDF documents.

 

For important details about fonts and font handling, please see the Programmer's Manual, chapter "Programming Techniques", subchapter "Fonts and Font Handling".

Example:

Doc.SetFontSubstitution("Arial", "Helvetica")

Substitutes the True-Type font "Arial" with the Base 14 font "Helvetica", so Helvetica is used in place of Arial.