Package org.scilab.forge.jlatexmath
Class DefaultTeXFont
- java.lang.Object
-
- org.scilab.forge.jlatexmath.DefaultTeXFont
-
-
Field Summary
Fields Modifier and Type Field Description protected static intBOTprotected static intCAPITALSprotected static intDEPTHprotected floatfactorprotected static intHEIGHTbooleanisBoldbooleanisItbooleanisRomanbooleanisSsbooleanisTtprotected static intITstatic java.util.List<java.lang.Character.UnicodeBlock>loadedAlphabetsprotected static intMIDprotected static intNONENo extension part for that kind (TOP,MID,REP or BOT)protected static intNUMBERSstatic java.util.Map<java.lang.Character.UnicodeBlock,AlphabetRegistration>registeredAlphabetsprotected static intREPprotected static intSMALLprotected static intTOPprotected static intUNICODEprotected static intWIDTH
-
Constructor Summary
Constructors Constructor Description DefaultTeXFont(float pointSize)DefaultTeXFont(float pointSize, boolean b, boolean rm, boolean ss, boolean tt, boolean it)DefaultTeXFont(float pointSize, float f, boolean b, boolean rm, boolean ss, boolean tt, boolean it)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidaddAlphabet(java.lang.Character.UnicodeBlock alphabet, java.io.InputStream inlanguage, java.lang.String language, java.io.InputStream insymbols, java.lang.String symbols, java.io.InputStream inmappings, java.lang.String mappings)static voidaddAlphabet(java.lang.Character.UnicodeBlock alphabet, java.lang.String name)static voidaddAlphabet(java.lang.Object base, java.lang.Character.UnicodeBlock[] alphabet, java.lang.String language)static voidaddAlphabet(AlphabetRegistration reg)static voidaddTeXFontDescription(java.io.InputStream in, java.lang.String name)static voidaddTeXFontDescription(java.lang.Object base, java.io.InputStream in, java.lang.String name)static voidaddTeXFontDescription(java.lang.String file)TeXFontcopy()TeXFontderiveFont(float size)Derives a newTeXFontobject with the given point sizestatic voidenableMagnification(boolean b)floatgetAxisHeight(int style)floatgetBigOpSpacing1(int style)floatgetBigOpSpacing2(int style)floatgetBigOpSpacing3(int style)floatgetBigOpSpacing4(int style)floatgetBigOpSpacing5(int style)booleangetBold()ChargetChar(char c, java.lang.String textStyle, int style)Get a Char-object specifying the given character in the given text style with metric information depending on the given "style".ChargetChar(java.lang.String symbolName, int style)Get a Char-object for the given symbol with metric information depending on "style".ChargetChar(CharFont cf, int style)Get a Char-object for this specific character containing the metric informationChargetDefaultChar(char c, int style)Get a Char-object specifying the given character in the default text style with metric information depending on the given "style".floatgetDefaultRuleThickness(int style)floatgetDenom1(int style)floatgetDenom2(int style)floatgetEM(int style)ExtensiongetExtension(Char c, int style)Get an Extension-object for the given Char containing the 4 possible parts to build an arbitrary large variant.booleangetIt()floatgetKern(CharFont left, CharFont right, int style)Get the kern value to be inserted between the given characters in the given style.CharFontgetLigature(CharFont left, CharFont right)Get the ligature that replaces both characters (if any).intgetMuFontId()ChargetNextLarger(Char c, int style)Get the next larger version of the given character.floatgetNum1(int style)floatgetNum2(int style)floatgetNum3(int style)floatgetQuad(int style, int fontCode)booleangetRoman()floatgetScaleFactor()floatgetSize()static floatgetSizeFactor(int style)floatgetSkew(CharFont cf, int style)Get the kern amount of the character defined by the given CharFont followed by the "skewchar" of it's font.floatgetSpace(int style)booleangetSs()floatgetSub1(int style)floatgetSub2(int style)floatgetSubDrop(int style)floatgetSup1(int style)floatgetSup2(int style)floatgetSup3(int style)floatgetSupDrop(int style)booleangetTt()floatgetXHeight(int style, int fontCode)booleanhasNextLarger(Char c)booleanhasSpace(int font)booleanisExtensionChar(Char c)static voidregisterAlphabet(AlphabetRegistration reg)TeXFontscaleFont(float factor)voidsetBold(boolean bold)voidsetIt(boolean it)static voidsetMagnification(float mag)static voidsetMathSizes(float ds, float ts, float ss, float sss)voidsetRoman(boolean rm)voidsetSs(boolean ss)voidsetTt(boolean tt)
-
-
-
Field Detail
-
NONE
protected static final int NONE
No extension part for that kind (TOP,MID,REP or BOT)- See Also:
- Constant Field Values
-
NUMBERS
protected static final int NUMBERS
- See Also:
- Constant Field Values
-
CAPITALS
protected static final int CAPITALS
- See Also:
- Constant Field Values
-
SMALL
protected static final int SMALL
- See Also:
- Constant Field Values
-
UNICODE
protected static final int UNICODE
- See Also:
- Constant Field Values
-
TOP
protected static final int TOP
- See Also:
- Constant Field Values
-
MID
protected static final int MID
- See Also:
- Constant Field Values
-
REP
protected static final int REP
- See Also:
- Constant Field Values
-
BOT
protected static final int BOT
- See Also:
- Constant Field Values
-
WIDTH
protected static final int WIDTH
- See Also:
- Constant Field Values
-
HEIGHT
protected static final int HEIGHT
- See Also:
- Constant Field Values
-
DEPTH
protected static final int DEPTH
- See Also:
- Constant Field Values
-
IT
protected static final int IT
- See Also:
- Constant Field Values
-
loadedAlphabets
public static java.util.List<java.lang.Character.UnicodeBlock> loadedAlphabets
-
registeredAlphabets
public static java.util.Map<java.lang.Character.UnicodeBlock,AlphabetRegistration> registeredAlphabets
-
factor
protected float factor
-
isBold
public boolean isBold
-
isRoman
public boolean isRoman
-
isSs
public boolean isSs
-
isTt
public boolean isTt
-
isIt
public boolean isIt
-
-
Constructor Detail
-
DefaultTeXFont
public DefaultTeXFont(float pointSize)
-
DefaultTeXFont
public DefaultTeXFont(float pointSize, boolean b, boolean rm, boolean ss, boolean tt, boolean it)
-
DefaultTeXFont
public DefaultTeXFont(float pointSize, float f, boolean b, boolean rm, boolean ss, boolean tt, boolean it)
-
-
Method Detail
-
addTeXFontDescription
public static void addTeXFontDescription(java.lang.String file) throws ResourceParseException- Throws:
ResourceParseException
-
addTeXFontDescription
public static void addTeXFontDescription(java.io.InputStream in, java.lang.String name) throws ResourceParseException- Throws:
ResourceParseException
-
addTeXFontDescription
public static void addTeXFontDescription(java.lang.Object base, java.io.InputStream in, java.lang.String name) throws ResourceParseException- Throws:
ResourceParseException
-
addAlphabet
public static void addAlphabet(java.lang.Character.UnicodeBlock alphabet, java.io.InputStream inlanguage, java.lang.String language, java.io.InputStream insymbols, java.lang.String symbols, java.io.InputStream inmappings, java.lang.String mappings) throws ResourceParseException- Throws:
ResourceParseException
-
addAlphabet
public static void addAlphabet(java.lang.Object base, java.lang.Character.UnicodeBlock[] alphabet, java.lang.String language) throws ResourceParseException- Throws:
ResourceParseException
-
addAlphabet
public static void addAlphabet(java.lang.Character.UnicodeBlock alphabet, java.lang.String name)
-
addAlphabet
public static void addAlphabet(AlphabetRegistration reg)
-
registerAlphabet
public static void registerAlphabet(AlphabetRegistration reg)
-
deriveFont
public TeXFont deriveFont(float size)
Description copied from interface:TeXFontDerives a newTeXFontobject with the given point size- Specified by:
deriveFontin interfaceTeXFont- Parameters:
size- the new size (in points) of the derivedTeXFont- Returns:
- a copy of this
TeXFontwith the new size
-
getScaleFactor
public float getScaleFactor()
- Specified by:
getScaleFactorin interfaceTeXFont
-
getAxisHeight
public float getAxisHeight(int style)
- Specified by:
getAxisHeightin interfaceTeXFont
-
getBigOpSpacing1
public float getBigOpSpacing1(int style)
- Specified by:
getBigOpSpacing1in interfaceTeXFont
-
getBigOpSpacing2
public float getBigOpSpacing2(int style)
- Specified by:
getBigOpSpacing2in interfaceTeXFont
-
getBigOpSpacing3
public float getBigOpSpacing3(int style)
- Specified by:
getBigOpSpacing3in interfaceTeXFont
-
getBigOpSpacing4
public float getBigOpSpacing4(int style)
- Specified by:
getBigOpSpacing4in interfaceTeXFont
-
getBigOpSpacing5
public float getBigOpSpacing5(int style)
- Specified by:
getBigOpSpacing5in interfaceTeXFont
-
getChar
public Char getChar(char c, java.lang.String textStyle, int style) throws TextStyleMappingNotFoundException
Description copied from interface:TeXFontGet a Char-object specifying the given character in the given text style with metric information depending on the given "style".- Specified by:
getCharin interfaceTeXFont- Parameters:
c- alphanumeric charactertextStyle- the text style in which the character should be drawnstyle- the style in which the atom should be drawn- Returns:
- the Char-object specifying the given character in the given text style
- Throws:
TextStyleMappingNotFoundException- if there's no text style defined with the given name
-
getChar
public Char getChar(CharFont cf, int style)
Description copied from interface:TeXFontGet a Char-object for this specific character containing the metric information
-
getChar
public Char getChar(java.lang.String symbolName, int style) throws SymbolMappingNotFoundException
Description copied from interface:TeXFontGet a Char-object for the given symbol with metric information depending on "style".- Specified by:
getCharin interfaceTeXFont- Parameters:
symbolName- the symbol namestyle- the style in which the atom should be drawn- Returns:
- a Char-object for this symbol with metric information
- Throws:
SymbolMappingNotFoundException- if there's no symbol defined with the given name
-
getDefaultChar
public Char getDefaultChar(char c, int style)
Description copied from interface:TeXFontGet a Char-object specifying the given character in the default text style with metric information depending on the given "style".- Specified by:
getDefaultCharin interfaceTeXFont- Parameters:
c- alphanumeric characterstyle- the style in which the atom should be drawn- Returns:
- the Char-object specifying the given character in the default text style
-
getDefaultRuleThickness
public float getDefaultRuleThickness(int style)
- Specified by:
getDefaultRuleThicknessin interfaceTeXFont
-
getExtension
public Extension getExtension(Char c, int style)
Description copied from interface:TeXFontGet an Extension-object for the given Char containing the 4 possible parts to build an arbitrary large variant. This will only be called if isExtensionChar(Char) returns true.- Specified by:
getExtensionin interfaceTeXFont- Parameters:
c- a Char-object for a specific characterstyle- the style in which the atom should be drawn- Returns:
- an Extension object containing the 4 possible parts
-
getKern
public float getKern(CharFont left, CharFont right, int style)
Description copied from interface:TeXFontGet the kern value to be inserted between the given characters in the given style.
-
getLigature
public CharFont getLigature(CharFont left, CharFont right)
Description copied from interface:TeXFontGet the ligature that replaces both characters (if any).- Specified by:
getLigaturein interfaceTeXFont- Parameters:
left- left characterright- right character- Returns:
- a ligature replacing both characters (or null: no ligature)
-
getMuFontId
public int getMuFontId()
- Specified by:
getMuFontIdin interfaceTeXFont
-
getNextLarger
public Char getNextLarger(Char c, int style)
Description copied from interface:TeXFontGet the next larger version of the given character. This is only called if hasNextLarger(Char) returns true.- Specified by:
getNextLargerin interfaceTeXFont- Parameters:
c- characterstyle- the style in which the atom should be drawn- Returns:
- the next larger version of this character
-
getSize
public float getSize()
-
getSkew
public float getSkew(CharFont cf, int style)
Description copied from interface:TeXFontGet the kern amount of the character defined by the given CharFont followed by the "skewchar" of it's font. This is used in the algorithm for placing an accent above a single character.
-
getSubDrop
public float getSubDrop(int style)
- Specified by:
getSubDropin interfaceTeXFont
-
getSupDrop
public float getSupDrop(int style)
- Specified by:
getSupDropin interfaceTeXFont
-
getXHeight
public float getXHeight(int style, int fontCode)- Specified by:
getXHeightin interfaceTeXFont
-
hasNextLarger
public boolean hasNextLarger(Char c)
- Specified by:
hasNextLargerin interfaceTeXFont- Parameters:
c- a character- Returns:
- true if the given character has a larger version, false otherwise
-
isExtensionChar
public boolean isExtensionChar(Char c)
- Specified by:
isExtensionCharin interfaceTeXFont- Parameters:
c- a character- Returns:
- true if the given character contains extension information to buid an arbitrary large version of this character.
-
setMathSizes
public static void setMathSizes(float ds, float ts, float ss, float sss)
-
setMagnification
public static void setMagnification(float mag)
-
enableMagnification
public static void enableMagnification(boolean b)
-
getSizeFactor
public static float getSizeFactor(int style)
-
-