summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKeiron Liddle <keiron@apache.org>2002-07-23 11:06:51 +0000
committerKeiron Liddle <keiron@apache.org>2002-07-23 11:06:51 +0000
commitf6a0559f5fe65405fa202434fe514de7a0f372bc (patch)
tree95c06a67fc1eae9b0f36bf885994ec04b415b96d /src
parent7f263c27804a4882f33f5a423150d5cc52448361 (diff)
downloadxmlgraphics-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')
-rw-r--r--src/org/apache/fop/apps/LayoutHandler.java4
-rw-r--r--src/org/apache/fop/area/Trait.java15
-rw-r--r--src/org/apache/fop/fo/PropertyManager.java36
-rw-r--r--src/org/apache/fop/fo/Title.java2
-rw-r--r--src/org/apache/fop/layout/FontInfo.java133
-rw-r--r--src/org/apache/fop/layout/FontState.java37
-rw-r--r--src/org/apache/fop/layoutmgr/TextBPLayoutManager.java4
-rw-r--r--src/org/apache/fop/layoutmgr/TextLayoutManager.java2
-rw-r--r--src/org/apache/fop/render/awt/FontSetup.java133
-rw-r--r--src/org/apache/fop/render/pdf/FontSetup.java135
-rw-r--r--src/org/apache/fop/render/pdf/PDFRenderer.java24
-rw-r--r--src/org/apache/fop/render/pdf/PDFXMLHandler.java12
-rw-r--r--src/org/apache/fop/tools/AreaTreeBuilder.java27
13 files changed, 294 insertions, 270 deletions
diff --git a/src/org/apache/fop/apps/LayoutHandler.java b/src/org/apache/fop/apps/LayoutHandler.java
index d716982fe..aae36e2ea 100644
--- a/src/org/apache/fop/apps/LayoutHandler.java
+++ b/src/org/apache/fop/apps/LayoutHandler.java
@@ -100,6 +100,10 @@ public class LayoutHandler extends StructureHandler {
try {
renderer.setupFontInfo(fontInfo);
+ // check that the "any,normal,400" font exists
+ if(!fontInfo.isSetupValid()) {
+ throw new SAXException(new FOPException("no default font defined by OutputConverter"));
+ }
renderer.startRenderer(outputStream);
} catch (IOException e) {
throw new SAXException(e);
diff --git a/src/org/apache/fop/area/Trait.java b/src/org/apache/fop/area/Trait.java
index dede23a57..8aecae835 100644
--- a/src/org/apache/fop/area/Trait.java
+++ b/src/org/apache/fop/area/Trait.java
@@ -21,10 +21,8 @@ public class Trait implements Serializable {
public static final Integer ID_LINK = new Integer(0);
public static final Integer INTERNAL_LINK = new Integer(1); //resolved
public static final Integer EXTERNAL_LINK = new Integer(2);
- public static final Integer FONT_FAMILY = new Integer(3);
+ public static final Integer FONT_NAME = new Integer(3);
public static final Integer FONT_SIZE = new Integer(4);
- public static final Integer FONT_WEIGHT = new Integer(5);
- public static final Integer FONT_STYLE = new Integer(6);
public static final Integer COLOR = new Integer(7);
public static final Integer ID_AREA = new Integer(8);
public static final Integer BACKGROUND = new Integer(9);
@@ -42,8 +40,6 @@ public class Trait implements Serializable {
public static final Integer PADDING_BEFORE = new Integer(21);
public static final Integer PADDING_AFTER = new Integer(22);
- public static final Integer FONT_STATE = new Integer(100);
-
static HashMap s_hmTraitInfo;
private static class TraitInfo {
@@ -64,14 +60,10 @@ public class Trait implements Serializable {
new TraitInfo("internal-link", String.class));
s_hmTraitInfo.put(EXTERNAL_LINK,
new TraitInfo("external-link", String.class));
- s_hmTraitInfo.put(FONT_FAMILY,
+ s_hmTraitInfo.put(FONT_NAME,
new TraitInfo("font-family", String.class));
s_hmTraitInfo.put(FONT_SIZE,
new TraitInfo("font-size", Integer.class));
- s_hmTraitInfo.put(FONT_WEIGHT,
- new TraitInfo("font-weight", Integer.class));
- s_hmTraitInfo.put(FONT_STYLE,
- new TraitInfo("font-style", String.class));
s_hmTraitInfo.put(COLOR,
new TraitInfo("color", String.class));
s_hmTraitInfo.put(ID_AREA,
@@ -104,9 +96,6 @@ public class Trait implements Serializable {
new TraitInfo("padding-before", Integer.class));
s_hmTraitInfo.put(PADDING_AFTER,
new TraitInfo("padding-after", Integer.class));
-
- s_hmTraitInfo.put(FONT_STATE,
- new TraitInfo("font-state", FontState.class));
}
public static String getTraitName(Object traitCode) {
diff --git a/src/org/apache/fop/fo/PropertyManager.java b/src/org/apache/fop/fo/PropertyManager.java
index 71a902539..2599cb0df 100644
--- a/src/org/apache/fop/fo/PropertyManager.java
+++ b/src/org/apache/fop/fo/PropertyManager.java
@@ -14,6 +14,7 @@ import org.apache.fop.datatypes.FODimension;
import org.apache.fop.fo.TextInfo; // should be somewhere else probably...
import org.apache.fop.layout.FontState;
import org.apache.fop.layout.FontInfo;
+import org.apache.fop.layout.FontMetric;
import org.apache.fop.layout.BorderAndPadding;
import org.apache.fop.layout.MarginProps;
import org.apache.fop.layout.MarginInlineProps;
@@ -68,7 +69,7 @@ public class PropertyManager {
}
- public FontState getFontState(FontInfo fontInfo) throws FOPException {
+ public FontState getFontState(FontInfo fontInfo) {
if (fontState == null) {
if (fontInfo == null) {
fontInfo = m_fontInfo;
@@ -78,14 +79,33 @@ public class PropertyManager {
}
String fontFamily = properties.get("font-family").getString();
String fontStyle = properties.get("font-style").getString();
- String fontWeight = properties.get("font-weight").getString();
+ String fw = properties.get("font-weight").getString();
+ int fontWeight = 400;
+ if(fw.equals("bolder")) {
+ // +100 from inherited
+ } else if(fw.equals("lighter")) {
+ // -100 from inherited
+ } else {
+ try {
+ fontWeight = Integer.parseInt(fw);
+ } catch(NumberFormatException nfe) {
+ }
+ }
+ fontWeight = ((int)fontWeight / 100) * 100;
+ if(fontWeight < 100) {
+ fontWeight = 100;
+ } else if(fontWeight > 900) {
+ fontWeight = 900;
+ }
+
// NOTE: this is incomplete. font-size may be specified with
// various kinds of keywords too
int fontSize = properties.get("font-size").getLength().mvalue();
int fontVariant = properties.get("font-variant").getEnum();
- // fontInfo is same for the whole FOP run but set in all FontState
- fontState = new FontState(fontInfo, fontFamily, fontStyle,
- fontWeight, fontSize, fontVariant);
+ String fname = fontInfo.fontLookup(fontFamily, fontStyle,
+ fontWeight);
+ FontMetric metrics = fontInfo.getMetricsFor(fname);
+ fontState = new FontState(fname, metrics, fontSize);
}
return fontState;
}
@@ -299,13 +319,7 @@ public class PropertyManager {
public TextInfo getTextLayoutProps(FontInfo fontInfo) {
if (textInfo == null) {
textInfo = new TextInfo();
- try {
textInfo.fs = getFontState(fontInfo);
- } catch (FOPException fopex) {
- /* log.error("Error setting FontState for characters: " +
- fopex.getMessage());*/
- // Now what should we do ???
- }
textInfo.color = properties.get("color").getColorType();
textInfo.verticalAlign =
diff --git a/src/org/apache/fop/fo/Title.java b/src/org/apache/fop/fo/Title.java
index ccbcaac83..9122296db 100644
--- a/src/org/apache/fop/fo/Title.java
+++ b/src/org/apache/fop/fo/Title.java
@@ -44,7 +44,7 @@ public class Title extends ToBeImplementedElement {
BackgroundProps bProps = propMgr.getBackgroundProps();
// Common Font Properties
- //FontState fontState = propMgr.getFontState(structHandler.getFontInfo());
+ FontState fontState = propMgr.getFontState(structHandler.getFontInfo());
// Common Margin Properties-Inline
MarginInlineProps mProps = propMgr.getMarginInlineProps();
diff --git a/src/org/apache/fop/layout/FontInfo.java b/src/org/apache/fop/layout/FontInfo.java
index c8b6fa955..a6df5f54a 100644
--- a/src/org/apache/fop/layout/FontInfo.java
+++ b/src/org/apache/fop/layout/FontInfo.java
@@ -9,9 +9,19 @@ package org.apache.fop.layout;
import java.util.HashMap;
-import org.apache.fop.apps.FOPException;
-
+/**
+ * The fontinfo for the layout and rendering of a fo document.
+ * This stores the list of available fonts that are setup by
+ * the renderer. The font name can be retrieved for the
+ * family style and weight.
+ * Currently font supported font-variant small-caps is not
+ * implemented.
+ */
public class FontInfo {
+ public static final String DEFAULT_FONT = "any,normal,400";
+ public static final int NORMAL = 400;
+ public static final int BOLD = 700;
+
HashMap usedFonts;
HashMap triplets; // look up a font-triplet to find a font-name
HashMap fonts; // look up a font-name to get a font (that implements FontMetric at least)
@@ -22,8 +32,12 @@ public class FontInfo {
this.usedFonts = new HashMap();
}
+ public boolean isSetupValid() {
+ return triplets.containsKey(DEFAULT_FONT);
+ }
+
public void addFontProperties(String name, String family, String style,
- String weight) {
+ int weight) {
/*
* add the given family, style and weight as a lookup for the font
* with the given name
@@ -39,56 +53,92 @@ public class FontInfo {
this.fonts.put(name, metrics);
}
+ /**
+ * Lookup a font.
+ * Locate the font name for a given familyi, style and weight.
+ * The font name can then be used as a key as it is unique for
+ * the associated document.
+ * This also adds the font to the list of used fonts.
+ */
public String fontLookup(String family, String style,
- String weight) throws FOPException {
- return fontLookup(createFontKey(family, style, weight));
- }
+ int weight) {
+ String key;
+ // first try given parameters
+ key = createFontKey(family, style, weight);
+ String f = (String)triplets.get(key);
+ if(f == null) {
+ // then adjust weight, favouring normal or bold
+ f = findAdjustWeight(family, style, weight);
+
+ // then try any family with orig weight
+ if(f == null) {
+ key = createFontKey("any", style, weight);
+ f = (String)triplets.get(key);
+ }
- public String fontLookup(String key) throws FOPException {
-
- String f = (String)this.triplets.get(key);
- if (f == null) {
- int i = key.indexOf(',');
- String s = "any" + key.substring(i);
- f = (String)this.triplets.get(s);
- if (f == null) {
- f = (String)this.triplets.get("any,normal,normal");
- if (f == null) {
- throw new FOPException("no default font defined by OutputConverter");
- }
- //log.error("defaulted font to any,normal,normal");
+ // then try any family with adjusted weight
+ if(f == null) {
+ f = findAdjustWeight(family, style, weight);
}
- //log.error("unknown font " + key
- // + " so defaulted font to any");
+
+ // then use default
+ f = (String)triplets.get(DEFAULT_FONT);
+
}
usedFonts.put(f, fonts.get(f));
return f;
}
- public boolean hasFont(String family, String style, String weight) {
+ /**
+ * Find a font with a given family and style by trying
+ * different font weights according to the spec.
+ */
+ public String findAdjustWeight(String family, String style,
+ int weight) {
+ String key;
+ String f = null;
+ int newWeight = weight;
+ if(newWeight < 400) {
+ while(f == null && newWeight > 0) {
+ newWeight -= 100;
+ key = createFontKey(family, style, newWeight);
+ f = (String)triplets.get(key);
+ }
+ } else if(newWeight == 500) {
+ key = createFontKey(family, style, 400);
+ f = (String)triplets.get(key);
+ } else if(newWeight > 500) {
+ while(f == null && newWeight < 1000) {
+ newWeight += 100;
+ key = createFontKey(family, style, newWeight);
+ f = (String)triplets.get(key);
+ }
+ newWeight = weight;
+ while(f == null && newWeight > 400) {
+ newWeight -= 100;
+ key = createFontKey(family, style, newWeight);
+ f = (String)triplets.get(key);
+ }
+ }
+ if(f == null) {
+ key = createFontKey(family, style, 400);
+ f = (String)triplets.get(key);
+ }
+
+ return f;
+ }
+
+ public boolean hasFont(String family, String style, int weight) {
String key = createFontKey(family, style, weight);
- return this.triplets.get(key) != null;
+ return this.triplets.containsKey(key);
}
/**
* Creates a key from the given strings
*/
public static String createFontKey(String family, String style,
- String weight) {
- int i;
-
- try {
- i = Integer.parseInt(weight);
- } catch (NumberFormatException e) {
- i = 0;
- }
-
- if (i > 600)
- weight = "bold";
- else if (i > 0)
- weight = "normal";
-
+ int weight) {
return family + "," + style + "," + weight;
}
@@ -96,13 +146,18 @@ public class FontInfo {
return this.fonts;
}
+ /**
+ * This is used by the renderers to retrieve all the
+ * fonts used in the document.
+ * This is for embedded font or creating a list of used fonts.
+ */
public HashMap getUsedFonts() {
return this.usedFonts;
}
- public FontMetric getMetricsFor(String fontName) throws FOPException {
+ public FontMetric getMetricsFor(String fontName) {
usedFonts.put(fontName, fonts.get(fontName));
return (FontMetric)fonts.get(fontName);
}
-
}
+
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;
}
diff --git a/src/org/apache/fop/layoutmgr/TextBPLayoutManager.java b/src/org/apache/fop/layoutmgr/TextBPLayoutManager.java
index 45466c1d6..08052e9ec 100644
--- a/src/org/apache/fop/layoutmgr/TextBPLayoutManager.java
+++ b/src/org/apache/fop/layoutmgr/TextBPLayoutManager.java
@@ -527,8 +527,8 @@ public class TextBPLayoutManager extends AbstractBPLayoutManager {
curWordArea.info.blOffset = true;
curWordArea.setWord(str);
- //curWordArea.addTrait(new Trait(Trait.FONT_STATE, textInfo.fs));
- curWordArea.addTrait(Trait.FONT_STATE, textInfo.fs);
+ curWordArea.addTrait(Trait.FONT_NAME, textInfo.fs.getFontName());
+ curWordArea.addTrait(Trait.FONT_SIZE, new Integer(textInfo.fs.getFontSize()));
return curWordArea;
}
diff --git a/src/org/apache/fop/layoutmgr/TextLayoutManager.java b/src/org/apache/fop/layoutmgr/TextLayoutManager.java
index a8a31096c..0cfcc3da3 100644
--- a/src/org/apache/fop/layoutmgr/TextLayoutManager.java
+++ b/src/org/apache/fop/layoutmgr/TextLayoutManager.java
@@ -247,7 +247,7 @@ public class TextLayoutManager extends LeafNodeLayoutManager {
curWordArea.setWord(str);
// curWordArea.addTrait(new Trait(Trait.FONT_STATE, textInfo.fs));
- curWordArea.addTrait(Trait.FONT_STATE, textInfo.fs);
+ //curWordArea.addTrait(Trait.FONT_STATE, textInfo.fs);
return curWordArea;
}
diff --git a/src/org/apache/fop/render/awt/FontSetup.java b/src/org/apache/fop/render/awt/FontSetup.java
index e0e6d0669..341279178 100644
--- a/src/org/apache/fop/render/awt/FontSetup.java
+++ b/src/org/apache/fop/render/awt/FontSetup.java
@@ -102,83 +102,74 @@ public class FontSetup {
// fontInfo.addMetrics("F17", new BauerBodoniBoldItalic());
/* any is treated as serif */
- fontInfo.addFontProperties("F5", "any", "normal", "normal");
- fontInfo.addFontProperties("F6", "any", "italic", "normal");
- fontInfo.addFontProperties("F6", "any", "oblique", "normal");
- fontInfo.addFontProperties("F7", "any", "normal", "bold");
- fontInfo.addFontProperties("F8", "any", "italic", "bold");
- fontInfo.addFontProperties("F8", "any", "oblique", "bold");
-
- fontInfo.addFontProperties("F1", "sans-serif", "normal", "normal");
- fontInfo.addFontProperties("F2", "sans-serif", "oblique", "normal");
- fontInfo.addFontProperties("F2", "sans-serif", "italic", "normal");
- fontInfo.addFontProperties("F3", "sans-serif", "normal", "bold");
- fontInfo.addFontProperties("F4", "sans-serif", "oblique", "bold");
- fontInfo.addFontProperties("F4", "sans-serif", "italic", "bold");
- fontInfo.addFontProperties("F5", "serif", "normal", "normal");
- fontInfo.addFontProperties("F6", "serif", "oblique", "normal");
- fontInfo.addFontProperties("F6", "serif", "italic", "normal");
- fontInfo.addFontProperties("F7", "serif", "normal", "bold");
- fontInfo.addFontProperties("F8", "serif", "oblique", "bold");
- fontInfo.addFontProperties("F8", "serif", "italic", "bold");
- fontInfo.addFontProperties("F9", "monospace", "normal", "normal");
- fontInfo.addFontProperties("F10", "monospace", "oblique", "normal");
- fontInfo.addFontProperties("F10", "monospace", "italic", "normal");
- fontInfo.addFontProperties("F11", "monospace", "normal", "bold");
- fontInfo.addFontProperties("F12", "monospace", "oblique", "bold");
- fontInfo.addFontProperties("F12", "monospace", "italic", "bold");
-
- fontInfo.addFontProperties("F1", "Helvetica", "normal", "normal");
- fontInfo.addFontProperties("F2", "Helvetica", "oblique", "normal");
- fontInfo.addFontProperties("F2", "Helvetica", "italic", "normal");
- fontInfo.addFontProperties("F3", "Helvetica", "normal", "bold");
- fontInfo.addFontProperties("F4", "Helvetica", "oblique", "bold");
- fontInfo.addFontProperties("F4", "Helvetica", "italic", "bold");
- fontInfo.addFontProperties("F5", "Times", "normal", "normal");
- fontInfo.addFontProperties("F6", "Times", "oblique", "normal");
- fontInfo.addFontProperties("F6", "Times", "italic", "normal");
- fontInfo.addFontProperties("F7", "Times", "normal", "bold");
- fontInfo.addFontProperties("F8", "Times", "oblique", "bold");
- fontInfo.addFontProperties("F8", "Times", "italic", "bold");
- fontInfo.addFontProperties("F9", "Courier", "normal", "normal");
- fontInfo.addFontProperties("F10", "Courier", "oblique", "normal");
- fontInfo.addFontProperties("F10", "Courier", "italic", "normal");
- fontInfo.addFontProperties("F11", "Courier", "normal", "bold");
- fontInfo.addFontProperties("F12", "Courier", "oblique", "bold");
- fontInfo.addFontProperties("F12", "Courier", "italic", "bold");
- fontInfo.addFontProperties("F13", "Symbol", "normal", "normal");
- fontInfo.addFontProperties("F14", "ZapfDingbats", "normal", "normal");
+ fontInfo.addFontProperties("F5", "any", "normal", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F6", "any", "italic", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F6", "any", "oblique", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F7", "any", "normal", FontInfo.BOLD);
+ fontInfo.addFontProperties("F8", "any", "italic", FontInfo.BOLD);
+ fontInfo.addFontProperties("F8", "any", "oblique", FontInfo.BOLD);
+
+ fontInfo.addFontProperties("F1", "sans-serif", "normal", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F2", "sans-serif", "oblique", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F2", "sans-serif", "italic", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F3", "sans-serif", "normal", FontInfo.BOLD);
+ fontInfo.addFontProperties("F4", "sans-serif", "oblique", FontInfo.BOLD);
+ fontInfo.addFontProperties("F4", "sans-serif", "italic", FontInfo.BOLD);
+ fontInfo.addFontProperties("F5", "serif", "normal", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F6", "serif", "oblique", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F6", "serif", "italic", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F7", "serif", "normal", FontInfo.BOLD);
+ fontInfo.addFontProperties("F8", "serif", "oblique", FontInfo.BOLD);
+ fontInfo.addFontProperties("F8", "serif", "italic", FontInfo.BOLD);
+ fontInfo.addFontProperties("F9", "monospace", "normal", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F10", "monospace", "oblique", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F10", "monospace", "italic", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F11", "monospace", "normal", FontInfo.BOLD);
+ fontInfo.addFontProperties("F12", "monospace", "oblique", FontInfo.BOLD);
+ fontInfo.addFontProperties("F12", "monospace", "italic", FontInfo.BOLD);
+
+ fontInfo.addFontProperties("F1", "Helvetica", "normal", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F2", "Helvetica", "oblique", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F2", "Helvetica", "italic", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F3", "Helvetica", "normal", FontInfo.BOLD);
+ fontInfo.addFontProperties("F4", "Helvetica", "oblique", FontInfo.BOLD);
+ fontInfo.addFontProperties("F4", "Helvetica", "italic", FontInfo.BOLD);
+ fontInfo.addFontProperties("F5", "Times", "normal", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F6", "Times", "oblique", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F6", "Times", "italic", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F7", "Times", "normal", FontInfo.BOLD);
+ fontInfo.addFontProperties("F8", "Times", "oblique", FontInfo.BOLD);
+ fontInfo.addFontProperties("F8", "Times", "italic", FontInfo.BOLD);
+ fontInfo.addFontProperties("F9", "Courier", "normal", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F10", "Courier", "oblique", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F10", "Courier", "italic", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F11", "Courier", "normal", FontInfo.BOLD);
+ fontInfo.addFontProperties("F12", "Courier", "oblique", FontInfo.BOLD);
+ fontInfo.addFontProperties("F12", "Courier", "italic", FontInfo.BOLD);
+ fontInfo.addFontProperties("F13", "Symbol", "normal", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F14", "ZapfDingbats", "normal", FontInfo.NORMAL);
// Custom type 1 fonts step 2/2
- // fontInfo.addFontProperties("F15", "OMEP", "normal", "normal");
- // fontInfo.addFontProperties("F16", "Garamond-LightCondensed", "normal", "normal");
- // fontInfo.addFontProperties("F17", "BauerBodoni", "italic", "bold");
+ // fontInfo.addFontProperties("F15", "OMEP", "normal", FontInfo.NORMAL);
+ // fontInfo.addFontProperties("F16", "Garamond-LightCondensed", "normal", FontInfo.NORMAL);
+ // fontInfo.addFontProperties("F17", "BauerBodoni", "italic", FontInfo.BOLD);
/* for compatibility with PassiveTex */
- fontInfo.addFontProperties("F5", "Times-Roman", "normal", "normal");
- fontInfo.addFontProperties("F6", "Times-Roman", "oblique", "normal");
- fontInfo.addFontProperties("F6", "Times-Roman", "italic", "normal");
- fontInfo.addFontProperties("F7", "Times-Roman", "normal", "bold");
- fontInfo.addFontProperties("F8", "Times-Roman", "oblique", "bold");
- fontInfo.addFontProperties("F8", "Times-Roman", "italic", "bold");
- fontInfo.addFontProperties("F5", "Times Roman", "normal", "normal");
- fontInfo.addFontProperties("F6", "Times Roman", "oblique", "normal");
- fontInfo.addFontProperties("F6", "Times Roman", "italic", "normal");
- fontInfo.addFontProperties("F7", "Times Roman", "normal", "bold");
- fontInfo.addFontProperties("F8", "Times Roman", "oblique", "bold");
- fontInfo.addFontProperties("F8", "Times Roman", "italic", "bold");
+ fontInfo.addFontProperties("F5", "Times-Roman", "normal", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F6", "Times-Roman", "oblique", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F6", "Times-Roman", "italic", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F7", "Times-Roman", "normal", FontInfo.BOLD);
+ fontInfo.addFontProperties("F8", "Times-Roman", "oblique", FontInfo.BOLD);
+ fontInfo.addFontProperties("F8", "Times-Roman", "italic", FontInfo.BOLD);
+ fontInfo.addFontProperties("F5", "Times Roman", "normal", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F6", "Times Roman", "oblique", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F6", "Times Roman", "italic", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F7", "Times Roman", "normal", FontInfo.BOLD);
+ fontInfo.addFontProperties("F8", "Times Roman", "oblique", FontInfo.BOLD);
+ fontInfo.addFontProperties("F8", "Times Roman", "italic", FontInfo.BOLD);
fontInfo.addFontProperties("F9", "Computer-Modern-Typewriter",
- "normal", "normal");
+ "normal", FontInfo.NORMAL);
}
}
-
-
-
-
-
-
-
-
-
diff --git a/src/org/apache/fop/render/pdf/FontSetup.java b/src/org/apache/fop/render/pdf/FontSetup.java
index 234c48219..221020bbe 100644
--- a/src/org/apache/fop/render/pdf/FontSetup.java
+++ b/src/org/apache/fop/render/pdf/FontSetup.java
@@ -60,73 +60,73 @@ public class FontSetup {
// fontInfo.addMetrics("F17", new BauerBodoniBoldItalic());
/* any is treated as serif */
- fontInfo.addFontProperties("F5", "any", "normal", "normal");
- fontInfo.addFontProperties("F6", "any", "italic", "normal");
- fontInfo.addFontProperties("F6", "any", "oblique", "normal");
- fontInfo.addFontProperties("F7", "any", "normal", "bold");
- fontInfo.addFontProperties("F8", "any", "italic", "bold");
- fontInfo.addFontProperties("F8", "any", "oblique", "bold");
-
- fontInfo.addFontProperties("F1", "sans-serif", "normal", "normal");
- fontInfo.addFontProperties("F2", "sans-serif", "oblique", "normal");
- fontInfo.addFontProperties("F2", "sans-serif", "italic", "normal");
- fontInfo.addFontProperties("F3", "sans-serif", "normal", "bold");
- fontInfo.addFontProperties("F4", "sans-serif", "oblique", "bold");
- fontInfo.addFontProperties("F4", "sans-serif", "italic", "bold");
- fontInfo.addFontProperties("F5", "serif", "normal", "normal");
- fontInfo.addFontProperties("F6", "serif", "oblique", "normal");
- fontInfo.addFontProperties("F6", "serif", "italic", "normal");
- fontInfo.addFontProperties("F7", "serif", "normal", "bold");
- fontInfo.addFontProperties("F8", "serif", "oblique", "bold");
- fontInfo.addFontProperties("F8", "serif", "italic", "bold");
- fontInfo.addFontProperties("F9", "monospace", "normal", "normal");
- fontInfo.addFontProperties("F10", "monospace", "oblique", "normal");
- fontInfo.addFontProperties("F10", "monospace", "italic", "normal");
- fontInfo.addFontProperties("F11", "monospace", "normal", "bold");
- fontInfo.addFontProperties("F12", "monospace", "oblique", "bold");
- fontInfo.addFontProperties("F12", "monospace", "italic", "bold");
-
- fontInfo.addFontProperties("F1", "Helvetica", "normal", "normal");
- fontInfo.addFontProperties("F2", "Helvetica", "oblique", "normal");
- fontInfo.addFontProperties("F2", "Helvetica", "italic", "normal");
- fontInfo.addFontProperties("F3", "Helvetica", "normal", "bold");
- fontInfo.addFontProperties("F4", "Helvetica", "oblique", "bold");
- fontInfo.addFontProperties("F4", "Helvetica", "italic", "bold");
- fontInfo.addFontProperties("F5", "Times", "normal", "normal");
- fontInfo.addFontProperties("F6", "Times", "oblique", "normal");
- fontInfo.addFontProperties("F6", "Times", "italic", "normal");
- fontInfo.addFontProperties("F7", "Times", "normal", "bold");
- fontInfo.addFontProperties("F8", "Times", "oblique", "bold");
- fontInfo.addFontProperties("F8", "Times", "italic", "bold");
- fontInfo.addFontProperties("F9", "Courier", "normal", "normal");
- fontInfo.addFontProperties("F10", "Courier", "oblique", "normal");
- fontInfo.addFontProperties("F10", "Courier", "italic", "normal");
- fontInfo.addFontProperties("F11", "Courier", "normal", "bold");
- fontInfo.addFontProperties("F12", "Courier", "oblique", "bold");
- fontInfo.addFontProperties("F12", "Courier", "italic", "bold");
- fontInfo.addFontProperties("F13", "Symbol", "normal", "normal");
- fontInfo.addFontProperties("F14", "ZapfDingbats", "normal", "normal");
+ fontInfo.addFontProperties("F5", "any", "normal", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F6", "any", "italic", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F6", "any", "oblique", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F7", "any", "normal", FontInfo.BOLD);
+ fontInfo.addFontProperties("F8", "any", "italic", FontInfo.BOLD);
+ fontInfo.addFontProperties("F8", "any", "oblique", FontInfo.BOLD);
+
+ fontInfo.addFontProperties("F1", "sans-serif", "normal", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F2", "sans-serif", "oblique", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F2", "sans-serif", "italic", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F3", "sans-serif", "normal", FontInfo.BOLD);
+ fontInfo.addFontProperties("F4", "sans-serif", "oblique", FontInfo.BOLD);
+ fontInfo.addFontProperties("F4", "sans-serif", "italic", FontInfo.BOLD);
+ fontInfo.addFontProperties("F5", "serif", "normal", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F6", "serif", "oblique", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F6", "serif", "italic", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F7", "serif", "normal", FontInfo.BOLD);
+ fontInfo.addFontProperties("F8", "serif", "oblique", FontInfo.BOLD);
+ fontInfo.addFontProperties("F8", "serif", "italic", FontInfo.BOLD);
+ fontInfo.addFontProperties("F9", "monospace", "normal", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F10", "monospace", "oblique", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F10", "monospace", "italic", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F11", "monospace", "normal", FontInfo.BOLD);
+ fontInfo.addFontProperties("F12", "monospace", "oblique", FontInfo.BOLD);
+ fontInfo.addFontProperties("F12", "monospace", "italic", FontInfo.BOLD);
+
+ fontInfo.addFontProperties("F1", "Helvetica", "normal", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F2", "Helvetica", "oblique", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F2", "Helvetica", "italic", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F3", "Helvetica", "normal", FontInfo.BOLD);
+ fontInfo.addFontProperties("F4", "Helvetica", "oblique", FontInfo.BOLD);
+ fontInfo.addFontProperties("F4", "Helvetica", "italic", FontInfo.BOLD);
+ fontInfo.addFontProperties("F5", "Times", "normal", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F6", "Times", "oblique", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F6", "Times", "italic", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F7", "Times", "normal", FontInfo.BOLD);
+ fontInfo.addFontProperties("F8", "Times", "oblique", FontInfo.BOLD);
+ fontInfo.addFontProperties("F8", "Times", "italic", FontInfo.BOLD);
+ fontInfo.addFontProperties("F9", "Courier", "normal", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F10", "Courier", "oblique", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F10", "Courier", "italic", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F11", "Courier", "normal", FontInfo.BOLD);
+ fontInfo.addFontProperties("F12", "Courier", "oblique", FontInfo.BOLD);
+ fontInfo.addFontProperties("F12", "Courier", "italic", FontInfo.BOLD);
+ fontInfo.addFontProperties("F13", "Symbol", "normal", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F14", "ZapfDingbats", "normal", FontInfo.NORMAL);
// Custom type 1 fonts step 2/2
- // fontInfo.addFontProperties("F15", "OMEP", "normal", "normal");
- // fontInfo.addFontProperties("F16", "Garamond-LightCondensed", "normal", "normal");
- // fontInfo.addFontProperties("F17", "BauerBodoni", "italic", "bold");
+ // fontInfo.addFontProperties("F15", "OMEP", "normal", FontInfo.NORMAL);
+ // fontInfo.addFontProperties("F16", "Garamond-LightCondensed", "normal", FontInfo.NORMAL);
+ // fontInfo.addFontProperties("F17", "BauerBodoni", "italic", FontInfo.BOLD);
/* for compatibility with PassiveTex */
- fontInfo.addFontProperties("F5", "Times-Roman", "normal", "normal");
- fontInfo.addFontProperties("F6", "Times-Roman", "oblique", "normal");
- fontInfo.addFontProperties("F6", "Times-Roman", "italic", "normal");
- fontInfo.addFontProperties("F7", "Times-Roman", "normal", "bold");
- fontInfo.addFontProperties("F8", "Times-Roman", "oblique", "bold");
- fontInfo.addFontProperties("F8", "Times-Roman", "italic", "bold");
- fontInfo.addFontProperties("F5", "Times Roman", "normal", "normal");
- fontInfo.addFontProperties("F6", "Times Roman", "oblique", "normal");
- fontInfo.addFontProperties("F6", "Times Roman", "italic", "normal");
- fontInfo.addFontProperties("F7", "Times Roman", "normal", "bold");
- fontInfo.addFontProperties("F8", "Times Roman", "oblique", "bold");
- fontInfo.addFontProperties("F8", "Times Roman", "italic", "bold");
+ fontInfo.addFontProperties("F5", "Times-Roman", "normal", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F6", "Times-Roman", "oblique", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F6", "Times-Roman", "italic", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F7", "Times-Roman", "normal", FontInfo.BOLD);
+ fontInfo.addFontProperties("F8", "Times-Roman", "oblique", FontInfo.BOLD);
+ fontInfo.addFontProperties("F8", "Times-Roman", "italic", FontInfo.BOLD);
+ fontInfo.addFontProperties("F5", "Times Roman", "normal", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F6", "Times Roman", "oblique", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F6", "Times Roman", "italic", FontInfo.NORMAL);
+ fontInfo.addFontProperties("F7", "Times Roman", "normal", FontInfo.BOLD);
+ fontInfo.addFontProperties("F8", "Times Roman", "oblique", FontInfo.BOLD);
+ fontInfo.addFontProperties("F8", "Times Roman", "italic", FontInfo.BOLD);
fontInfo.addFontProperties("F9", "Computer-Modern-Typewriter",
- "normal", "normal");
+ "normal", FontInfo.NORMAL);
/* Add configured fonts */
addConfiguredFonts(fontInfo, 15);
@@ -169,10 +169,19 @@ public class FontSetup {
for (int c = 0; c < triplets.size(); c++) {
FontTriplet triplet = (FontTriplet)triplets.get(c);
+ int weight = 400;
+ try {
+ weight = Integer.parseInt(triplet.getWeight());
+ weight = ((int)weight/100) * 100;
+ if(weight < 100) weight = 100;
+ if(weight > 900) weight = 900;
+ } catch(NumberFormatException nfe) {
+
+ }
fontInfo.addFontProperties(internalName,
triplet.getName(),
triplet.getStyle(),
- triplet.getWeight());
+ weight);
}
}
} catch (Exception ex) {
diff --git a/src/org/apache/fop/render/pdf/PDFRenderer.java b/src/org/apache/fop/render/pdf/PDFRenderer.java
index bb62565ae..ac493e142 100644
--- a/src/org/apache/fop/render/pdf/PDFRenderer.java
+++ b/src/org/apache/fop/render/pdf/PDFRenderer.java
@@ -25,6 +25,8 @@ import org.apache.fop.area.*;
import org.apache.fop.area.inline.*;
import org.apache.fop.area.inline.Character;
import org.apache.fop.layout.FontState;
+import org.apache.fop.layout.FontInfo;
+import org.apache.fop.layout.FontMetric;
import org.w3c.dom.Document;
@@ -224,6 +226,7 @@ public class PDFRenderer extends PrintRenderer {
currentStream.add("1 0 0 -1 0 " +
(int) Math.round(pageHeight / 1000) + " cm\n");
//currentStream.add("BT\n");
+ currentFontName = "";
Page p = page.getPage();
renderPageAreas(p);
@@ -274,14 +277,11 @@ public class PDFRenderer extends PrintRenderer {
public void renderWord(Word word) {
StringBuffer pdf = new StringBuffer();
- FontState fs = null;
-
- fs = (FontState)word.getTrait(Trait.FONT_STATE);
- String name = fs.getFontName();
- int size = fs.getFontSize();
+ String name = (String)word.getTrait(Trait.FONT_NAME);
+ int size = ((Integer)word.getTrait(Trait.FONT_SIZE)).intValue();
// This assumes that *all* CIDFonts use a /ToUnicode mapping
- Font f = (Font)fs.getFontInfo().getFonts().get(name);
+ Font f = (Font)fontInfo.getFonts().get(name);
boolean useMultiByte = f.isMultiByte();
// String startText = useMultiByte ? "<FEFF" : "(";
@@ -330,6 +330,8 @@ public class PDFRenderer extends PrintRenderer {
String s = word.getWord();
+ FontMetric metrics = fontInfo.getMetricsFor(name);
+ FontState fs = new FontState(name, metrics, size);
escapeText(s, fs, useMultiByte, pdf);
pdf.append(endText);
@@ -566,15 +568,7 @@ public class PDFRenderer extends PrintRenderer {
context.setProperty(PDFXMLHandler.PDF_STREAM, currentStream);
context.setProperty(PDFXMLHandler.PDF_XPOS, new Integer(currentBlockIPPosition + (int)pos.getX()));
context.setProperty(PDFXMLHandler.PDF_YPOS, new Integer(currentBPPosition + (int)pos.getY()));
- FontState fs = null;
- try {
- fs = new FontState(fontInfo, "Helvetica", "",
- "", 12 * 1000, 0);
- } catch (org.apache.fop.apps.FOPException fope) {
- fope.printStackTrace();
- }
-
- context.setProperty(PDFXMLHandler.PDF_FONT_STATE, fs);
+ context.setProperty(PDFXMLHandler.PDF_FONT_INFO, fontInfo);
context.setProperty(PDFXMLHandler.PDF_FONT_NAME, currentFontName);
context.setProperty(PDFXMLHandler.PDF_FONT_SIZE, new Integer(currentFontSize));
context.setProperty(PDFXMLHandler.PDF_WIDTH, new Integer((int)pos.getWidth()));
diff --git a/src/org/apache/fop/render/pdf/PDFXMLHandler.java b/src/org/apache/fop/render/pdf/PDFXMLHandler.java
index f0a524788..b91baa660 100644
--- a/src/org/apache/fop/render/pdf/PDFXMLHandler.java
+++ b/src/org/apache/fop/render/pdf/PDFXMLHandler.java
@@ -13,7 +13,7 @@ import org.apache.fop.render.RendererContext;
import org.apache.fop.pdf.*;
import org.apache.fop.svg.*;
import org.apache.fop.svg.SVGUserAgent;
-import org.apache.fop.layout.FontState;
+import org.apache.fop.layout.FontInfo;
import org.apache.batik.dom.util.DOMUtilities;
@@ -50,7 +50,7 @@ public static final String PDF_PAGE = "pdfPage";
public static final String PDF_STREAM = "pdfStream";
public static final String PDF_WIDTH = "width";
public static final String PDF_HEIGHT = "height";
-public static final String PDF_FONT_STATE = "fontState";
+public static final String PDF_FONT_INFO = "fontInfo";
public static final String PDF_FONT_NAME = "fontName";
public static final String PDF_FONT_SIZE = "fontSize";
public static final String PDF_XPOS = "xpos";
@@ -80,7 +80,7 @@ public static final String PDF_YPOS = "ypos";
pdfi.currentStream = (PDFStream)context.getProperty(PDF_STREAM);
pdfi.width = ((Integer)context.getProperty(PDF_WIDTH)).intValue();
pdfi.height = ((Integer)context.getProperty(PDF_HEIGHT)).intValue();
- pdfi.fs = (FontState)context.getProperty(PDF_FONT_STATE);
+ pdfi.fi = (FontInfo)context.getProperty(PDF_FONT_INFO);
pdfi.currentFontName = (String)context.getProperty(PDF_FONT_NAME);
pdfi.currentFontSize = ((Integer)context.getProperty(PDF_FONT_SIZE)).intValue();
pdfi.currentXPosition = ((Integer)context.getProperty(PDF_XPOS)).intValue();
@@ -96,7 +96,7 @@ public static final String PDF_YPOS = "ypos";
public PDFStream currentStream;
int width;
int height;
- FontState fs;
+ FontInfo fi;
String currentFontName;
int currentFontSize;
int currentXPosition;
@@ -117,7 +117,7 @@ public static final String PDF_YPOS = "ypos";
GVTBuilder builder = new GVTBuilder();
BridgeContext ctx = new BridgeContext(ua);
- PDFTextElementBridge tBridge = new PDFTextElementBridge(pdfInfo.fs);
+ PDFTextElementBridge tBridge = new PDFTextElementBridge(pdfInfo.fi);
ctx.putBridge(tBridge);
PDFAElementBridge aBridge = new PDFAElementBridge();
@@ -170,7 +170,7 @@ public static final String PDF_YPOS = "ypos";
+ PDFNumber.doubleOut(vals[5]) + " cm\n");
}
- PDFGraphics2D graphics = new PDFGraphics2D(true, pdfInfo.fs, pdfInfo.pdfDoc,
+ PDFGraphics2D graphics = new PDFGraphics2D(true, pdfInfo.fi, pdfInfo.pdfDoc,
pdfInfo.pdfPage, pdfInfo.pdfPage.referencePDF(), pdfInfo.currentFontName,
pdfInfo.currentFontSize,
pdfInfo.currentXPosition,
diff --git a/src/org/apache/fop/tools/AreaTreeBuilder.java b/src/org/apache/fop/tools/AreaTreeBuilder.java
index cb5eb4a20..afd212c24 100644
--- a/src/org/apache/fop/tools/AreaTreeBuilder.java
+++ b/src/org/apache/fop/tools/AreaTreeBuilder.java
@@ -18,6 +18,7 @@ import org.apache.fop.render.svg.*;
import org.apache.fop.render.xml.*;
import org.apache.fop.layout.FontInfo;
import org.apache.fop.layout.FontState;
+import org.apache.fop.layout.FontMetric;
import org.apache.fop.fo.FOUserAgent;
import org.apache.avalon.framework.logger.ConsoleLogger;
@@ -462,13 +463,10 @@ class TreeLoader {
Character ch =
new Character(getString((Element) obj).charAt(0));
addTraits((Element) obj, ch);
- try {
- currentFontState =
- new FontState(fontInfo, "sans-serif", "normal",
- "normal", 12000, 0);
- } catch (FOPException e) {
- e.printStackTrace();
- }
+ String fname = fontInfo.fontLookup("sans-serif", "normal", FontInfo.NORMAL);
+ FontMetric metrics = fontInfo.getMetricsFor(fname);
+ currentFontState =
+ new FontState(fname, metrics, 12000);
ch.setWidth(currentFontState.width(ch.getChar()));
ch.setOffset(currentFontState.getCapHeight());
@@ -490,16 +488,15 @@ class TreeLoader {
list.add(leader);
}
} else if (obj.getNodeName().equals("word")) {
- try {
- currentFontState =
- new FontState(fontInfo, "sans-serif", "normal",
- "normal", 12000, 0);
- } catch (FOPException e) {
- e.printStackTrace();
- }
+ String fname = fontInfo.fontLookup("sans-serif", "normal", FontInfo.NORMAL);
+ FontMetric metrics = fontInfo.getMetricsFor(fname);
+ currentFontState =
+ new FontState(fname, metrics, 12000);
Word word = getWord((Element) obj);
- word.addTrait(Trait.FONT_STATE, currentFontState);
+ word.addTrait(Trait.FONT_NAME, fname);
+ word.addTrait(Trait.FONT_SIZE, new Integer(12000));
+
if (word != null) {
list.add(word);
}