aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/java/org/apache/fop/render/rtf/TextAttributesConverter.java15
-rw-r--r--src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java4
2 files changed, 17 insertions, 2 deletions
diff --git a/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java b/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java
index 319059d4a..f0b8120ac 100644
--- a/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java
+++ b/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java
@@ -28,7 +28,6 @@ import org.apache.fop.fo.Constants;
import org.apache.fop.fo.FOText;
import org.apache.fop.fo.flow.Block;
import org.apache.fop.fo.flow.BlockContainer;
-import org.apache.fop.fo.flow.Character;
import org.apache.fop.fo.flow.Inline;
import org.apache.fop.fo.flow.PageNumber;
import org.apache.fop.fo.properties.ColorTypeProperty;
@@ -36,6 +35,7 @@ import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
import org.apache.fop.fo.properties.CommonFont;
import org.apache.fop.fo.properties.CommonTextDecoration;
import org.apache.fop.fo.properties.CommonMarginBlock;
+import org.apache.fop.fo.properties.EnumLength;
import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfAttributes;
import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfColorTable;
import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfFontManager;
@@ -97,6 +97,7 @@ class TextAttributesConverter {
attrFont(fobj.getCommonFont(), attrib);
attrFontColor(fobj.getColor(), attrib);
attrTextDecoration(fobj.getTextDecoration(), attrib);
+ attrBaseLineShift(fobj.getBaseLineShift(), attrib);
return attrib;
}
@@ -252,6 +253,17 @@ class TextAttributesConverter {
rtfAttr.set(RtfText.ATTR_BACKGROUND_COLOR, rtfColor);
}
+
+ private static void attrBaseLineShift(EnumLength baselineShift, RtfAttributes rtfAttr) {
+
+ String s = baselineShift.getString();
+
+ if (s=="SUPER") {
+ rtfAttr.set(RtfText.ATTR_SUPERSCRIPT);
+ } else if (s=="SUB") {
+ rtfAttr.set(RtfText.ATTR_SUBSCRIPT);
+ }
+ }
/**
* Converts a FOP ColorType to the integer pointing into the RTF color table
@@ -265,5 +277,4 @@ class TextAttributesConverter {
return RtfColorTable.getInstance().getColorNumber(redComponent,
greenComponent, blueComponent).intValue();
}
-
}
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java
index ae17d849f..9ef08f1e4 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java
@@ -70,6 +70,10 @@ public class RtfText extends RtfElement {
public static final String ATTR_FONT_COLOR = "cf";
/** constant for background color */
public static final String ATTR_BACKGROUND_COLOR = "chcbpat"; // Added by Boris on 06/25//02
+ /** constant for superscript */
+ public static final String ATTR_SUPERSCRIPT = "super";
+ /** constant for subscript */
+ public static final String ATTR_SUBSCRIPT = "sub";
/** RtfText attributes: alignment attributes */
/** constant for align center */