]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Bugfix: a specified font-weight of 100 could result into a resolved font-weight of...
authorJeremias Maerki <jeremias@apache.org>
Tue, 19 Feb 2008 14:16:08 +0000 (14:16 +0000)
committerJeremias Maerki <jeremias@apache.org>
Tue, 19 Feb 2008 14:16:08 +0000 (14:16 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@629103 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/fonts/FontInfo.java

index ab11eb76824f76e760ea396fc14616928c20f4ad..218734f1575bcac705bfaaa6ad6f5513ddb249df 100644 (file)
@@ -383,11 +383,17 @@ public class FontInfo {
         String f = null;
         int newWeight = weight;
         if (newWeight < 400) {
-            while (f == null && newWeight > 0) {
+            while (f == null && newWeight > 100) {
                 newWeight -= 100;
                 key = createFontKey(family, style, newWeight);
                 f = getInternalFontKey(key);
             }
+            newWeight = weight;
+            while (f == null && newWeight < 400) {
+                newWeight += 100;
+                key = createFontKey(family, style, newWeight);
+                f = getInternalFontKey(key);
+            }
         } else if (newWeight == 500) {
             key = createFontKey(family, style, 400);
             f = getInternalFontKey(key);