From e6253facf92f0e0fc8da5a343c526ba7f2d09f22 Mon Sep 17 00:00:00 2001 From: Adrian Cumiskey Date: Mon, 21 Jul 2008 16:48:14 +0000 Subject: [PATCH] Renamed fname to more correct name fontKey. Made createFontKey() in FontInfo synchronized which should hopefully fix Ingo Maas's threading problem (http://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-users/200807.mbox/%3C000a01c8eb4b$42166e60$a701010a@ebp01422%3E). git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@678477 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/fonts/FontInfo.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/java/org/apache/fop/fonts/FontInfo.java b/src/java/org/apache/fop/fonts/FontInfo.java index 8272a9bdf..560330f6d 100644 --- a/src/java/org/apache/fop/fonts/FontInfo.java +++ b/src/java/org/apache/fop/fonts/FontInfo.java @@ -319,10 +319,10 @@ public class FontInfo { Integer size = new Integer(fontSize); Font font = (Font)sizes.get(size); if (font == null) { - String fname = getInternalFontKey(triplet); - useFont(fname); - FontMetrics metrics = getMetricsFor(fname); - font = new Font(fname, triplet, metrics, fontSize); + String fontKey = getInternalFontKey(triplet); + useFont(fontKey); + FontMetrics metrics = getMetricsFor(fontKey); + font = new Font(fontKey, triplet, metrics, fontSize); sizes.put(size, font); } return font; @@ -504,7 +504,7 @@ public class FontInfo { * @param weight font weight * @return internal key */ - public static FontTriplet createFontKey(String family, String style, + public static synchronized FontTriplet createFontKey(String family, String style, int weight) { return new FontTriplet(family, style, weight); } -- 2.39.5