Search processing.org:

Reference for Processing (BETA) version 0135+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.

Name | ### loadFont()
Examples |
    PFont font;
    // The font must be located in the sketch's
    // "data" directory to load successfully
    font = loadFont("FFScala-32.vlw");
    textFont(font, 32);
    text("word", 15, 50);
Description | Loads a font into a variable of type PFont. To load correctly, fonts must be located in the data directory of the current sketch. To create a font to use with Processing, select "Create Font..." from the Tools menu. This will create a font in the format Processing requires and also adds it to the current sketch's data directory. For most renderers, Processing displays fonts using the .vlw font format, which uses images for each letter, rather than defining them through vector data. When hint(ENABLE_NATIVE_FONTS) is used with the JAVA2D renderer, the native version of a font will be used if it is installed on the user's machine. Using createFont() (instead of loadFont) enables vector data to be used with the JAVA2D (default) renderer setting. This can be helpful when many font sizes are needed, or when using any renderer based on JAVA2D, such as the PDF library.
Syntax |
    loadFont(fontname)
Parameters |
fontname | string: name of the font to load
Usage | Web & Application
Related | PFont textFont() text() createFont()

Updated on October 22, 2007 10:10:06am PDT