textFont()

Typography / Loading & Displaying

Description

Sets the current font for text rendering.

Syntax

void textFont(const PFont& font) void textFont(const PFont& font, float size)

Parameters

NameTypeDescription
fontPFonta PFont object
sizefloatfont size (optional)

Returns

void

Related

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