|
fop 0.95 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.fop.fonts.FontInfo
The FontInfo for the layout and rendering of a fo document.
This stores the list of available fonts that are setup by
the renderer. The font name can be retrieved for the
family style and weight.
Currently font supported font-variant small-caps is not
implemented.
| Field Summary | |
protected static org.apache.commons.logging.Log |
log
logging instance |
| Constructor Summary | |
FontInfo()
Main constructor |
|
| Method Summary | |
void |
addFontProperties(java.lang.String name,
FontTriplet triplet)
Adds a new font triplet. |
void |
addFontProperties(java.lang.String name,
java.lang.String family,
java.lang.String style,
int weight)
Adds a new font triplet. |
void |
addMetrics(java.lang.String name,
FontMetrics metrics)
Adds font metrics for a specific font. |
static FontTriplet |
createFontKey(java.lang.String family,
java.lang.String style,
int weight)
Creates a key from the given strings. |
void |
dumpAllTripletsToSystemOut()
Diagnostic method for logging all registered fonts to System.out. |
FontTriplet |
findAdjustWeight(java.lang.String family,
java.lang.String style,
int weight)
Find a font with a given family and style by trying different font weights according to the spec. |
FontTriplet[] |
fontLookup(java.lang.String[] families,
java.lang.String style,
int weight)
Looks up a set of fonts. |
FontTriplet |
fontLookup(java.lang.String family,
java.lang.String style,
int weight)
Lookup a font. |
Font |
getFontInstance(FontTriplet triplet,
int fontSize)
Retrieves a (possibly cached) Font instance based on a FontTriplet and a font size. |
java.util.Map |
getFonts()
Gets a Map of all registered fonts. |
java.lang.String |
getFontStyleFor(java.lang.String fontName)
Returns the font style for a particular font. |
java.util.Map |
getFontTriplets()
Gets a Map of all registered font triplets. |
int |
getFontWeightFor(java.lang.String fontName)
Returns the font weight for a particular font. |
java.lang.String |
getInternalFontKey(FontTriplet triplet)
Returns the internal font key (F1, F2, F3 etc.) for a given triplet. |
FontMetrics |
getMetricsFor(java.lang.String fontName)
Returns the FontMetrics for a particular font |
FontTriplet |
getTripletFor(java.lang.String fontName)
Returns the first triplet matching the given font name. |
java.util.Map |
getUsedFonts()
This is used by the renderers to retrieve all the fonts used in the document. |
boolean |
hasFont(java.lang.String family,
java.lang.String style,
int weight)
Determines if a particular font is available. |
boolean |
isSetupValid()
Checks if the font setup is valid (At least the ultimate fallback font must be registered.) |
void |
useFont(java.lang.String internalName)
Tells this class that the font with the given internal name has been used. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static org.apache.commons.logging.Log log
| Constructor Detail |
public FontInfo()
| Method Detail |
public boolean isSetupValid()
public void addFontProperties(java.lang.String name,
java.lang.String family,
java.lang.String style,
int weight)
name - internal keyfamily - font family namestyle - font style (normal, italic, oblique...)weight - font weight
public void addFontProperties(java.lang.String name,
FontTriplet triplet)
name - internal keytriplet - the font triplet to associate with the internal key
public void addMetrics(java.lang.String name,
FontMetrics metrics)
name - internal keymetrics - metrics to registerpublic void useFont(java.lang.String internalName)
internalName - the internal font name (F1, F2 etc.)
public Font getFontInstance(FontTriplet triplet,
int fontSize)
triplet - the font triplet designating the requested fontfontSize - the font size
public FontTriplet fontLookup(java.lang.String family,
java.lang.String style,
int weight)
family - font familystyle - font styleweight - font weight
public FontTriplet[] fontLookup(java.lang.String[] families,
java.lang.String style,
int weight)
families - font families (priority list)style - font styleweight - font weight
public FontTriplet findAdjustWeight(java.lang.String family,
java.lang.String style,
int weight)
family - font familystyle - font styleweight - font weight
public boolean hasFont(java.lang.String family,
java.lang.String style,
int weight)
family - font familystyle - font styleweight - font weight
public java.lang.String getInternalFontKey(FontTriplet triplet)
triplet - the font triplet
public static FontTriplet createFontKey(java.lang.String family,
java.lang.String style,
int weight)
family - font familystyle - font styleweight - font weight
public java.util.Map getFonts()
public java.util.Map getFontTriplets()
public java.util.Map getUsedFonts()
public FontMetrics getMetricsFor(java.lang.String fontName)
fontName - internal key
public FontTriplet getTripletFor(java.lang.String fontName)
fontName - The font name we are looking for
public java.lang.String getFontStyleFor(java.lang.String fontName)
fontName - internal key
public int getFontWeightFor(java.lang.String fontName)
fontName - internal key
public void dumpAllTripletsToSystemOut()
|
fop 0.95 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||