phoenix::Font
Used to measure pixel sizes required to display text strings.
struct Font {
string description;
Geometry geometry(const string &text);
Font(const string &description);
};
Geometry Font::geometry(const string &text);
Returns the minimum width and height required to display "text". This function will recognize line feeds within the text. x and y are always zero.
This function is mainly used internally for automatically sizing widgets for some of the layout types, however it can be useful to library users as well. Say you have a hex editor and you want to have exactly sixteen columns: use this function with an example string, add a small value for the client geometry and scrollbar, and set the widget size to the result.
Font::Font(const string &description);
Provide a font description to be used for geometry() calculations.
The format is "Family Name, Point Size, Style(s)". Each field is optional, but must appear in the specified order. Defaults are "Sans" (on Linux) or "Tahoma" (on Windows), 8-point, and "Normal".
Valid styles at this time are "Bold", "Italic", and "Bold Italic".
Examples:
Font("Sans Serif");
Font("Arial, 12");
Font("Tahoma, 12, Bold");
Font("Tahoma, 16, Bold Italic");