From 5b06b2c75f10e0be591f878b1d7a533a9b826f7c Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Tue, 19 Feb 2008 14:16:08 +0000 Subject: [PATCH] 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 --- src/java/org/apache/fop/fonts/FontInfo.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); -- 2.39.5