mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
add error when using loadFont() with a non-vlw file
This commit is contained in:
@@ -5442,6 +5442,9 @@ public class PApplet implements PConstants {
|
||||
* @see PApplet#createFont(String, float, boolean, char[])
|
||||
*/
|
||||
public PFont loadFont(String filename) {
|
||||
if (!filename.toLowerCase().endsWith(".vlw")) {
|
||||
throw new IllegalArgumentException("loadFont() only works with .vlw font files");
|
||||
}
|
||||
try {
|
||||
InputStream input = createInput(filename);
|
||||
return new PFont(input);
|
||||
|
||||
Reference in New Issue
Block a user