error message fixes for two internal errors

This commit is contained in:
benfry
2006-12-05 13:05:29 +00:00
parent 76ddb8926e
commit 679adc509e
2 changed files with 11 additions and 2 deletions

View File

@@ -3693,6 +3693,15 @@ public class PApplet extends Applet
Float floatSize = new Float(size);
if (lowerName.endsWith(".otf") || lowerName.endsWith(".ttf")) {
InputStream stream = openStream(name);
if (stream == null) {
System.err.println("The font \"" + name + "\" " +
"is missing or inaccessible, make sure " +
"the URL is valid or that the file has been " +
"added to your sketch and is readable.");
return null;
}
//font = Font.createFont(Font.TRUETYPE_FONT, openStream(name));
Method createFontMethod =
Font.class.getMethod("createFont",

View File

@@ -507,11 +507,11 @@ public class Capture extends PImage implements Runnable {
int errorCode = qte.errorCode();
if (errorCode == Errors.couldntGetRequiredComponent) {
throw new RuntimeException("Couldn't find any capture devices, " +
"check the FAQ for more info.");
"read the video reference for more info.");
} else {
qte.printStackTrace();
throw new RuntimeException("Problem listing capture devices, " +
"check the FAQ for more info.");
"read the video reference for more info.");
}
}
//return null;