diff options
author | Keiron Liddle <keiron@apache.org> | 2002-07-23 11:06:51 +0000 |
---|---|---|
committer | Keiron Liddle <keiron@apache.org> | 2002-07-23 11:06:51 +0000 |
commit | f6a0559f5fe65405fa202434fe514de7a0f372bc (patch) | |
tree | 95c06a67fc1eae9b0f36bf885994ec04b415b96d /src/org/apache/fop/layout/FontState.java | |
parent | 7f263c27804a4882f33f5a423150d5cc52448361 (diff) | |
download | xmlgraphics-fop-f6a0559f5fe65405fa202434fe514de7a0f372bc.tar.gz xmlgraphics-fop-f6a0559f5fe65405fa202434fe514de7a0f372bc.zip |
cleaned up the font state a bit
exception only thrown after setup as exception indicates invalid setup
only font name key and size are set on the area tree
FontState used as handler to get metric info
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195024 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/layout/FontState.java')
-rw-r--r-- | src/org/apache/fop/layout/FontState.java | 37 |
1 files changed, 4 insertions, 33 deletions
diff --git a/src/org/apache/fop/layout/FontState.java b/src/org/apache/fop/layout/FontState.java index 147e1198d..3ff676bd7 100644 --- a/src/org/apache/fop/layout/FontState.java +++ b/src/org/apache/fop/layout/FontState.java @@ -9,18 +9,16 @@ package org.apache.fop.layout; import java.util.HashMap; -import org.apache.fop.apps.FOPException; import org.apache.fop.fo.properties.FontVariant; import org.apache.fop.render.pdf.CodePointMapping; public class FontState { - private FontInfo _fontInfo; private String _fontName; private int _fontSize; private String _fontFamily; private String _fontStyle; - private String _fontWeight; + private int _fontWeight; private int _fontVariant; private FontMetric _metric; @@ -28,17 +26,10 @@ public class FontState { private static HashMap EMPTY_HASHMAP = new HashMap(); - public FontState(FontInfo fontInfo, String fontFamily, String fontStyle, - String fontWeight, int fontSize, - int fontVariant) throws FOPException { - _fontInfo = fontInfo; - _fontFamily = fontFamily; - _fontStyle = fontStyle; - _fontWeight = fontWeight; + public FontState(String key, FontMetric met, int fontSize) { _fontSize = fontSize; - _fontName = fontInfo.fontLookup(fontFamily, fontStyle, fontWeight); - _metric = fontInfo.getMetricsFor(_fontName); - _fontVariant = fontVariant; + _fontName = key; + _metric = met; } public int getAscender() { @@ -61,26 +52,6 @@ public class FontState { return _fontSize; } - public String getFontWeight() { - return _fontWeight; - } - - public String getFontFamily() { - return _fontFamily; - } - - public String getFontStyle() { - return _fontStyle; - } - - public int getFontVariant() { - return _fontVariant; - } - - public FontInfo getFontInfo() { - return _fontInfo; - } - public int getXHeight() { return _metric.getXHeight(_fontSize) / 1000; } |