[libbluray-devel] FontFactory: log exceptions
hpi1
git at videolan.org
Fri Oct 3 11:06:58 CEST 2014
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Fri Oct 3 11:43:13 2014 +0300| [8d24ef4c23f7a0dda5bfed4d0c994ec34b9a4772] | committer: hpi1
FontFactory: log exceptions
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=8d24ef4c23f7a0dda5bfed4d0c994ec34b9a4772
---
.../bdj/java-j2se/org/dvb/ui/FontFactory.java | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/libbluray/bdj/java-j2se/org/dvb/ui/FontFactory.java b/src/libbluray/bdj/java-j2se/org/dvb/ui/FontFactory.java
index 567e970..5d65ebb 100644
--- a/src/libbluray/bdj/java-j2se/org/dvb/ui/FontFactory.java
+++ b/src/libbluray/bdj/java-j2se/org/dvb/ui/FontFactory.java
@@ -51,14 +51,20 @@ public class FontFactory {
for (int i = 0; i < fontIndexData.length; i++) {
FontIndexData data = fontIndexData[i];
FileInputStream inStream = null;
-
+ String file = BDJUtil.discRootToFilesystem("/BDMV/AUXDATA/" + data.getFileName());
try {
- inStream = new FileInputStream(BDJUtil.discRootToFilesystem("/BDMV/AUXDATA/" + data.getFileName()));
+ inStream = new FileInputStream(file);
Font font = Font.createFont(Font.TRUETYPE_FONT, inStream);
font = font.deriveFont(data.getStyle(), data.getMaxSize());
fonts.put(data.getName(), font);
+ } catch (IOException ex) {
+ logger.error("Failed reading font " + data.getName() + " from " + file + ": " + ex);
+ throw ex;
+ } catch (FontFormatException ex) {
+ logger.error("Failed reading font " + data.getName() + " from " + file + ": " + ex);
+ throw ex;
} finally {
if (inStream != null) {
inStream.close();
@@ -74,6 +80,12 @@ public class FontFactory {
inStream = new FileInputStream(u.getPath());
urlFont = Font.createFont(Font.TRUETYPE_FONT, inStream);
+ } catch (IOException ex) {
+ logger.error("Failed reading font from " + u.getPath() + ": " + ex);
+ throw ex;
+ } catch (FontFormatException ex) {
+ logger.error("Failed reading font from " + u.getPath() + ": " + ex);
+ throw ex;
} finally {
if (inStream != null) {
inStream.close();
More information about the libbluray-devel
mailing list