[libbluray-devel] FontFactory: allow same font with different styles

hpi1 git at videolan.org
Sun Nov 23 13:19:56 CET 2014


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sun Nov 23 13:56:40 2014 +0200| [797a7ec5037371d5989a32f03a77f2d0290ddc2d] | committer: hpi1

FontFactory: allow same font with different styles

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

 src/libbluray/bdj/java-j2se/org/dvb/ui/FontFactory.java |    4 ++--
 1 file changed, 2 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 7fd6ec3..230debd 100644
--- a/src/libbluray/bdj/java-j2se/org/dvb/ui/FontFactory.java
+++ b/src/libbluray/bdj/java-j2se/org/dvb/ui/FontFactory.java
@@ -69,7 +69,7 @@ public class FontFactory {
                 Font font = Font.createFont(Font.TRUETYPE_FONT, fontFile);
                 font = font.deriveFont(data.getStyle(), 1);
 
-                fonts.put(data.getName(), font);
+                fonts.put(data.getName() + "." + font.getStyle(), font);
                 fontIds.put(data.getFileName().substring(0, 5), font);
 
             } catch (IOException ex) {
@@ -142,7 +142,7 @@ public class FontFactory {
 
         Font font = null;
         synchronized (FontFactory.class) {
-            font = (Font)fonts.get(name);
+            font = (Font)fonts.get(name + "." + style);
         }
 
         if (font == null) {



More information about the libbluray-devel mailing list