loadFont()
Typography / Loading & DisplayingDescription
Loads a font from the sketch's data folder. Supports .ttf and .otf files.
Syntax
PFont loadFont(std::string filename)
Parameters
| Name | Type | Description |
|---|---|---|
| filename | std::string | name of the font file |
Returns
PFontRelated
Under the Hood
From Processing.h:
PFont loadFont(const std::string& filename);
Under the Hood
From Processing.cpp:
PFont PApplet::loadFont(const std::string& filename) {
PFont f(filename, g_textSize);
tryLoadTTF(filename, g_textSize);
return f;
}