This reference is for Processing 3.0+. If you have a previous version, use the reference included with your software in the Help menu. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Core Javadoc and Libraries Javadoc.
Name | textFont() |
||||
---|---|---|---|---|---|
Examples | PFont mono; // The font "andalemo.ttf" must be located in the // current sketch's "data" directory to load successfully mono = createFont("andalemo.ttf", 32); background(0); textFont(mono); text("word", 12, 60); | ||||
Description |
Sets the current font that will be drawn with the text() function. Fonts must be created for Processing with createFont() or loaded with loadFont() before they can be used. The font set through textFont() will be used in all subsequent calls to the text() function. If no size parameter is specified, the font size defaults to the original size (the size in which it was created with the "Create Font..." tool) overriding any previous calls to textFont() or textSize(). When fonts are rendered as an image texture (as is the case with the P2D and P3D renderers as well as with loadFont() and vlw files), you should create fonts at the sizes that will be used most commonly. Using textFont() without the size parameter will result in the cleanest type. |
||||
Syntax | textFont(which) textFont(which, size) | ||||
Parameters |
| ||||
Returns | void | ||||
Related | createFont() loadFont() PFont text() textSize() |
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.