<Pclass="Body"style="margin: 0px">The FontServer provides the base functionality for providing font support for the rest of the system and insulates the rest of the server from having to deal too much with FreeType.</P>
Saves the list of all scanned and valid font families and styles to disk</P>
<Pclass="Body"style="margin: 0px"><BR>
1) create a BMessage for storing font family data (hereafter, the font message)</P>
<Pclass="Body"style="margin: 0px">2) create a BMessage for storing a list of font family messages (hereafter, the list message)</P>
<Pclass="Body"style="margin: 0px">3) create a boolean tuned flag and a boolean fixed flag</P>
<Pclass="Body"style="margin: 0px">4) Iterate through all families</P>
<Pclass="Body"style="margin: 0px"> A) for each family, get its name and add its name to the font message as "name"</P>
<Pclass="Body"style="margin: 0px"> B) iterate through the families styles</P>
<Pclass="Body"style="margin: 0px"> a) get the style's name, and if valid, add it to the font message as "styles"</P>
<Pclass="Body"style="margin: 0px"> b) if IsTuned and IsScalable, set the tuned flag to true</P>
<Pclass="Body"style="margin: 0px"> c) if IsFixedWidth, set the fixed flag to true</P>
<Pclass="Body"style="margin: 0px"> C) if the tuned flag is set, add a boolean true to the font message as "tuned"</P>
<Pclass="Body"style="margin: 0px"> D) if the fixed flag is set, add a boolean true to the font message as "fixed"</P>
<Pclass="Body"style="margin: 0px"> E) add the font message to the list message as "family"</P>
<Pclass="Body"style="margin: 0px"> F) empty the font message</P>
<Pclass="Body"style="margin: 0px">5) Create a BFile from the path definition SERVER_FONT_LIST for Read/Write, creating the file if nonexistent and erasing any existing one</P>
<Pclass="Body"style="margin: 0px">6) Flatten the list message to the created BFile object</P>
<Pclass="Body"style="margin: 0px">7) Set the needs_update flag to false</P>
<Pclass="Body"style="margin: 0px">2) Enter a while() loop, iterating through each entry in the given directory, executing as follows:</P>
<Pclass="Body"style="margin: 0px"> a) Ensure that the entry is not '.' or '..'</P>
<Pclass="Body"style="margin: 0px"> b) Call FT_New_Face on the entry's full path</P>
<Pclass="Body"style="margin: 0px"> c) If a valid FT_Face is returned, iterate through to see if there are any supported character mappings in the current entry.</P>
<Pclass="Body"style="margin: 0px"> d) If there are no supported character mappings, dump the supported mappings to debug output, call FT_Done_Face(), and continue to the next entry</P>
<Pclass="Body"style="margin: 0px"> e) See if the entry's family has been added to the family list. If it hasn't, create one and add it.</P>
<Pclass="Body"style="margin: 0px"> f) Check to see if the font's style has been added to its family. If so, call FT_Done_Face, and continue to the next entry</P>
<Pclass="Body"style="margin: 0px"> g) If the style has not been added, create a new SFont for that family and face, increment the font count, and continue to the next entry.</P>
Supported character mappings are Windows and Apple Unicode, Windows symbol, and Apple Roman character mappings, in order of preference from first to last.</P>
These return a copy of a pointer to the system-wide ServerFont objects which represent the appropriate system font settings. It is the responsibility of the caller to delete the object returned. NULL is returned if no setting has been set for a particular system font.</P>
The system fonts settings may be set via these calls by specifying the family, style, and size. They return true if everything worked out ok and false if not. Settings are not changed if false is returned.</P>
<Pclass="Body"style="margin: 0px"><BR>
1) Call _FindFamily on the family parameter. if NULL, return false</P>
<Pclass="Body"style="margin: 0px">2) Call the family's GetStyle member. if NULL, return false</P>
<Pclass="Body"style="margin: 0px">3) if the appropriate system font pointer is non-NULL, delete it</P>
<Pclass="Body"style="margin: 0px">4) call the style's Instantiate member with the size parameter</P>