textFont()
Typography / Loading & DisplayingDescription
Sets the current font for text rendering.
Syntax
void textFont(const PFont& font)
void textFont(const PFont& font, float size)
Parameters
| Name | Type | Description |
|---|---|---|
| font | PFont | a PFont object |
| size | float | font size (optional) |
Returns
voidRelated
Under the Hood
From Processing.h:
void textFont(const PFont& font);
void textFont(const PFont& font, float size);
void textFont(const PFont* font) { if(font) textFont(*font); }
void textFont(const PFont* font) { if(font) textFont(*font);
void textFont(const PFont* font, float size) { if(font) textFont(*font,size); }
void textFont(const PFont* font, float size) { if(font) textFont(*font,size);
Under the Hood
From Processing.cpp:
void PApplet::textFont(const PFont& font) {
currentFont = font;
g_textSize = font.size;
tryLoadTTF(font.name, font.size);
}
void PApplet::textFont(const PFont& font, float size) {
currentFont = font;
currentFont.size = size;
g_textSize = size;
tryLoadTTF(font.name, size);
}