Article # 310, added by Geoworks, historical record
| first |
previous |
index |
next |
last |
Displaying text in a table.
Q. I need to use a fixed size font to display a table. How should I specify that I need a non-proportional font? A. If you're working with a GState and view, GrSetFont() will do the job. If you're working with a text object, then MSG_VIS_TEXT_SET_FONT_ID is in order (or MSG_VIS_TEXT_SET_CHAR_ATTR if you're setting multiple attributes). If trying to find a fixed width font to use, then it depends on whether you need to print or not. No printing: Bison or URW Mono. Printing: URW Mono. If it's on Zoomer, then URW Mono doesn't have hand-tuned bitmaps and might not be desirable for screen display, depending on the pointsize being used. If you wish to find a font dynamically, then GrEnumFonts() can be used to find a list of matching fonts. Finally, depending on the table, you don't necessarily need to restrict yourself to fixed width fonts. You can set tabs (including decimal tabs) in a text object to force things to line up. Or if in a GState/view setup, you can use font metrics information to calculate text sizes and right-justify the entries without too much trouble. Note that the numbers in many (not all) fonts are fixed width.