From 3fc99cf3c049b1c60cbcaf271610f68481441efd Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Sun, 11 Nov 2007 15:30:34 +0000 Subject: Bugzilla #43835: Bugfix: Use Font.getName() (logical font name) instead of Font.getFontName() (localized) when registering fonts from AWT. Submitted by: David Churavy git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@593909 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/render/java2d/FontSetup.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/java/org/apache/fop') diff --git a/src/java/org/apache/fop/render/java2d/FontSetup.java b/src/java/org/apache/fop/render/java2d/FontSetup.java index 5637bdee2..bd53c20d7 100644 --- a/src/java/org/apache/fop/render/java2d/FontSetup.java +++ b/src/java/org/apache/fop/render/java2d/FontSetup.java @@ -218,7 +218,7 @@ public class FontSetup { java.awt.Font[] fonts = env.getAllFonts(); for (int i = 0; i < fonts.length; i++) { java.awt.Font f = fonts[i]; - if (HARDCODED_FONT_NAMES.contains(f.getFontName())) { + if (HARDCODED_FONT_NAMES.contains(f.getName())) { continue; //skip } @@ -231,20 +231,20 @@ public class FontSetup { + ", Style: " + f.getStyle()); } - String searchName = FontUtil.stripWhiteSpace(f.getFontName()).toLowerCase(); + String searchName = FontUtil.stripWhiteSpace(f.getName()).toLowerCase(); String guessedStyle = FontUtil.guessStyle(searchName); int guessedWeight = FontUtil.guessWeight(searchName); num++; String fontKey = "F" + num; int style = convertToAWTFontStyle(guessedStyle, guessedWeight); - addFontMetricsMapper(fontInfo, f.getFontName(), fontKey, graphics, style); + addFontMetricsMapper(fontInfo, f.getName(), fontKey, graphics, style); //Register appropriate font triplets matching the font. Two different strategies: //Example: "Arial Bold", normal, normal - addFontTriplet(fontInfo, f.getFontName(), + addFontTriplet(fontInfo, f.getName(), Font.STYLE_NORMAL, Font.WEIGHT_NORMAL, fontKey); - if (!f.getFontName().equals(f.getFamily())) { + if (!f.getName().equals(f.getFamily())) { //Example: "Arial", bold, normal addFontTriplet(fontInfo, f.getFamily(), guessedStyle, guessedWeight, fontKey); -- cgit v1.2.3