font selection/searching
Vernon Mauery <[email protected]> Thu, 09 Oct 2003 14:49:47 -0600
| Newsgroups | gmane.comp.embedded.stk.gui.devel |
|---|---|
| Message-ID | <[email protected]> |
dvhart and I talked about some about the fonts after leaving linux-coding and this is what I have decided to implement: font::font(const font_properties& prop) the constructor looks for the fontname*.ttf listed in the font_properties object in the fontpath that configure supplies. Then, it goes through each file looking for a face that matches the the bold/italic style settings and returns the first font that it finds. If that font is not existant, what should we do? Default to vera? Default to vera with the specified style? Throw an exception? My personal opinion is that we should default to vera with the style that they wanted and only throw an exception if vera is not found. We decided that Monospace/Serif/Sans Serif should not be flags, but the user should specify a filename that gives them the family name they want. For example, if you want a monospace font, choose Courier, not Arial. Or if you want Sans Serif, choose Vera, not Times. Since most fonts we have found and use keep the filename similar for a group of fonts (Arial, Arial Bold, Arial Italic, etc.) we can simply do a non case compare for arial to get the right family. Is this good for everyone else? Reply soon because I am currently implementing it. :)