( 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)
| 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) { |
no test coverage detected