Package writer2latex.xhtml
Class TextStyleConverter
- java.lang.Object
-
- writer2latex.xhtml.ConverterHelper
-
- writer2latex.xhtml.StyleConverterHelper
-
- writer2latex.xhtml.StyleWithPropertiesConverterHelper
-
- writer2latex.xhtml.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
-
-
Field Summary
-
Fields inherited from class writer2latex.xhtml.StyleConverterHelper
bConvertHard, bConvertStyles, nType, styleMap, styleNames
-
Fields inherited from class writer2latex.xhtml.ConverterHelper
config, converter, ofr
-
-
Constructor Summary
Constructors Constructor Description TextStyleConverter(OfficeReader ofr, XhtmlConfig config, Converter converter, int nType)
Create a newTextStyleConverter
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applyAnchorStyle(java.lang.String sStyleName, java.lang.String sVisitedStyleName, StyleInfo info)
Apply a link style, using a combination of two text stylesvoid
applyProperties(StyleWithProperties style, CSVList props, boolean bInherit)
Convert formatting properties for a specific text style.void
cssText(StyleWithProperties style, CSVList props, boolean bInherit)
void
cssTextBackground(StyleWithProperties style, CSVList props, boolean bInherit)
void
cssTextCommon(StyleWithProperties style, CSVList props, boolean bInherit)
java.lang.String
getDefaultTagName(StyleWithProperties style)
Create default tag name to represent a textjava.lang.String
getStyleDeclarations(java.lang.String sIndent)
Convert style information for used stylesOfficeStyleFamily
getStyles()
Get the family of text (character) stylesboolean
isBold(StyleWithProperties style)
boolean
isFixed(StyleWithProperties style)
boolean
isItalics(StyleWithProperties style)
boolean
isSubscript(StyleWithProperties style)
boolean
isSuperscript(StyleWithProperties style)
-
Methods inherited from class writer2latex.xhtml.StyleWithPropertiesConverterHelper
applyStyle, getClassNamePrefix
-
Methods inherited from class writer2latex.xhtml.StyleConverterHelper
applyDirection, applyLang, colScale, scale
-
Methods inherited from class writer2latex.xhtml.ConverterHelper
applyStyle, getCellSc, getDrawCv, getFrameSc, getListSc, getMathCv, getPageSc, getParSc, getPresentationSc, getRowSc, getSectionSc, getStyleCv, getTableCv, getTableSc, getTextCv, getTextSc
-
-
-
-
Constructor Detail
-
TextStyleConverter
public TextStyleConverter(OfficeReader ofr, XhtmlConfig config, Converter converter, int nType)
Create a newTextStyleConverter
- Parameters:
ofr
- anOfficeReader
to read style information fromconfig
- the configuration to useconverter
- the mainConverter
classnType
- 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 stylesVisitedStyleName
- name of the OpenDocument style for visited linksinfo
- theStyleInfo
object to add information to
-
getStyleDeclarations
public java.lang.String getStyleDeclarations(java.lang.String sIndent)
Convert style information for used styles
- Overrides:
getStyleDeclarations
in classStyleWithPropertiesConverterHelper
- Parameters:
sIndent
- a String of spaces to add before each line
-
getStyles
public OfficeStyleFamily getStyles()
Get the family of text (character) styles- Specified by:
getStyles
in classStyleConverterHelper
- Returns:
- the style family
-
getDefaultTagName
public java.lang.String getDefaultTagName(StyleWithProperties style)
Create default tag name to represent a text- Specified by:
getDefaultTagName
in classStyleWithPropertiesConverterHelper
- Parameters:
style
- to use- Returns:
- the tag name.
-
applyProperties
public void applyProperties(StyleWithProperties style, CSVList props, boolean bInherit)
Convert formatting properties for a specific text style.- Specified by:
applyProperties
in classStyleWithPropertiesConverterHelper
- Parameters:
style
- the style to convertprops
- theCSVList
object to add information tobInherit
- true if properties should be inherited from parent style(s)
-
isBold
public boolean isBold(StyleWithProperties style)
-
isItalics
public boolean isItalics(StyleWithProperties style)
-
isFixed
public boolean isFixed(StyleWithProperties style)
-
isSuperscript
public boolean isSuperscript(StyleWithProperties style)
-
isSubscript
public boolean isSubscript(StyleWithProperties style)
-
cssText
public void cssText(StyleWithProperties style, CSVList props, boolean bInherit)
-
cssTextCommon
public void cssTextCommon(StyleWithProperties style, CSVList props, boolean bInherit)
-
cssTextBackground
public void cssTextBackground(StyleWithProperties style, CSVList props, boolean bInherit)
-
-