[libbluray-devel] FontFactory: do not fail if at least one font was loaded

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:45:39 2014 +0300| [79a6bae2707fe8e0f40fe10e7749f15f9f2b25a8] | committer: hpi1

FontFactory: do not fail if at least one font was loaded

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=79a6bae2707fe8e0f40fe10e7749f15f9f2b25a8
---

 src/libbluray/bdj/java-j2se/org/dvb/ui/FontFactory.java |   10 ++++++++--
 1 file changed, 8 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 5d65ebb..696d342 100644
--- a/src/libbluray/bdj/java-j2se/org/dvb/ui/FontFactory.java
+++ b/src/libbluray/bdj/java-j2se/org/dvb/ui/FontFactory.java
@@ -61,10 +61,16 @@ public class FontFactory {
 
             } catch (IOException ex) {
                 logger.error("Failed reading font " + data.getName() + " from " + file + ": " + ex);
-                throw ex;
+                if (i == fontIndexData.length - 1 && fonts.size() < 1) {
+                    logger.error("didn't load any fonts !");
+                    throw ex;
+                }
             } catch (FontFormatException ex) {
                 logger.error("Failed reading font " + data.getName() + " from " + file + ": " + ex);
-                throw ex;
+                if (i == fontIndexData.length - 1 && fonts.size() < 1) {
+                    logger.error("didn't load any fonts !");
+                    throw ex;
+                }
             } finally {
                 if (inStream != null) {
                     inStream.close();



More information about the libbluray-devel mailing list