From: Jeremias Maerki Date: Tue, 19 Feb 2008 14:16:08 +0000 (+0000) Subject: Bugfix: a specified font-weight of 100 could result into a resolved font-weight of... X-Git-Tag: fop-0_95beta~53 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5b06b2c75f10e0be591f878b1d7a533a9b826f7c;p=xmlgraphics-fop.git Bugfix: a specified font-weight of 100 could result into a resolved font-weight of 400 even when a font with weight 200 is registered. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@629103 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/fonts/FontInfo.java b/src/java/org/apache/fop/fonts/FontInfo.java index ab11eb768..218734f15 100644 --- a/src/java/org/apache/fop/fonts/FontInfo.java +++ b/src/java/org/apache/fop/fonts/FontInfo.java @@ -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);