60000069 Texts, fonts and SHX fonts

Article 60000069
Type HowTo
Product Engine
Version 6
Date Added 3/8/2007
Fixed (3/8/2007)
Submitted by Matt Cotzias


Texts, fonts and SHX fonts


The general idea of fonts and SHX fonts :
VectorDraw libraries use two type of fonts to display texts; TTF and SHX fonts. Some drawings have been created that way that some text objects (vdText Object) are using some Textstyles (vdTextStyle Object) which use SHX fonts to display the text caharacters. These SHX fonts are not like the TTF fonts (system fonts) which every system have it (like the Arial TTF font). So SHX fonts must be distributed along with the drawing.
So in my machine I can create a drawing that have some texts that use the MySHXfont.SHX fontfile. If I distribute this drawing I should also distribute the  MySHXfont.SHX fontfile in order the drawing to be displayed "correct" (as I designed it).
Where does VDF finds the SHX fontfiles: 
Another thing that you should have in mind is that the SHX fonts are "path" relative. SHX fonts are not "system" fonts as the TTF so in order to load it (VectorDraw or other program) the path that the SHX font is must be specified. In VectorDraw this is done with SupportPath property (see our help for more information).

SupportPath property specifies the directories (paths) in which VectorDraw searches for files when using methods for drawings like insert, file open, images attach, xref, font files (SHX) and FindFile method of vdUtility. SupportPath can have may paths separated by semicolon < ; >  like example:
    c:/;c:/temp;c:/Program Files/VectorDraw;

The order when VectorDraw searches for SHX fonts is : 
  •    The folder that VectorDraw library is placed/registered.
  •    The folder where the drawing is placed.
  •    The paths that are inside the SupportPath property.
Conclusion :
It is recomended to create a path during your applications installation like %Program Files%\MyApplicationFolder\SHXFonts and place there (distribute) the SHX fonts that your application/drawings use. Also state in your application's help that the user should copy the SHX fontfiles that he uses in this path and your application should have the above path in the SupportPath property.

Send comments on this topic.