Class TextStyleConverter


  • public class TextStyleConverter
    extends StyleWithPropertiesConverterHelper
    This class converts OpenDocument text styles to CSS2 styles. This includes conversion of text properties in other styles (paragraph, cell, graphic and presentation styles).
    • TODO: Support CJK and CTL
    • TODO: Support style:use-window-font-color ("automatic color")
    • TODO: Support style:font-charset (other encoding)
    • TODO: Support style:font-size-rel
    • TODO: Support text:display and text:condition
    • Constructor Detail

      • TextStyleConverter

        public TextStyleConverter​(OfficeReader ofr,
                                  XhtmlConfig config,
                                  Converter converter,
                                  int nType)
        Create a new TextStyleConverter
        Parameters:
        ofr - an OfficeReader to read style information from
        config - the configuration to use
        converter - the main Converter class
        nType - the type of XHTML to use
    • Method Detail

      • applyAnchorStyle

        public void applyAnchorStyle​(java.lang.String sStyleName,
                                     java.lang.String sVisitedStyleName,
                                     StyleInfo info)
        Apply a link style, using a combination of two text styles
        Parameters:
        sStyleName - name of the OpenDocument style
        sVisitedStyleName - name of the OpenDocument style for visited links
        info - the StyleInfo object to add information to
      • getStyleDeclarations

        public java.lang.String getStyleDeclarations​(java.lang.String sIndent)

        Convert style information for used styles

        Overrides:
        getStyleDeclarations in class StyleWithPropertiesConverterHelper
        Parameters:
        sIndent - a String of spaces to add before each line
      • applyProperties

        public void applyProperties​(StyleWithProperties style,
                                    CSVList props,
                                    boolean bInherit)
        Convert formatting properties for a specific text style.
        Specified by:
        applyProperties in class StyleWithPropertiesConverterHelper
        Parameters:
        style - the style to convert
        props - the CSVList object to add information to
        bInherit - true if properties should be inherited from parent style(s)