MCPcopy Index your code
hub / github.com/benfry/processing4 / loadFont

Method loadFont

core/src/processing/core/PApplet.java:5727–5741  ·  view source on GitHub ↗

Loads a .vlw formatted font into a PFont object. Create a .vlw font by selecting "Create Font..." from the Tools menu. This tool creates a texture for each alphanumeric character and then adds them as a .vlw file to the current sketch's data folder. Because the letters are defined as textures

(String filename)

Source from the content-addressed store, hash-verified

5725 * @see PApplet#createFont(String, float, boolean, char[])
5726 */
5727 public PFont loadFont(String filename) {
5728 if (!filename.toLowerCase().endsWith(".vlw")) {
5729 throw new IllegalArgumentException("loadFont() is for .vlw files, try createFont()");
5730 }
5731 try {
5732 InputStream input = createInput(filename);
5733 return new PFont(input);
5734
5735 } catch (Exception e) {
5736 die("Could not load font " + filename + ". " +
5737 "Make sure that the font has been copied " +
5738 "to the data folder of your sketch.", e);
5739 }
5740 return null;
5741 }
5742
5743
5744 public PFont createFont(String name, float size) {

Callers

nothing calls this directly

Calls 2

createInputMethod · 0.95
dieMethod · 0.95

Tested by

no test coverage detected