Package org.apache.fop.render.rtf
Class TextAttributesConverter
java.lang.Object
org.apache.fop.render.rtf.TextAttributesConverter
Converts FO properties to RtfAttributes.
This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch), Boris Poudérous (boris.pouderous@eads-telecom.com), Peter Herweg (pherweg@web.de), Normand Massé, Christopher Scott (scottc@westinghouse.com), and Roberto Marra (roberto@link-u.com).
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateConstructor is private, because it's just a utility class. -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidattrBackgroundColor(CommonBorderPaddingBackground bpb, RtfAttributes rtfAttr) Reads background-color from bl and writes it to rtfAttr.private static voidattrBaseLineShift(Length baselineShift, RtfAttributes rtfAttr) private static voidReads background-color for block frombpband writes it tortfAttr.private static voidattrBlockMargin(CommonMarginBlock cmb, FOPRtfAttributes rtfAttr) private static voidattrBlockTextAlign(int alignment, RtfAttributes rtfAttr) private static voidattrBlockTextIndent(Length textIndent, FOPRtfAttributes rtfAttr) private static voidattrBorder(CommonBorderPaddingBackground bpb, RtfAttributes rtfAttr, FONode fobj) Adds border information frombpbtortrAttr.private static voidattrBreak(Block fobj, FOPRtfAttributes attrib) private static voidattrFont(CommonFont font, FOPRtfAttributes rtfAttr) private static voidattrFontColor(Color colorType, RtfAttributes rtfAttr) private static voidattrInlineBorder(CommonBorderPaddingBackground bpb, RtfAttributes rtfAttr) Adds inline border information frombpbtortrAttr.private static voidattrTextDecoration(CommonTextDecoration textDecoration, RtfAttributes rtfAttr) static RtfAttributesconvertAttributes(Block fobj) Converts all known text FO properties to RtfAttributesstatic RtfAttributesConverts all known text FO properties to RtfAttributesstatic RtfAttributesConverts all character related FO properties to RtfAttributes.static RtfAttributesConverts all character related FO properties to RtfAttributes.static RtfAttributesConverts all character related FO properties to RtfAttributes.static intconvertFOPColorToRTF(Color fopColor) Converts a FOP ColorType to the integer pointing into the RTF color tablestatic RtfAttributesconvertLeaderAttributes(Leader fobj, PercentBaseContext context) Converts FO properties used by RtfLeader to RtfAttributes.private static intconvertMptToTwips(int mpt) private static boolean
-
Field Details
-
log
private static org.apache.commons.logging.Log log
-
-
Constructor Details
-
TextAttributesConverter
private TextAttributesConverter()Constructor is private, because it's just a utility class.
-
-
Method Details
-
convertAttributes
Converts all known text FO properties to RtfAttributes- Parameters:
fobj- the FO for which the attributes are to be converted- Throws:
FOPException
-
attrBreak
-
convertBlockContainerAttributes
public static RtfAttributes convertBlockContainerAttributes(BlockContainer fobj) throws FOPException Converts all known text FO properties to RtfAttributes- Parameters:
fobj- FObj whose properties are to be converted- Throws:
FOPException
-
convertCharacterAttributes
Converts all character related FO properties to RtfAttributes.- Parameters:
fobj- FObj whose properties are to be converted- Throws:
FOPException
-
convertCharacterAttributes
Converts all character related FO properties to RtfAttributes.- Parameters:
fobj- FObj whose properties are to be converted- Throws:
FOPException
-
convertCharacterAttributes
Converts all character related FO properties to RtfAttributes.- Parameters:
fobj- FObj whose properties are to be converted- Throws:
FOPException
-
convertLeaderAttributes
public static RtfAttributes convertLeaderAttributes(Leader fobj, PercentBaseContext context) throws FOPException Converts FO properties used by RtfLeader to RtfAttributes.- Parameters:
fobj- Leadercontext- PercentBaseContext- Returns:
- RtfAttributes
- Throws:
FOPException
-
convertMptToTwips
private static int convertMptToTwips(int mpt) -
attrFont
-
attrFontColor
-
attrTextDecoration
-
attrBlockMargin
-
attrBlockTextIndent
-
attrBlockTextAlign
-
attrBlockBackgroundColor
private static void attrBlockBackgroundColor(CommonBorderPaddingBackground bpb, RtfAttributes rtfAttr) Reads background-color for block frombpband writes it tortfAttr. -
attrBorder
private static void attrBorder(CommonBorderPaddingBackground bpb, RtfAttributes rtfAttr, FONode fobj) Adds border information frombpbtortrAttr. -
hasBorder
- Returns:
- true, if element
nodehas border.
-
attrInlineBorder
Adds inline border information frombpbtortrAttr. -
attrBackgroundColor
Reads background-color from bl and writes it to rtfAttr.- Parameters:
bpb- the CommonBorderPaddingBackground from which the properties are readrtfAttr- the RtfAttributes object the attributes are written to
-
attrBaseLineShift
-
convertFOPColorToRTF
Converts a FOP ColorType to the integer pointing into the RTF color table- Parameters:
fopColor- the ColorType object to be converted- Returns:
- integer pointing into the RTF color table
-