writer2latex.latex.i18n
Class ClassicI18n
This class (and the helpers in the same package) takes care of i18n in
Writer2LaTeX. In classic LaTeX, i18n is a mixture of inputencodings, fontencodings
and babel languages. The class ClassicI18n thus manages these, and in particular
implements a Unicode->LaTeX translation that can handle different
inputencodings and fontencodings.
The translation is table driven, using symbols.xml (embedded in the jar)
Various sections of symbols.xml handles different cases:
- common symbols in various font encodings such as T1, T2A, LGR etc.
- input encodings such as ISO-8859-1 (latin-1), ISO-8859-7 (latin/greek) etc.
- additional symbol fonts such as wasysym, dingbats etc.
- font-specific symbols, eg. for 8-bit fonts/private use area
The class uses the packages inputenc, fontenc, babel, tipa, bbding,
ifsym, pifont, eurosym, amsmath, wasysym, amssymb, amsfonts and textcomp
in various combinations depending on the configuration.
ASCII
public static final int ASCII
CP1250
public static final int CP1250
CP1251
public static final int CP1251
ISO_8859_7
public static final int ISO_8859_7
KOI8_R
public static final int KOI8_R
LATIN1
public static final int LATIN1
LATIN2
public static final int LATIN2
UTF8
public static final int UTF8
ClassicI18n
public ClassicI18n(LaTeXConfig config)
Construct a new I18n for general use
config
- the configuration which determines the symbols to use
ClassicI18n
public ClassicI18n(OfficeReader ofr,
LaTeXConfig config,
ConverterPalette palette)
Construct a new ClassicI18n as ConverterHelper
ofr
- the OfficeReader to get language information fromconfig
- the configuration which determines the symbols to usepalette
- the ConverterPalette (unused)
applyLanguage
public void applyLanguage(StyleWithProperties style,
boolean bDecl,
boolean bInherit,
BeforeAfter ba)
Apply a language language
- applyLanguage in interface I18n
style
- the OOo style to read attributesfrombDecl
- true if declaration form is requiredbInherit
- true if inherited properties should be usedba
- the BeforeAfter
to add LaTeX code to.
convert
public String convert(String s,
boolean bMathMode,
String sLang)
Convert a string of characters into LaTeX
- convert in interface I18n
s
- the source stringbMathMode
- true if the string should be rendered in math modesLang
- the iso language of the string
getCharCount
public int getCharCount()
Get the number of characters defined in the current table
(for informational purposes only)
popSpecialTable
public void popSpecialTable()
Pop a font from the font stack
- popSpecialTable in interface I18n
pushSpecialTable
public void pushSpecialTable(String sName)
Push a font to the font stack
- pushSpecialTable in interface I18n
sName
- the name of the font
readFontencs
public static final int readFontencs(String sFontencs)
readInputenc
public static final int readInputenc(String sInputenc)
writeInputenc
public static final String writeInputenc(int nInputenc)
writeJavaEncoding
public static final String writeJavaEncoding(int nInputenc)