Package writer2latex.latex.i18n
Class ClassicI18n
- java.lang.Object
-
- writer2latex.latex.i18n.I18n
-
- writer2latex.latex.i18n.ClassicI18n
-
public class ClassicI18n extends I18n
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
-
-
Field Summary
Fields Modifier and Type Field Description static int
ASCII
static int
CP1250
static int
CP1251
static int
ISO_8859_7
static int
KOI8_R
static int
LATIN1
static int
LATIN2
static int
UTF8
-
Fields inherited from class writer2latex.latex.i18n.I18n
bAlwaysUseDefaultLang, bGreekMath, config, languages, ofr, sDefaultCountry, sDefaultCTLCountry, sDefaultCTLLanguage, sDefaultLanguage, stringReplace
-
-
Constructor Summary
Constructors Constructor Description ClassicI18n(LaTeXConfig config)
Construct a new I18n for general useClassicI18n(OfficeReader ofr, LaTeXConfig config, ConverterPalette palette)
Construct a new ClassicI18n as ConverterHelper
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendDeclarations(LaTeXDocumentPortion pack, LaTeXDocumentPortion decl)
Add declarations to the preamble to load the required packagesvoid
applyLanguage(StyleWithProperties style, boolean bDecl, boolean bInherit, BeforeAfter ba)
Apply a language languagejava.lang.String
convert(java.lang.String s, boolean bMathMode, java.lang.String sLang)
Convert a string of characters into LaTeXint
getCharCount()
Get the number of characters defined in the current table (for informational purposes only)void
popSpecialTable()
Pop a font from the font stackvoid
pushSpecialTable(java.lang.String sName)
Push a font to the font stackstatic int
readFontencs(java.lang.String sFontencs)
static int
readInputenc(java.lang.String sInputenc)
static java.lang.String
writeInputenc(int nInputenc)
static java.lang.String
writeJavaEncoding(int nInputenc)
-
Methods inherited from class writer2latex.latex.i18n.I18n
getDefaultCountry, getDefaultLanguage
-
-
-
-
Field Detail
-
ASCII
public static final int ASCII
- See Also:
- Constant Field Values
-
LATIN1
public static final int LATIN1
- See Also:
- Constant Field Values
-
LATIN2
public static final int LATIN2
- See Also:
- Constant Field Values
-
ISO_8859_7
public static final int ISO_8859_7
- See Also:
- Constant Field Values
-
CP1250
public static final int CP1250
- See Also:
- Constant Field Values
-
CP1251
public static final int CP1251
- See Also:
- Constant Field Values
-
KOI8_R
public static final int KOI8_R
- See Also:
- Constant Field Values
-
UTF8
public static final int UTF8
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ClassicI18n
public ClassicI18n(OfficeReader ofr, LaTeXConfig config, ConverterPalette palette)
Construct a new ClassicI18n as ConverterHelper- Parameters:
ofr
- the OfficeReader to get language information fromconfig
- the configuration which determines the symbols to usepalette
- the ConverterPalette (unused)
-
ClassicI18n
public ClassicI18n(LaTeXConfig config)
Construct a new I18n for general use- Parameters:
config
- the configuration which determines the symbols to use
-
-
Method Detail
-
readInputenc
public static final int readInputenc(java.lang.String sInputenc)
-
writeInputenc
public static final java.lang.String writeInputenc(int nInputenc)
-
writeJavaEncoding
public static final java.lang.String writeJavaEncoding(int nInputenc)
-
readFontencs
public static final int readFontencs(java.lang.String sFontencs)
-
appendDeclarations
public void appendDeclarations(LaTeXDocumentPortion pack, LaTeXDocumentPortion decl)
Add declarations to the preamble to load the required packages- Specified by:
appendDeclarations
in classI18n
- Parameters:
pack
- usepackage declarationsdecl
- other declarations
-
applyLanguage
public void applyLanguage(StyleWithProperties style, boolean bDecl, boolean bInherit, BeforeAfter ba)
Apply a language language- Specified by:
applyLanguage
in classI18n
- Parameters:
style
- the OOo style to read attributes frombDecl
- true if declaration form is requiredbInherit
- true if inherited properties should be usedba
- theBeforeAfter
to add LaTeX code to.
-
pushSpecialTable
public void pushSpecialTable(java.lang.String sName)
Push a font to the font stack- Specified by:
pushSpecialTable
in classI18n
- Parameters:
sName
- the name of the font
-
popSpecialTable
public void popSpecialTable()
Pop a font from the font stack- Specified by:
popSpecialTable
in classI18n
-
getCharCount
public int getCharCount()
Get the number of characters defined in the current table (for informational purposes only)- Returns:
- the number of characters
-
convert
public java.lang.String convert(java.lang.String s, boolean bMathMode, java.lang.String sLang)
Convert a string of characters into LaTeX
-
-