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;
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;
/**
}
}
- /** 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
makeSparsePropsSet();
}
+ /** The #PCDATA characters. */
+ private String characters;
+
/**
* Get the <tt>String</tt> data of the node.
* @return the string of characters.
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
- }
-
}