Package org.scilab.forge.jlatexmath
Class DefaultTeXFont
java.lang.Object
org.scilab.forge.jlatexmath.DefaultTeXFont
- All Implemented Interfaces:
TeXFont
The default implementation of the TeXFont-interface. All font information is read
from an xml-file.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final int
protected static final int
protected static final int
protected float
protected static final int
boolean
boolean
boolean
boolean
boolean
protected static final int
static List
<Character.UnicodeBlock> protected static final int
protected static final int
No extension part for that kind (TOP,MID,REP or BOT)protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultTeXFont
(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
Modifier and TypeMethodDescriptionstatic void
addAlphabet
(Character.UnicodeBlock alphabet, InputStream inlanguage, String language, InputStream insymbols, String symbols, InputStream inmappings, String mappings) static void
addAlphabet
(Character.UnicodeBlock alphabet, String name) static void
addAlphabet
(Object base, Character.UnicodeBlock[] alphabet, String language) static void
static void
addTeXFontDescription
(InputStream in, String name) static void
addTeXFontDescription
(Object base, InputStream in, String name) static void
addTeXFontDescription
(String file) copy()
deriveFont
(float size) Derives a newTeXFont
object with the given point sizestatic void
enableMagnification
(boolean b) float
getAxisHeight
(int style) float
getBigOpSpacing1
(int style) float
getBigOpSpacing2
(int style) float
getBigOpSpacing3
(int style) float
getBigOpSpacing4
(int style) float
getBigOpSpacing5
(int style) boolean
getBold()
Get a Char-object specifying the given character in the given text style with metric information depending on the given "style".Get a Char-object for the given symbol with metric information depending on "style".Get a Char-object for this specific character containing the metric informationgetDefaultChar
(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".float
getDefaultRuleThickness
(int style) float
getDenom1
(int style) float
getDenom2
(int style) float
getEM
(int style) getExtension
(Char c, int style) Get an Extension-object for the given Char containing the 4 possible parts to build an arbitrary large variant.boolean
getIt()
float
Get the kern value to be inserted between the given characters in the given style.getLigature
(CharFont left, CharFont right) Get the ligature that replaces both characters (if any).int
getNextLarger
(Char c, int style) Get the next larger version of the given character.float
getNum1
(int style) float
getNum2
(int style) float
getNum3
(int style) float
getQuad
(int style, int fontCode) boolean
getRoman()
float
float
getSize()
static float
getSizeFactor
(int style) float
Get the kern amount of the character defined by the given CharFont followed by the "skewchar" of it's font.float
getSpace
(int style) boolean
getSs()
float
getSub1
(int style) float
getSub2
(int style) float
getSubDrop
(int style) float
getSup1
(int style) float
getSup2
(int style) float
getSup3
(int style) float
getSupDrop
(int style) boolean
getTt()
float
getXHeight
(int style, int fontCode) boolean
boolean
hasSpace
(int font) boolean
static void
scaleFont
(float factor) void
setBold
(boolean bold) void
setIt
(boolean it) static void
setMagnification
(float mag) static void
setMathSizes
(float ds, float ts, float ss, float sss) void
setRoman
(boolean rm) void
setSs
(boolean ss) void
setTt
(boolean tt)
-
Field Details
-
NONE
protected static final int NONENo extension part for that kind (TOP,MID,REP or BOT)- See Also:
-
NUMBERS
protected static final int NUMBERS- See Also:
-
CAPITALS
protected static final int CAPITALS- See Also:
-
SMALL
protected static final int SMALL- See Also:
-
UNICODE
protected static final int UNICODE- See Also:
-
TOP
protected static final int TOP- See Also:
-
MID
protected static final int MID- See Also:
-
REP
protected static final int REP- See Also:
-
BOT
protected static final int BOT- See Also:
-
WIDTH
protected static final int WIDTH- See Also:
-
HEIGHT
protected static final int HEIGHT- See Also:
-
DEPTH
protected static final int DEPTH- See Also:
-
IT
protected static final int IT- See Also:
-
loadedAlphabets
-
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 Details
-
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 Details
-
addTeXFontDescription
- Throws:
ResourceParseException
-
addTeXFontDescription
- Throws:
ResourceParseException
-
addTeXFontDescription
public static void addTeXFontDescription(Object base, InputStream in, String name) throws ResourceParseException - Throws:
ResourceParseException
-
addAlphabet
public static void addAlphabet(Character.UnicodeBlock alphabet, InputStream inlanguage, String language, InputStream insymbols, String symbols, InputStream inmappings, String mappings) throws ResourceParseException - Throws:
ResourceParseException
-
addAlphabet
public static void addAlphabet(Object base, Character.UnicodeBlock[] alphabet, String language) throws ResourceParseException - Throws:
ResourceParseException
-
addAlphabet
-
addAlphabet
-
registerAlphabet
-
copy
-
deriveFont
Description copied from interface:TeXFont
Derives a newTeXFont
object with the given point size- Specified by:
deriveFont
in interfaceTeXFont
- Parameters:
size
- the new size (in points) of the derivedTeXFont
- Returns:
- a copy of this
TeXFont
with the new size
-
scaleFont
-
getScaleFactor
public float getScaleFactor()- Specified by:
getScaleFactor
in interfaceTeXFont
-
getAxisHeight
public float getAxisHeight(int style) - Specified by:
getAxisHeight
in interfaceTeXFont
-
getBigOpSpacing1
public float getBigOpSpacing1(int style) - Specified by:
getBigOpSpacing1
in interfaceTeXFont
-
getBigOpSpacing2
public float getBigOpSpacing2(int style) - Specified by:
getBigOpSpacing2
in interfaceTeXFont
-
getBigOpSpacing3
public float getBigOpSpacing3(int style) - Specified by:
getBigOpSpacing3
in interfaceTeXFont
-
getBigOpSpacing4
public float getBigOpSpacing4(int style) - Specified by:
getBigOpSpacing4
in interfaceTeXFont
-
getBigOpSpacing5
public float getBigOpSpacing5(int style) - Specified by:
getBigOpSpacing5
in interfaceTeXFont
-
getChar
Description copied from interface:TeXFont
Get a Char-object specifying the given character in the given text style with metric information depending on the given "style".- Specified by:
getChar
in 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
Description copied from interface:TeXFont
Get a Char-object for this specific character containing the metric information -
getChar
Description copied from interface:TeXFont
Get a Char-object for the given symbol with metric information depending on "style".- Specified by:
getChar
in 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
Description copied from interface:TeXFont
Get a Char-object specifying the given character in the default text style with metric information depending on the given "style".- Specified by:
getDefaultChar
in 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:
getDefaultRuleThickness
in interfaceTeXFont
-
getDenom1
public float getDenom1(int style) -
getDenom2
public float getDenom2(int style) -
getExtension
Description copied from interface:TeXFont
Get 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:
getExtension
in 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
Description copied from interface:TeXFont
Get the kern value to be inserted between the given characters in the given style. -
getLigature
Description copied from interface:TeXFont
Get the ligature that replaces both characters (if any).- Specified by:
getLigature
in interfaceTeXFont
- Parameters:
left
- left characterright
- right character- Returns:
- a ligature replacing both characters (or null: no ligature)
-
getMuFontId
public int getMuFontId()- Specified by:
getMuFontId
in interfaceTeXFont
-
getNextLarger
Description copied from interface:TeXFont
Get the next larger version of the given character. This is only called if hasNextLarger(Char) returns true.- Specified by:
getNextLarger
in interfaceTeXFont
- Parameters:
c
- characterstyle
- the style in which the atom should be drawn- Returns:
- the next larger version of this character
-
getNum1
public float getNum1(int style) -
getNum2
public float getNum2(int style) -
getNum3
public float getNum3(int style) -
getQuad
public float getQuad(int style, int fontCode) -
getSize
public float getSize() -
getSkew
Description copied from interface:TeXFont
Get 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. -
getSpace
public float getSpace(int style) -
getSub1
public float getSub1(int style) -
getSub2
public float getSub2(int style) -
getSubDrop
public float getSubDrop(int style) - Specified by:
getSubDrop
in interfaceTeXFont
-
getSup1
public float getSup1(int style) -
getSup2
public float getSup2(int style) -
getSup3
public float getSup3(int style) -
getSupDrop
public float getSupDrop(int style) - Specified by:
getSupDrop
in interfaceTeXFont
-
getXHeight
public float getXHeight(int style, int fontCode) - Specified by:
getXHeight
in interfaceTeXFont
-
getEM
public float getEM(int style) -
hasNextLarger
- Specified by:
hasNextLarger
in interfaceTeXFont
- Parameters:
c
- a character- Returns:
- true if the given character has a larger version, false otherwise
-
setBold
public void setBold(boolean bold) -
getBold
public boolean getBold() -
setRoman
public void setRoman(boolean rm) -
getRoman
public boolean getRoman() -
setTt
public void setTt(boolean tt) -
getTt
public boolean getTt() -
setIt
public void setIt(boolean it) -
getIt
public boolean getIt() -
setSs
public void setSs(boolean ss) -
getSs
public boolean getSs() -
hasSpace
public boolean hasSpace(int font) -
isExtensionChar
- Specified by:
isExtensionChar
in 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)
-