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)
| 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) { |
nothing calls this directly
no test coverage detected