[libbluray-devel] org.dvb.ui.FontFactory: log errors
hpi1
git at videolan.org
Wed Apr 13 11:34:38 CEST 2016
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Wed Apr 13 12:25:12 2016 +0300| [876b2c489a11c384a3573083a08f190e6960a3f7] | committer: hpi1
org.dvb.ui.FontFactory: log errors
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=876b2c489a11c384a3573083a08f190e6960a3f7
---
src/libbluray/bdj/java/org/dvb/ui/FontFactory.java | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/libbluray/bdj/java/org/dvb/ui/FontFactory.java b/src/libbluray/bdj/java/org/dvb/ui/FontFactory.java
index ef9c682..355e954 100644
--- a/src/libbluray/bdj/java/org/dvb/ui/FontFactory.java
+++ b/src/libbluray/bdj/java/org/dvb/ui/FontFactory.java
@@ -63,6 +63,7 @@ public class FontFactory {
try {
File fontFile = org.videolan.BDJLoader.addFont(data.getFileName());
if (fontFile == null) {
+ logger.error("error caching font");
throw new IOException("error caching font");
}
@@ -105,6 +106,7 @@ public class FontFactory {
File fontFile = org.videolan.BDJLoader.addFont(inStream);
if (fontFile == null) {
+ logger.error("error caching font");
throw new IOException("error caching font");
}
@@ -124,10 +126,15 @@ public class FontFactory {
}
}
+ // used by root window / .bdjo default font
public Font createFont(String fontId) {
Font font = null;
synchronized (fontsLock) {
- font = (Font)fontIds.get(fontId);
+ if (fontIds == null) {
+ logger.error("no disc fonts loaded");
+ } else {
+ font = (Font)fontIds.get(fontId);
+ }
}
if (font != null) {
return font.deriveFont(0, 12);
@@ -140,6 +147,7 @@ public class FontFactory {
logger.info("Creating font: " + name + " " + style + " " + size);
if (style < 0 || size <= 0 || (style & ~3) != 0) {
+ logger.error("invalid font size / style");
throw new IllegalArgumentException();
}
More information about the libbluray-devel
mailing list