Represents a font loaded off the operating system or the X server.
Constructs the class and immediately calls load.
A destructor is present on this object, but not explicitly documented in the source.
Max ascent above the baseline.
Returns the average width of the font, conventionally defined as the width of the lowercase 'x' character.
Max descent below the baseline.
Returns the height of the font.
name is a font name, but it can also be a more complicated string parsed in an OS-specific way.
Loads specifically a Core X font - rendered on the X server without antialiasing. Best performance.
Loads the default font used by ScreenPainter if none others are loaded.
Loads a Windows font. You probably want to use load instead to be more generic.
Loads specifically with the Xft library - a freetype font from a fontconfig string.
stringWidth can be slow. This helps speed it up if you are doing a lot of calculations. Just prepareContext when you start this work and releaseContext when you are done. Important to release before too long though as it can be a scarce system resource.
Returns the width of the string as drawn on the specified window, or the default screen if the window is null.
Lists available fonts from the system that match the given pattern, finding names that are suitable for passing to OperatingSystemFont's constructor.
While the api here is unified cross platform, the fonts are not necessarily available, even across machines of the same platform, so be sure to always check for null (using isNull) and have a fallback plan.
When you have a font you like, use ScreenPainter.setFont to load it for drawing.
Worst case, a null font will automatically fall back to the default font loaded for your system.