Skip to content

Commit 08a589d

Browse files
committed
add error when using loadFont() with a non-vlw file
1 parent dfc6f2b commit 08a589d

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

core/src/processing/core/PApplet.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5442,6 +5442,9 @@ public boolean saveTable(Table table, String filename, String options) {
54425442
* @see PApplet#createFont(String, float, boolean, char[])
54435443
*/
54445444
public PFont loadFont(String filename) {
5445+
if (!filename.toLowerCase().endsWith(".vlw")) {
5446+
throw new IllegalArgumentException("loadFont() only works with .vlw font files");
5447+
}
54455448
try {
54465449
InputStream input = createInput(filename);
54475450
return new PFont(input);

0 commit comments

Comments
 (0)