loadFont()

Typography / Loading & Displaying

Description

Loads a font from the sketch's data folder. Supports .ttf and .otf files.

Syntax

PFont loadFont(std::string filename)

Parameters

NameTypeDescription
filenamestd::stringname of the font file

Returns

PFont

Related

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; }