MCPcopy Index your code
hub / github.com/processing/processing / loadFont

Method loadFont

core/src/processing/core/PApplet.java:6345–6359  ·  view source on GitHub ↗

( begin auto-generated from loadFont.xml ) Loads a font into a variable of type PFont . To load correctly, fonts must be located in the data directory of the current sketch. To create a font to use with Processing, select "Create Font..." from the Tools menu. This will create a font in the fo

(String filename)

Source from the content-addressed store, hash-verified

6343 * @see PApplet#createFont(String, float, boolean, char[])
6344 */
6345 public PFont loadFont(String filename) {
6346 if (!filename.toLowerCase().endsWith(".vlw")) {
6347 throw new IllegalArgumentException("loadFont() is for .vlw files, try createFont()");
6348 }
6349 try {
6350 InputStream input = createInput(filename);
6351 return new PFont(input);
6352
6353 } catch (Exception e) {
6354 die("Could not load font " + filename + ". " +
6355 "Make sure that the font has been copied " +
6356 "to the data folder of your sketch.", e);
6357 }
6358 return null;
6359 }
6360
6361
6362 public PFont createFont(String name, float size) {

Callers 1

handleTextFontMethod · 0.80

Calls 2

createInputMethod · 0.95
dieMethod · 0.95

Tested by

no test coverage detected