From: Peter Bernard West Date: Sat, 29 May 2004 18:56:11 +0000 (+0000) Subject: Removed fontData field. X-Git-Tag: Defoe_export~121 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2a6fc4aeefef0c8b7089ede51ef985b22a151479;p=xmlgraphics-fop.git Removed fontData field. Moved processText() to LineArea. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197657 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/fo/flow/FoPcdata.java b/src/java/org/apache/fop/fo/flow/FoPcdata.java index 72a1697b7..eda87fe4f 100644 --- a/src/java/org/apache/fop/fo/flow/FoPcdata.java +++ b/src/java/org/apache/fop/fo/flow/FoPcdata.java @@ -20,16 +20,8 @@ package org.apache.fop.fo.flow; // FOP -import java.awt.Font; -import java.awt.font.FontRenderContext; -import java.awt.font.TextAttribute; -import java.awt.font.TextLayout; -import java.awt.font.TextMeasurer; -import java.text.AttributedCharacterIterator; -import java.text.AttributedString; import java.util.Arrays; import java.util.BitSet; -import java.util.Map; import org.apache.fop.apps.FOPException; import org.apache.fop.datastructs.TreeException; @@ -39,9 +31,6 @@ import org.apache.fop.fo.FOTree; import org.apache.fop.fo.FObjectNames; import org.apache.fop.fo.PropNames; import org.apache.fop.fo.PropertySets; -import org.apache.fop.fo.expr.PropertyException; -import org.apache.fop.fonts.FontException; -import org.apache.fop.render.FontData; import org.apache.fop.xml.XmlEvent; /** @@ -120,10 +109,6 @@ public class FoPcdata extends FOPageSeqNode { } } - /** The #PCDATA characters. */ - private String characters; - private FontData fontData; - /** * Construct an FoPcdata object to contain the characters from a * character data node. There is no corresponding Flow Obect in the @@ -148,6 +133,9 @@ public class FoPcdata extends FOPageSeqNode { makeSparsePropsSet(); } + /** The #PCDATA characters. */ + private String characters; + /** * Get the String data of the node. * @return the string of characters. @@ -155,42 +143,4 @@ public class FoPcdata extends FOPageSeqNode { public String getCharacters() { return characters; } - - public static final boolean IS_ANTI_ALIASED = true; - public static final boolean USES_FRACTIONAL_METRICS = true; - // PCDATA provides sequences of inline-areas to fill line-areas in the - // parent block area. - // Generate a text-layout for the PCDATA. - /** - * Generates a TextMeasurer from the PCDATA text. The font and text - * attributes of the text are applied. - */ - private void processText() throws PropertyException, FontException { - // Get the font, size, style and weight attributes - Map attributes = getFontAttributes(); - Font font = getFopFont(attributes); - // Add the text decorations - // TODO separate color support for text decorations - if (decorations.underlined()) { - attributes.put(TextAttribute.UNDERLINE, - TextAttribute.UNDERLINE_LOW_ONE_PIXEL); - } - if (decorations.overlined()) { - // Not supported yet - } - if (decorations.struckthrough()) { - attributes.put(TextAttribute.STRIKETHROUGH, - TextAttribute.STRIKETHROUGH_ON); - } - AttributedString attText = - new AttributedString(characters, attributes); - AttributedCharacterIterator iter = attText.getIterator(); - FontRenderContext identityFRC = - new FontRenderContext( - null, IS_ANTI_ALIASED, USES_FRACTIONAL_METRICS); - TextMeasurer measurer = new TextMeasurer(iter, identityFRC); - TextLayout layout = new TextLayout(iter, identityFRC); - // Find minima and maxima for this text - } - }