Public Member Functions | |
const char * | name () const |
const char * | name (int *p) |
Font * | plus (int attributes) |
Font * | bold () |
Font * | italic () |
int | sizes (int *&) |
int | encodings (const char **&) |
const char * | system_name () |
Static Public Member Functions | |
const char * | current_name () |
Public Attributes | |
const char * | name_ |
int | attributes_ |
Related Functions | |
(Note that these are not member functions.) | |
int | list_fonts (Font **&arrayp) |
Font * | font (const char *name, int attributes) |
Font * | font (int i) |
This is a struct so that fltk can initialize a table internally with constants. Don't use the undocumented fields.
|
Same as plus(BOLD), returns a bold version of this font. |
|
Return the full X11 name for the currently selected font+size+encoding. This is mostly useful for debugging, though maybe you need to copy it to another program. On non-X systems, and on modern X systems with Xft (antialiased fonts) this returns current_font()->system_name(). |
|
Return all the encodings for this font. These strings may be sent to set_encoding() before using the font. The return value is the length of the list. The argument arrayp is set to point at the array, which is in static memory reused each time this call is done. |
|
Same as plus(ITALIC), returns an italic version of this font. |
|
Return a string name for this font, and put any attributes (BOLD, ITALIC) into the location pointed to by attributes. Using the returned string and attributes as arguments to find() will return the same font. |
|
Return a single string that names this font. Passing this string and zero for the attributes to find() will return the same font. If the font's attributes are non-zero, this is done by appending a space and "Bold" and/or "Italic" to the name. This allows a single string rather than a string+attribute pair to identify a font, which is really useful for saving them in a file. The return value is in a temporary buffer that will be overwritten on the next call in this case. |
|
Return a font from the same family with the extra attributes turned on. This may return the same font if the attributes are already on or there is no font with those attributes. |
|
Sets array to point at a list of sizes. The return value is the length of this array. The sizes are sorted from smallest to largest and indicate what sizes can be given to setfont() that will be matched exactly (setfont() will pick the closest size for other sizes). A zero in the first location of the array indicates a scalable font, where any size works, although the array may still list sizes that work "better" than others. The returned array points at a static buffer that is overwritten each call, so you want to copy it if you plan to keep it. The return value is the length of the list. The argument arrayp is set to point at the array, which is in static memory reused each time this call is done. |
|
Returns the string actually passed to the operating system, which may be different than name(). For Xlib this is a pattern sent to XListFonts to find all the sizes. For most other systems this is the same as name() without any attributes. |
|
Turn an fltk1 integer font id into a font. |
|
Find a font with the given "nice" name. You can get bold and italic by adding a space and "bold" or "italic" (or both) to the name, or by passing them as the attributes. Case is ignored and fltk will accept some variations in the font name. The current implementation calls list_fonts() and then does a binary search of the returned list. This can make the first call pretty slow, especially on X. Directly calling the system has a problem in that we want the same structure returned for any call that names the same font. This is sufficiently painful that I have not done this yet. |
|
Generate an array containing every font on the server. arrayp is set to a pointer to this array, and the length of the array is the return value. Each entry is a "base" font, there may be bold, italic, and bold+italic version of each font pointed to by bold() or italic(). Subsequent calls will usually return the same array quickly, but if a signal comes in indicating a change it will probably delete the old array and return a new one. |