diff options
author | Jeremias Maerki <jeremias@apache.org> | 2007-11-11 15:30:34 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2007-11-11 15:30:34 +0000 |
commit | 3fc99cf3c049b1c60cbcaf271610f68481441efd (patch) | |
tree | 615ffb9f05879b43d26e8c5b9753a554ab711b80 /src/java/org/apache/fop/render | |
parent | 205a9659f24b4177860ec309a8323dec28be5b0b (diff) | |
download | xmlgraphics-fop-3fc99cf3c049b1c60cbcaf271610f68481441efd.tar.gz xmlgraphics-fop-3fc99cf3c049b1c60cbcaf271610f68481441efd.zip |
Bugzilla #43835:
Bugfix: Use Font.getName() (logical font name) instead of Font.getFontName() (localized) when registering fonts from AWT.
Submitted by: David Churavy <churavy.at.kadel.cz>
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@593909 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render')
-rw-r--r-- | src/java/org/apache/fop/render/java2d/FontSetup.java | 10 |
1 files changed, 5 insertions, 5 deletions
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); |