|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.foray.font.FontConsumer4a
public class FontConsumer4a
An implementation of the aXSL FontConsumer
interface.
Instances are obtained by using the FOrayFontConsumer constructor(s).
FOrayFontConsumer instances can then be used to obtain implementations of
FontUse and Font which provide direct services to the client application.
Field Summary | |
---|---|
static byte |
ENCODING_ANY
Constant indicating that the font selection process is free to use any encoding that it can, including creating new ones, to make its full complement of glyphs available during the font selection process. |
static byte |
ENCODING_INTERNAL_ONLY
Constant indicating that only a font's internal encoding should be used during the font selection process. |
static byte |
ENCODING_SPECIFIED_ONLY
Constant indicating that only the encoding specified in the RegisteredFontDesc (from the font-configuration) should be used
during the font selection process. |
Fields inherited from interface org.axsl.font.FontConsumer |
---|
FONT_SOURCE_FREE_STANDING, FONT_SOURCE_SYSTEM |
Constructor Summary | |
---|---|
FontConsumer4a(FontServer4a server)
Constructor. |
Method Summary | |
---|---|
ConsumerFont4a |
getConsumerFont(Font4a font)
Returns the FontUse instance for a given font. |
protected FontUse4a |
getDefaultFontUse()
Return a default font. |
byte |
getEncodingLatitude()
Returns the encoding latitude for this font consumer. |
FontSelector |
getFontSelectorAuto()
Returns the "auto" font selector for this consumer. |
String |
getFontSelectorAutoType()
Returns the "auto" font selector type for this consumer. |
FontSelector |
getFontSelectorCBC()
Returns the character-by-character font selector for this consumer. |
FontServer4a |
getFontServer()
Returns the parent font server instance. |
org.apache.commons.logging.Log |
getLogger()
Provides the font system with the Log implementation which should be used to log messages. |
List<Font4a> |
getUsedFonts()
|
List<FontUse4a> |
getUsedFontUses()
|
boolean |
isUsingFreeStandingFonts()
Indicates whether this consumer can use free-standing fonts or not. |
boolean |
isUsingSystemFonts()
Indicates whether this consumer can use system fonts or not. |
void |
optimizeFonts()
|
boolean |
preferFreeStandingFonts()
Indicates whether free-standing fonts are preferred over system fonts. |
protected ConsumerFont4a |
registerFontUse(Font4a font)
Record the fact that this FontConsumer has used this font. |
org.axsl.font.FontUse |
selectFontCss(List<String> familyList,
org.axsl.font.Font.Style style,
org.axsl.font.Font.Weight weight,
org.axsl.font.Font.Variant variant,
org.axsl.font.Font.Stretch stretch,
int size,
int codePoint)
|
org.axsl.font.FontUse |
selectFontPanose(byte[] panose,
int codePoint)
|
org.axsl.font.FontUse |
selectFontXsl(org.axsl.font.Font.SelectionStrategy selectionStrategy,
List<String> familyList,
org.axsl.font.Font.Style style,
org.axsl.font.Font.Weight weight,
org.axsl.font.Font.Variant variant,
org.axsl.font.Font.Stretch stretch,
int size,
int codePoint)
|
void |
setEncodingLatitude(int encodingLatitude)
Sets the encoding latitude that may be used during the font selection process. |
void |
setFontSelectorAutoType(String newFontSelectorAutoType)
Sets the "auto" font selector type for this consumer. |
void |
setFontSources(int[] fontSources)
|
void |
setLogger(org.apache.commons.logging.Log logger)
Use this method to set a logger for this font consumer. |
protected Font4a |
whichUse(RegisteredFontDesc rfd,
int codePoint)
Since RegisteredFont and RegisteredFontDesc instances
can encapsulate either a FreeStandingFont or a SystemFont, or both,
this method selects which one should be used, based on the FontConsumer
instances parameters. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte ENCODING_INTERNAL_ONLY
public static final byte ENCODING_SPECIFIED_ONLY
RegisteredFontDesc
(from the font-configuration) should be used
during the font selection process.
public static final byte ENCODING_ANY
Constructor Detail |
---|
public FontConsumer4a(FontServer4a server)
server
- The FOrayFontServer instance serving this FontConsumer.Method Detail |
---|
public void setFontSources(int[] fontSources)
setFontSources
in interface org.axsl.font.FontConsumer
public void setLogger(org.apache.commons.logging.Log logger)
logger
- The new logger.public org.apache.commons.logging.Log getLogger()
public boolean isUsingFreeStandingFonts()
public boolean isUsingSystemFonts()
public boolean preferFreeStandingFonts()
public FontServer4a getFontServer()
public String getFontSelectorAutoType()
public void setFontSelectorAutoType(String newFontSelectorAutoType)
newFontSelectorAutoType
- The new "auto" font selector type for this
consumer.public FontSelector getFontSelectorCBC()
public FontSelector getFontSelectorAuto()
public org.axsl.font.FontUse selectFontXsl(org.axsl.font.Font.SelectionStrategy selectionStrategy, List<String> familyList, org.axsl.font.Font.Style style, org.axsl.font.Font.Weight weight, org.axsl.font.Font.Variant variant, org.axsl.font.Font.Stretch stretch, int size, int codePoint) throws org.axsl.font.FontException
selectFontXsl
in interface org.axsl.font.FontConsumer
org.axsl.font.FontException
protected FontUse4a getDefaultFontUse()
protected Font4a whichUse(RegisteredFontDesc rfd, int codePoint)
Since RegisteredFont
and RegisteredFontDesc
instances
can encapsulate either a FreeStandingFont or a SystemFont, or both,
this method selects which one should be used, based on the FontConsumer
instances parameters.
In cases where both a FreeStandingFont and a SystemFont are available, and either can be selected, this method also breaks the tie, again using a FontConsumer parameter. Although each has access to the other's methods for things that it does not natively know, there are still potential differences between the two (especially font metrics), and an application needs to be able to select which one it prefers.
rfd
- The RegisteredFontDesc instance which points to the usable
font.codePoint
- The Unicode code point that should be tested to ensure
that it can be encoded.
public org.axsl.font.FontUse selectFontCss(List<String> familyList, org.axsl.font.Font.Style style, org.axsl.font.Font.Weight weight, org.axsl.font.Font.Variant variant, org.axsl.font.Font.Stretch stretch, int size, int codePoint) throws org.axsl.font.FontException
selectFontCss
in interface org.axsl.font.FontConsumer
org.axsl.font.FontException
public List<Font4a> getUsedFonts()
getUsedFonts
in interface org.axsl.font.FontConsumer
public List<FontUse4a> getUsedFontUses()
getUsedFontUses
in interface org.axsl.font.FontConsumer
protected ConsumerFont4a registerFontUse(Font4a font)
font
- The Font instance that was used.
font
for this
consumer.public void optimizeFonts()
optimizeFonts
in interface org.axsl.font.FontConsumer
public ConsumerFont4a getConsumerFont(Font4a font)
font
- The Font instance for which we wish to find the
related FontUse instance.
public byte getEncodingLatitude()
ENCODING_INTERNAL_ONLY
, ENCODING_SPECIFIED_ONLY
, or
ENCODING_ANY
.public void setEncodingLatitude(int encodingLatitude) throws org.axsl.font.FontException
encodingLatitude
- One of the valid encoding latitude specifiers:
ENCODING_INTERNAL_ONLY
, ENCODING_SPECIFIED_ONLY
, or
ENCODING_ANY
.
org.axsl.font.FontException
- If the encoding latitude is not valid.public org.axsl.font.FontUse selectFontPanose(byte[] panose, int codePoint) throws org.axsl.font.FontException
selectFontPanose
in interface org.axsl.font.FontConsumer
org.axsl.font.FontException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |