void serveVisitor(Viewport viewport);
/**
- * Handle a visitor request to process an inline word.
+ * Handle a visitor request to process inline text.
*
- * @param area The word area
+ * @param area The text area
*/
- void serveVisitor(Word area);
+ void serveVisitor(TextArea area);
/**
* Handle a visitor request to process an inline parent area.
--- /dev/null
+/*
+ * $Id$
+ * ============================================================================
+ * The Apache Software License, Version 1.1
+ * ============================================================================
+ *
+ * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modifica-
+ * tion, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if any, must
+ * include the following acknowledgment: "This product includes software
+ * developed by the Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself, if
+ * and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "FOP" and "Apache Software Foundation" must not be used to
+ * endorse or promote products derived from this software without prior
+ * written permission. For written permission, please contact
+ * apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache", nor may
+ * "Apache" appear in their name, without prior written permission of the
+ * Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
+ * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ============================================================================
+ *
+ * This software consists of voluntary contributions made by many individuals
+ * on behalf of the Apache Software Foundation and was originally created by
+ * James Tauber <jtauber@jtauber.com>. For more information on the Apache
+ * Software Foundation, please see <http://www.apache.org/>.
+ */
+package org.apache.fop.area.inline;
+
+/**
+ * A text inline area.
+ */
+public class TextArea extends InlineArea {
+
+ /**
+ * The text for this inline area
+ */
+ protected String text;
+ private int iTSadjust = 0;
+
+ /**
+ * Create a text inline area
+ */
+ public TextArea() {
+ }
+
+ /**
+ * Handle InlineAreaVisitor request by passing this back to it.
+ *
+ * @param visitor the InlineAreaVisitor wishing to process this.
+ * @see org.apache.fop.area.inline.InlineAreaVisitor
+ */
+ public void acceptVisitor(InlineAreaVisitor visitor) {
+ visitor.serveVisitor(this);
+ }
+
+ /**
+ * Set the text string
+ *
+ * @param t the text string
+ */
+ public void setTextArea(String t) {
+ text = t;
+ }
+
+ /**
+ * Get the text string.
+ *
+ * @return the text string
+ */
+ public String getTextArea() {
+ return text;
+ }
+
+ /**
+ * Get text space adjust.
+ *
+ * @return the text space adjustment
+ */
+ public int getTSadjust() {
+ return iTSadjust;
+ }
+
+ /**
+ * Set text space adjust.
+ *
+ * @param iTSadjust the text space adjustment
+ */
+ public void setTSadjust(int iTSadjust) {
+ this.iTSadjust = iTSadjust;
+ }
+}
+
* This is a word area that resolves itself to a page number
* from an id reference.
*/
-public class UnresolvedPageNumber extends Word implements Resolveable {
+public class UnresolvedPageNumber extends TextArea implements Resolveable {
private boolean resolved = false;
private String pageRefId;
*/
public UnresolvedPageNumber(String id) {
pageRefId = id;
- word = "?";
+ text = "?";
}
/**
if (pages != null) {
PageViewport page = (PageViewport)pages.get(0);
String str = page.getPageNumber();
- word = str;
+ text = str;
/**@todo Update IPD ??? */
}
+++ /dev/null
-/*
- * $Id: Word.java,v 1.10 2003/03/05 16:45:42 jeremias Exp $
- * ============================================================================
- * The Apache Software License, Version 1.1
- * ============================================================================
- *
- * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modifica-
- * tion, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. The end-user documentation included with the redistribution, if any, must
- * include the following acknowledgment: "This product includes software
- * developed by the Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself, if
- * and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "FOP" and "Apache Software Foundation" must not be used to
- * endorse or promote products derived from this software without prior
- * written permission. For written permission, please contact
- * apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache", nor may
- * "Apache" appear in their name, without prior written permission of the
- * Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
- * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * ============================================================================
- *
- * This software consists of voluntary contributions made by many individuals
- * on behalf of the Apache Software Foundation and was originally created by
- * James Tauber <jtauber@jtauber.com>. For more information on the Apache
- * Software Foundation, please see <http://www.apache.org/>.
- */
-package org.apache.fop.area.inline;
-
-/**
- * A word inline area.
- * This is really a collection character inline areas collected together
- * into a single word.
- */
-public class Word extends InlineArea {
- /**
- * The word for this word area.
- */
- protected String word;
- private int iWSadjust = 0;
-
- /**
- * Create a word area.
- */
- public Word() {
- }
-
- /**
- * Handle InlineAreaVisitor request by passing this back to it.
- *
- * @param visitor the InlineAreaVisitor wishing to process this.
- * @see org.apache.fop.area.inline.InlineAreaVisitor
- */
- public void acceptVisitor(InlineAreaVisitor visitor) {
- visitor.serveVisitor(this);
- }
-
- /**
- * Set the word.
- *
- * @param w the word string
- */
- public void setWord(String w) {
- word = w;
- }
-
- /**
- * Get the word string.
- *
- * @return the word string
- */
- public String getWord() {
- return word;
- }
-
- /**
- * Get word space adjust.
- *
- * @return the word space adjustment
- */
- public int getWSadjust() {
- return iWSadjust;
- }
-
- /**
- * Set word space adjust.
- *
- * @param iWSadjust the word space adjustment
- */
- public void setWSadjust(int iWSadjust) {
- this.iWSadjust = iWSadjust;
- }
-}
-
import org.apache.fop.area.inline.Space;
import org.apache.fop.area.inline.UnresolvedPageNumber;
import org.apache.fop.area.inline.Viewport;
-import org.apache.fop.area.inline.Word;
+import org.apache.fop.area.inline.TextArea;
import org.apache.fop.datatypes.Length;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FOText;
} else if (node.getLeaderPattern() == LeaderPattern.SPACE) {
leaderArea = new Space();
} else if (node.getLeaderPattern() == LeaderPattern.DOTS) {
- Word w = new Word();
+ TextArea t = new TextArea();
char dot = '.'; // userAgent.getLeaderDotCharacter();
- w.setWord("" + dot);
- w.addTrait(Trait.FONT_NAME, node.getFontState().getFontName());
- w.addTrait(Trait.FONT_SIZE,
+ t.setTextArea("" + dot);
+ t.addTrait(Trait.FONT_NAME, node.getFontState().getFontName());
+ t.addTrait(Trait.FONT_SIZE,
new Integer(node.getFontState().getFontSize()));
// set offset of dot within inline parent
- w.setOffset(node.getFontState().getAscender());
+ t.setOffset(node.getFontState().getAscender());
int width = node.getFontState().getCharWidth(dot);
Space spacer = null;
if (node.getPatternWidth() > width) {
}
FilledArea fa = new FilledArea();
fa.setUnitWidth(width);
- fa.addChild(w);
+ fa.addChild(t);
if (spacer != null) {
fa.addChild(spacer);
}
lm = new LeafNodeLayoutManager() {
public InlineArea get(LayoutContext context) {
// get page string from parent, build area
- Word inline = new Word();
+ TextArea inline = new TextArea();
String str = parentLM.getCurrentPageNumber();
int width = 0;
for (int count = 0; count < str.length(); count++) {
width += node.getFontState().getCharWidth(
str.charAt(count));
}
- inline.setWord(str);
+ inline.setTextArea(str);
inline.setIPD(width);
inline.setHeight(node.getFontState().getAscender()
- node.getFontState().getDescender());
if (page != null) {
String str = page.getPageNumber();
// get page string from parent, build area
- Word word = new Word();
- inline = word;
+ TextArea text = new TextArea();
+ inline = text;
int width = node.getStringWidth(str);
- word.setWord(str);
+ text.setTextArea(str);
inline.setIPD(width);
inline.setHeight(node.getFontState().getAscender()
- node.getFontState().getDescender());
import org.apache.fop.traits.SpaceVal;
import org.apache.fop.area.Trait;
import org.apache.fop.area.inline.InlineArea;
-import org.apache.fop.area.inline.Word;
+import org.apache.fop.area.inline.TextArea;
import org.apache.fop.area.inline.Space;
import org.apache.fop.util.CharUtilities;
import org.apache.fop.traits.MinOptMax;
public class TextLayoutManager extends AbstractLayoutManager {
/**
- * Store information about each potential word area.
+ * Store information about each potential text area.
* Index of character which ends the area, IPD of area, including
* any word-space and letter-space.
* Number of word-spaces?
word = new Space();
word.setWidth(ai.ipdArea.opt + iAdjust);
} else {
- Word w = createWord(
+ TextArea t = createText(
str,
ai.ipdArea.opt + iAdjust, context.getBaseline());
if (iWScount > 0) {
//getLogger().error("Adjustment per word-space= " +
// iAdjust / iWScount);
- w.setWSadjust(iAdjust / iWScount);
+ t.setTSadjust(iAdjust / iWScount);
}
- word = w;
+ word = t;
}
if ((chars[iStart] == SPACE || chars[iStart] == NBSPACE)
&& context.getLeadingSpace().hasSpaces()) {
* @param base the baseline position
* @return the new word area
*/
- protected Word createWord(String str, int width, int base) {
- Word curWordArea = new Word();
+ protected TextArea createText(String str, int width, int base) {
+ TextArea curWordArea = new TextArea();
curWordArea.setWidth(width);
curWordArea.setHeight(textInfo.fs.getAscender()
- textInfo.fs.getDescender());
curWordArea.setOffset(textInfo.fs.getAscender());
curWordArea.setOffset(base);
- curWordArea.setWord(str);
+ curWordArea.setTextArea(str);
curWordArea.addTrait(Trait.FONT_NAME, textInfo.fs.getFontName());
curWordArea.addTrait(Trait.FONT_SIZE,
new Integer(textInfo.fs.getFontSize()));
import org.apache.fop.area.inline.Leader;
import org.apache.fop.area.inline.Space;
import org.apache.fop.area.inline.Viewport;
-import org.apache.fop.area.inline.Word;
+import org.apache.fop.area.inline.TextArea;
import org.apache.fop.area.inline.Character;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.fo.FOTreeControl;
InlineArea inline = (InlineArea) children.get(count);
if (inline instanceof Character) {
sb.append(((Character) inline).getChar());
- } else if (inline instanceof Word) {
- sb.append(((Word) inline).getWord());
+ } else if (inline instanceof TextArea) {
+ sb.append(((TextArea) inline).getTextArea());
} else if (inline instanceof InlineParent) {
sb.append(convertToString(
((InlineParent) inline).getChildAreas()));
}
/** @see org.apache.fop.render.Renderer */
- public void renderWord(Word word) {
- currentBlockIPPosition += word.getWidth();
+ public void renderText(TextArea text) {
+ currentBlockIPPosition += text.getWidth();
}
/** @see org.apache.fop.render.Renderer */
}
/**
- * Render the specified Word.
+ * Render the specified Text.
* Required by InlineAreaVisitor interface, which is used to determine which
* InlineArea subclass should be rendered.
*
- * @param area The Word area to be rendered
+ * @param area The Text area to be rendered
* @see org.apache.fop.area.inline.InlineAreaVisitor
*/
- public void serveVisitor(Word area) {
- renderWord(area);
+ public void serveVisitor(TextArea area) {
+ renderText(area);
}
/**
import org.apache.fop.area.inline.Leader;
import org.apache.fop.area.inline.Space;
import org.apache.fop.area.inline.Viewport;
-import org.apache.fop.area.inline.Word;
+import org.apache.fop.area.inline.TextArea;
import org.apache.fop.fo.FOTreeControl;
import org.apache.fop.apps.FOUserAgent;
void renderContainer(Container cont);
/**
- * Tells the renderer to render an inline word.
+ * Tells the renderer to render an inline text area
*
- * @param area The word area
+ * @param area The text area
*/
- void renderWord(Word area);
+ void renderText(TextArea area);
/**
* Tells the renderer to render an inline parent area.
import org.apache.fop.area.PageViewport;
import org.apache.fop.area.RegionViewport;
import org.apache.fop.area.Trait;
-import org.apache.fop.area.inline.Word;
+import org.apache.fop.area.inline.TextArea;
import org.apache.fop.datatypes.ColorType;
import org.apache.fop.fo.FOTreeControl;
import org.apache.fop.fo.properties.BackgroundRepeat;
}
/**
- * @see org.apache.fop.render.Renderer#renderWord(Word)
+ * @see org.apache.fop.render.Renderer#renderText(Text)
*/
- public void renderWord(Word word) {
- System.out.println("In render word: " + word.getWord());
+ public void renderText(TextArea text) {
+ System.out.println("In render text: " + text.getTextArea());
Graphics2D graphics = currentPageImage.createGraphics();
- String fontName = (String) word.getTrait(Trait.FONT_NAME);
- int size = ((Integer) word.getTrait(Trait.FONT_SIZE)).intValue();
+ String fontName = (String) text.getTrait(Trait.FONT_NAME);
+ int size = ((Integer) text.getTrait(Trait.FONT_SIZE)).intValue();
// Typeface f = (Typeface) fontInfo.getFonts().get(fontName);
- ColorType ct = (ColorType) word.getTrait(Trait.COLOR);
+ ColorType ct = (ColorType) text.getTrait(Trait.COLOR);
FontMetricsMapper mapper = (FontMetricsMapper)
fontInfo.getMetricsFor(fontName);
10));
int rx = currentBlockIPPosition;
- int bl = currentBPPosition + word.getOffset();
+ int bl = currentBPPosition + text.getOffset();
int newx = (int) (rx + 500) / 1000;
int newy = (int) (pageHeight - (bl + 500) / 1000);
- String s = word.getWord();
+ String s = text.getTextArea();
// graphics.drawString(s, newx, newy);
graphics.drawString(s, 220, 200);
// TODO: render text decorations
- currentBlockIPPosition += word.getWidth();
+ currentBlockIPPosition += text.getWidth();
}
}
import org.apache.fop.area.TreeExt;
import org.apache.fop.area.extensions.BookmarkData;
import org.apache.fop.area.inline.Character;
-import org.apache.fop.area.inline.Word;
+import org.apache.fop.area.inline.TextArea;
import org.apache.fop.area.inline.Viewport;
import org.apache.fop.area.inline.ForeignObject;
import org.apache.fop.area.inline.Image;
}
/**
- * @see org.apache.fop.render.Renderer#renderWord(Word)
+ * @see org.apache.fop.render.Renderer#renderText(Text)
*/
- public void renderWord(Word word) {
+ public void renderText(TextArea text) {
StringBuffer pdf = new StringBuffer();
- String name = (String) word.getTrait(Trait.FONT_NAME);
- int size = ((Integer) word.getTrait(Trait.FONT_SIZE)).intValue();
+ String name = (String) text.getTrait(Trait.FONT_NAME);
+ int size = ((Integer) text.getTrait(Trait.FONT_SIZE)).intValue();
// This assumes that *all* CIDFonts use a /ToUnicode mapping
Typeface f = (Typeface) fontInfo.getFonts().get(name);
String endText = useMultiByte ? "> " : ") ";
updateFont(name, size, pdf);
- ColorType ct = (ColorType)word.getTrait(Trait.COLOR);
+ ColorType ct = (ColorType) text.getTrait(Trait.COLOR);
if (ct != null) {
updateColor(ct, true, pdf);
}
// currentBlockIPPosition: 0 for beginning of line; nonzero
// where previous line area failed to take up entire allocated space
int rx = currentBlockIPPosition + IPMarginOffset;
- int bl = currentBPPosition + BPMarginOffset + word.getOffset();
+ int bl = currentBPPosition + BPMarginOffset + text.getOffset();
/* System.out.println("BlockIP Position: " + currentBlockIPPosition +
"; currentBPPosition: " + currentBPPosition +
- "; offset: " + word.getOffset() +
- "; Word = " + word.getWord()); */
+ "; offset: " + text.getOffset() +
+ "; Text = " + text.getTextArea()); */
// Set letterSpacing
//float ls = fs.getLetterSpacing() / this.currentFontSize;
pdf.append(startText);
}
}
- prevWordWidth = word.getWidth();
+ prevWordWidth = text.getWidth();
prevWordX = rx;
- String s = word.getWord();
+ String s = text.getTextArea();
FontMetrics metrics = fontInfo.getMetricsFor(name);
Font fs = new Font(name, metrics, size);
currentStream.add(pdf.toString());
- super.renderWord(word);
+ super.renderText(text);
}
/**
import org.apache.fop.area.PageViewport;
import org.apache.fop.area.Trait;
import org.apache.fop.area.inline.ForeignObject;
-import org.apache.fop.area.inline.Word;
+import org.apache.fop.area.inline.TextArea;
import org.apache.fop.datatypes.ColorType;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.fonts.Typeface;
}
/**
- * @see org.apache.fop.render.Renderer#renderWord(Word)
+ * @see org.apache.fop.render.Renderer#renderText(Text)
*/
- public void renderWord(Word area) {
+ public void renderText(TextArea area) {
String fontname = (String)area.getTrait(Trait.FONT_NAME);
int fontsize = area.getTraitAsInteger(Trait.FONT_SIZE);
useFont(fontname, fontsize);
- paintText(rx, bl, area.getWord(), f);
+ paintText(rx, bl, area.getTextArea(), f);
/*
String psString = null;
write("OLE");
this.currentXPosition += area.getContentWidth();
*/
- super.renderWord(area); //Updates IPD
+ super.renderText(area); //Updates IPD
}
import org.apache.fop.area.Title;
import org.apache.fop.area.inline.ForeignObject;
import org.apache.fop.area.inline.Leader;
-import org.apache.fop.area.inline.Word;
+import org.apache.fop.area.inline.TextArea;
import org.apache.fop.svg.SVGUtilities;
import org.apache.fop.apps.Document;
import org.apache.fop.apps.FOUserAgent;
import org.w3c.dom.svg.SVGDocument;
/* org.w3c.dom.Document is not imported to avoid conflict with
org.apache.fop.control.Document */
-import org.w3c.dom.Element;
import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Element;
import org.w3c.dom.Text;
-
import org.apache.batik.dom.svg.SVGDOMImplementation;
import org.apache.batik.dom.util.XMLSupport;
import org.apache.batik.transcoder.svg2svg.SVGTranscoder;
}
/**
- * @see org.apache.fop.render.Renderer#renderWord(Word)
+ * @see org.apache.fop.render.Renderer#renderText(Text)
*/
- public void renderWord(Word word) {
- Element text = SVGUtilities.createText(svgDocument,
+ public void renderText(TextArea text) {
+ Element textElement = SVGUtilities.createText(svgDocument,
currentBlockIPPosition / 1000,
- (currentBPPosition + word.getOffset()) / 1000,
- word.getWord());
- currentPageG.appendChild(text);
+ (currentBPPosition + text.getOffset()) / 1000,
+ text.getTextArea());
+ currentPageG.appendChild(textElement);
- super.renderWord(word);
+ super.renderText(text);
}
/**
import org.apache.fop.area.inline.Leader;
import org.apache.fop.area.inline.Space;
import org.apache.fop.area.inline.Viewport;
-import org.apache.fop.area.inline.Word;
+import org.apache.fop.area.inline.TextArea;
import org.apache.fop.fo.properties.RuleStyle;
import org.apache.fop.fo.FOTreeControl;
import org.apache.fop.fo.pagination.Region;
}
/**
- * @see org.apache.fop.render.Renderer#renderWord(Word)
+ * @see org.apache.fop.render.Renderer#renderText(Text)
*/
- public void renderWord(Word word) {
+ public void renderText(TextArea text) {
String prop = "";
- Map map = word.getTraits();
+ Map map = text.getTraits();
if (map != null) {
prop = " props=\"" + getPropString(map) + "\"";
}
- writeElement("<word wsadjust=\"" + word.getWSadjust() + "\""
- + prop + ">" + word.getWord() + "</word>");
- super.renderWord(word);
+ writeElement("<text tsadjust=\"" + text.getTSadjust() + "\""
+ + prop + ">" + text.getTextArea() + "</text>");
+ super.renderText(text);
}
/**
import org.apache.fop.area.inline.Leader;
import org.apache.fop.area.inline.Space;
import org.apache.fop.area.inline.Viewport;
-import org.apache.fop.area.inline.Word;
+import org.apache.fop.area.inline.TextArea;
import org.apache.fop.apps.Document;
import org.apache.fop.fonts.Font;
import org.apache.fop.render.Renderer;
FontMetrics metrics = fontInfo.getMetricsFor(fname);
currentFontState =
new Font(fname, metrics, 12000);
- Word word = getWord((Element) obj);
+ TextArea text = getText((Element) obj);
- word.addTrait(Trait.FONT_NAME, fname);
- word.addTrait(Trait.FONT_SIZE, new Integer(12000));
+ text.addTrait(Trait.FONT_NAME, fname);
+ text.addTrait(Trait.FONT_SIZE, new Integer(12000));
- if (word != null) {
- list.add(word);
+ if (text != null) {
+ list.add(text);
}
} else {
}
return leader;
}
- Word getWord(Element root) {
+ TextArea getText(Element root) {
String str = getString(root);
- Word word = new Word();
- word.setWord(str);
- addTraits(root, word);
+ TextArea text = new TextArea();
+ text.setTextArea(str);
+ addTraits(root, text);
int width = 0;
for (int count = 0; count < str.length(); count++) {
width += currentFontState.getWidth(str.charAt(count));
}
- word.setWidth(width);
- word.setOffset(currentFontState.getCapHeight());
+ text.setWidth(width);
+ text.setOffset(currentFontState.getCapHeight());
- return word;
+ return text;
}