|
fop 2.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.fop.fonts.Font
public class Font
This class holds font state information and provides access to the font metrics.
Field Summary | |
---|---|
static FontTriplet |
DEFAULT_FONT
Default fallback key |
static int |
PRIORITY_DEFAULT
Default selection priority |
static java.lang.String |
STYLE_INCLINED
Inclined font style |
static java.lang.String |
STYLE_ITALIC
Italic font style |
static java.lang.String |
STYLE_NORMAL
Normal font style |
static java.lang.String |
STYLE_OBLIQUE
Oblique font style |
static int |
WEIGHT_BOLD
Bold font weight |
static int |
WEIGHT_EXTRA_BOLD
Extra Bold font weight |
static int |
WEIGHT_LIGHT
Light font weight |
static int |
WEIGHT_NORMAL
Normal font weight |
Constructor Summary | |
---|---|
Font(java.lang.String key,
FontTriplet triplet,
FontMetrics met,
int fontSize)
Main constructor |
Method Summary | |
---|---|
int |
getAscender()
Returns the font's ascender. |
int |
getCapHeight()
Returns the font's CapHeight. |
int |
getCharWidth(char c)
Helper method for getting the width of a unicode char from the current fontstate. |
int |
getCharWidth(int c)
Helper method for getting the width of a unicode char from the current fontstate. |
int |
getDescender()
Returns the font's Descender. |
FontMetrics |
getFontMetrics()
Returns the associated font metrics object. |
java.lang.String |
getFontName()
Returns the font's name. |
int |
getFontSize()
Returns the font size |
FontTriplet |
getFontTriplet()
|
java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,java.lang.Integer>> |
getKerning()
Returns the font's kerning table |
int |
getKernValue(char ch1,
char ch2)
Returns the amount of kerning between two characters. |
int |
getKernValue(int ch1,
int ch2)
Returns the amount of kerning between two characters. |
int |
getWidth(int charnum)
Returns the width of a character |
int |
getWordWidth(java.lang.String word)
Calculates the word width. |
int |
getXHeight()
Returns the XHeight |
boolean |
hasChar(char c)
Determines whether this font contains a particular character/glyph. |
boolean |
hasFeature(int tableType,
java.lang.String script,
java.lang.String language,
java.lang.String feature)
|
boolean |
hasKerning()
|
boolean |
isMultiByte()
Determines whether the font is a multibyte font. |
char |
mapChar(char c)
Map a java character (unicode) to a font character. |
int[][] |
performPositioning(java.lang.CharSequence cs,
java.lang.String script,
java.lang.String language)
Perform glyph positioning using an implied font size. |
int[][] |
performPositioning(java.lang.CharSequence cs,
java.lang.String script,
java.lang.String language,
int fontSize)
Perform glyph positioning. |
boolean |
performsPositioning()
Determines if font performs glyph positioning. |
boolean |
performsSubstitution()
Determines if font performs glyph substitution. |
java.lang.CharSequence |
performSubstitution(java.lang.CharSequence cs,
java.lang.String script,
java.lang.String language,
java.util.List associations,
boolean retainControls)
Perform substitutions on characters to effect glyph substitution. |
java.lang.CharSequence |
reorderCombiningMarks(java.lang.CharSequence cs,
int[][] gpa,
java.lang.String script,
java.lang.String language,
java.util.List associations)
Reorder combining marks in character sequence so that they precede (within the sequence) the base character to which they are applied. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int WEIGHT_EXTRA_BOLD
public static final int WEIGHT_BOLD
public static final int WEIGHT_NORMAL
public static final int WEIGHT_LIGHT
public static final java.lang.String STYLE_NORMAL
public static final java.lang.String STYLE_ITALIC
public static final java.lang.String STYLE_OBLIQUE
public static final java.lang.String STYLE_INCLINED
public static final int PRIORITY_DEFAULT
public static final FontTriplet DEFAULT_FONT
Constructor Detail |
---|
public Font(java.lang.String key, FontTriplet triplet, FontMetrics met, int fontSize)
key
- key of the fonttriplet
- the font triplet that was used to lookup this font (may be null)met
- font metricsfontSize
- font sizeMethod Detail |
---|
public FontMetrics getFontMetrics()
public boolean isMultiByte()
public int getAscender()
public int getCapHeight()
public int getDescender()
public java.lang.String getFontName()
public FontTriplet getFontTriplet()
public int getFontSize()
public int getXHeight()
public boolean hasKerning()
public boolean hasFeature(int tableType, java.lang.String script, java.lang.String language, java.lang.String feature)
public java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,java.lang.Integer>> getKerning()
public int getKernValue(char ch1, char ch2)
ch1
- first characterch2
- second character
public int getKernValue(int ch1, int ch2)
ch1
- first characterch2
- second character
public int getWidth(int charnum)
charnum
- character to look up
public char mapChar(char c)
c
- character to map
public boolean hasChar(char c)
c
- character to check
public java.lang.String toString()
toString
in class java.lang.Object
public int getCharWidth(char c)
c
- character to inspect
public int getCharWidth(int c)
c
- character to inspect
public int getWordWidth(java.lang.String word)
word
- text to get width for
public boolean performsSubstitution()
performsSubstitution
in interface Substitutable
public java.lang.CharSequence performSubstitution(java.lang.CharSequence cs, java.lang.String script, java.lang.String language, java.util.List associations, boolean retainControls)
performSubstitution
in interface Substitutable
cs
- character sequence to map to output font encoding character sequencescript
- a script identifierlanguage
- a language identifierassociations
- optional list to receive list of character associationsretainControls
- if true, then retain control characters and their glyph mappings, otherwise remove
public java.lang.CharSequence reorderCombiningMarks(java.lang.CharSequence cs, int[][] gpa, java.lang.String script, java.lang.String language, java.util.List associations)
reorderCombiningMarks
in interface Substitutable
cs
- character sequence within which combining marks to be reorderedgpa
- associated glyph position adjustments (also reordered)script
- a script identifierlanguage
- a language identifierassociations
- optional list of associations to be reordered
public boolean performsPositioning()
performsPositioning
in interface Positionable
public int[][] performPositioning(java.lang.CharSequence cs, java.lang.String script, java.lang.String language, int fontSize)
performPositioning
in interface Positionable
cs
- character sequence to map to position offsets (advancement adjustments)script
- a script identifierlanguage
- a language identifierfontSize
- font size
public int[][] performPositioning(java.lang.CharSequence cs, java.lang.String script, java.lang.String language)
performPositioning
in interface Positionable
cs
- character sequence to map to position offsets (advancement adjustments)script
- a script identifierlanguage
- a language identifier
|
fop 2.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |