|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.foray.font.config.RegisteredFontDesc
public class RegisteredFontDesc
RegisteredFontDesc encapsulates the set of characteristics about how a
font is used.
An RFD instance has one RegisteredFontFamily
parent, which provides
the font-family context in which it can be selected, and one
RegisteredFont
parent, which provides the link to the actual font.
It is analogous to the font-description element in the font configuration,
and is typically created directly as that is parsed.
An RFD instance is primarily in font resolution, where its characteristics are comapared, in the context of the parent RegisteredFontFamily font family, to those requested by the font selection process.
Field Summary | |
---|---|
static byte |
QTY_SIMULATED_STRETCH
Constant indicating the number of simulated "stretch" components. |
static byte |
SIMULATE_CONDENSED_INDEX
Constant indicating the index for the "condensed" simulated stretch bucket. |
static byte |
SIMULATE_EXPANDED_INDEX
Constant indicating the index for the "expanded" simulated stretch bucket. |
static byte |
SIMULATE_EXTRA_CONDENSED_INDEX
Constant indicating the index for the "extra-condensed" simulated stretch bucket. |
static byte |
SIMULATE_EXTRA_EXPANDED_INDEX
Constant indicating the index for the "extra-expanded" simulated stretch bucket. |
static byte |
SIMULATE_SEMI_CONDENSED_INDEX
Constant indicating the index for the "semi-condensed" simulated stretch bucket. |
static byte |
SIMULATE_SEMI_EXPANDED_INDEX
Constant indicating the index for the "semi-expanded" simulated stretch bucket. |
static byte |
SIMULATE_ULTRA_CONDENSED_INDEX
Constant indicating the index for the "ultra-condensed" simulated stretch bucket. |
static byte |
SIMULATE_ULTRA_EXPANDED_INDEX
Constant indicating the index for the "ultra-expanded" simulated stretch bucket. |
Constructor Summary | |
---|---|
RegisteredFontDesc(RegisteredFont rf,
RegisteredFontFamily rff,
org.axsl.ps.Encoding encoding,
org.axsl.font.Font.Style fontStyle,
org.axsl.font.Font.Weight fontWeight,
org.axsl.font.Font.Variant fontVariant,
org.axsl.font.Font.Stretch fontStretch)
Construct a FontDescription instance. |
Method Summary | |
---|---|
boolean |
equivalent(RegisteredFontDesc otherDesc)
Determine whether two RegisteredFontDesc instances have the same set of characteristics (font-weight, font-style, etc). |
boolean |
equivalentExceptWeight(RegisteredFontDesc otherDesc)
Determine whether two RegisteredFontDesc instances have the same set of characteristics (font-family, font-style, etc), but without regard to font-weight. |
boolean |
generalTypeMatches(boolean freeStandingFonts,
boolean systemFonts)
Determines whether this registered font can return a Font instance that matches the general type requested. |
org.axsl.ps.Encoding |
getEncoding()
Return the prescribed encoding for this description. |
org.axsl.font.Font.Stretch |
getFontStretch()
Return the font-stretch for this registered description. |
org.axsl.font.Font.Style |
getFontStyle()
Returns the font style. |
org.axsl.font.Font.Variant |
getFontVariant()
Return the font-variant for this registered description. |
org.axsl.font.Font.Weight |
getFontWeight()
Returns the font weight. |
RegisteredFont |
getRegisteredFont()
Returns the related registered font instance. |
RegisteredFontFamily |
getRegisteredFontFamily()
Returns the related registered font family instance. |
float |
getSimulateBackslant()
Returns the simulated backslant angle. |
float |
getSimulateCondensed()
Returns the simulated "condensed" percentage. |
float |
getSimulateExpanded()
Returns the simulated "expanded" percentage. |
float |
getSimulateExtraCondensed()
Returns the simulated "extra-condensed" percentage. |
float |
getSimulateExtraExpanded()
Returns the simulated "extra-expanded" percentage. |
float |
getSimulateOblique()
Returns the simulated oblique angle. |
float |
getSimulateSemiCondensed()
Returns the simulated "semi-condensed" percentage. |
float |
getSimulateSemiExpanded()
Returns the simulated "semi-expanded" percentage. |
float |
getSimulateSmallCaps()
Returns the simulated small-caps percentage. |
float |
getSimulateStretch(int index)
Get the simulated font-stretch value by array position. |
float |
getSimulateUltraCondensed()
Returns the simulated "ultra-condensed" percentage. |
float |
getSimulateUltraExpanded()
Returns the simulated "ultra-expanded" percentage. |
boolean |
matchIgnoreWeight(RegisteredFontFamily family,
boolean considerSimulated,
org.axsl.font.Font.Style style,
org.axsl.font.Font.Variant variant,
org.axsl.font.Font.Stretch stretch,
boolean freeStandingFonts,
boolean systemFonts)
Indicates whether this font description matches a given set of criteria, withour regard to the font-weight. |
boolean |
matchPerfect(RegisteredFontFamily family,
boolean considerSimulated,
org.axsl.font.Font.Style style,
org.axsl.font.Font.Weight weight,
org.axsl.font.Font.Variant variant,
org.axsl.font.Font.Stretch stretch,
boolean freeStandingFonts,
boolean systemFonts)
Indicates whether this font description perfectly matches a given set of criteria. |
RegisteredFontDesc |
nextBolderFont()
Returns the next bolder font in the font-family than this font. |
RegisteredFontDesc |
nextLighterFont()
Returns the next lighter font in the font-family than this font. |
void |
setSimulateBackslant(float simulateBackSlant)
Sets the simulated backslant angle. |
void |
setSimulateCondensed(float value)
Sets the simulated "condensed" percentage. |
void |
setSimulateExpanded(float value)
Sets the simulated "expanded" percentage. |
void |
setSimulateExtraCondensed(float value)
Sets the simulated "extra-condensed" percentage. |
void |
setSimulateExtraExpanded(float value)
Sets the simulated "extra-expanded" percentage. |
void |
setSimulateOblique(float simulateOblique)
Sets the simulated oblique angle. |
void |
setSimulateSemiCondensed(float value)
Sets the simulated "semi-condensed" percentage. |
void |
setSimulateSemiExpanded(float value)
Sets the simulated "semi-expanded" percentage. |
void |
setSimulateSmallCaps(float simulateSmallCaps)
Sets the simulated small-caps for this registered description. |
void |
setSimulateStretch(float[] newStretchArray)
Sets the simulated stretch array. |
void |
setSimulateStretch(int index,
float value)
Set the simulated font-stretch value by array position. |
void |
setSimulateUltraCondensed(float value)
Sets the simulated "ultra-condensed" percentage. |
void |
setSimulateUltraExpanded(float value)
Sets the simulated "ultra-expanded" percentage. |
boolean |
stretchMatches(org.axsl.font.Font.Stretch desiredStretch,
boolean considerSimulated)
Indicates whether this font description matches a given stretch. |
boolean |
styleMatches(org.axsl.font.Font.Style inputDesiredStyle,
boolean considerSimulated)
Indicates whether this font description matches a given style. |
boolean |
variantMatches(org.axsl.font.Font.Variant desiredVariant,
boolean considerSimulated)
Indicates whether this font description matches a given variant. |
boolean |
weightMatches(org.axsl.font.Font.Weight desiredWeight)
Indicates whether this font description matches a given weight. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte QTY_SIMULATED_STRETCH
public static final byte SIMULATE_ULTRA_CONDENSED_INDEX
public static final byte SIMULATE_EXTRA_CONDENSED_INDEX
public static final byte SIMULATE_CONDENSED_INDEX
public static final byte SIMULATE_SEMI_CONDENSED_INDEX
public static final byte SIMULATE_SEMI_EXPANDED_INDEX
public static final byte SIMULATE_EXPANDED_INDEX
public static final byte SIMULATE_EXTRA_EXPANDED_INDEX
public static final byte SIMULATE_ULTRA_EXPANDED_INDEX
Constructor Detail |
---|
public RegisteredFontDesc(RegisteredFont rf, RegisteredFontFamily rff, org.axsl.ps.Encoding encoding, org.axsl.font.Font.Style fontStyle, org.axsl.font.Font.Weight fontWeight, org.axsl.font.Font.Variant fontVariant, org.axsl.font.Font.Stretch fontStretch)
rf
- The parent registered font.rff
- The parent registered font family.encoding
- The specified encoding.fontStyle
- The font style (normal, italic, etc.)fontWeight
- The font weight(100, 200, bold, etc.)fontVariant
- The font variant (normal, small-caps)fontStretch
- The font stretch (normal, condensed, etc.)Method Detail |
---|
public org.axsl.font.Font.Style getFontStyle()
public org.axsl.font.Font.Weight getFontWeight()
public org.axsl.font.Font.Variant getFontVariant()
public org.axsl.font.Font.Stretch getFontStretch()
public void setSimulateSmallCaps(float simulateSmallCaps)
simulateSmallCaps
- The percentage that should be applied to
simulated small-caps items for this font.
A value of "80" will result in small-caps items that are 80% of the
font-size of caps.public float getSimulateSmallCaps()
public void setSimulateOblique(float simulateOblique)
simulateOblique
- The new simulated oblique angle.public float getSimulateOblique()
public void setSimulateBackslant(float simulateBackSlant)
simulateBackSlant
- The new simulated backslant angle.public float getSimulateBackslant()
public void setSimulateStretch(int index, float value)
index
- Index into the internal array.value
- The percentage value to which the array element should be
set.public float getSimulateStretch(int index)
index
- Index into the internal array.
public void setSimulateStretch(float[] newStretchArray)
newStretchArray
- The new simulated stretch array.public void setSimulateUltraCondensed(float value)
value
- The new simulated "ultra-condensed" percentage.public float getSimulateUltraCondensed()
public void setSimulateExtraCondensed(float value)
value
- The new simulated "extra-condensed" percentage.public float getSimulateExtraCondensed()
public void setSimulateCondensed(float value)
value
- The new simulated "condensed" percentage.public float getSimulateCondensed()
public void setSimulateSemiCondensed(float value)
value
- The new simulated "semi-condensed" percentage.public float getSimulateSemiCondensed()
public void setSimulateSemiExpanded(float value)
value
- The new simulated "semi-expanded" percentage.public float getSimulateSemiExpanded()
public void setSimulateExpanded(float value)
value
- The new simulated "expanded" percentage.public float getSimulateExpanded()
public void setSimulateExtraExpanded(float value)
value
- The new simulated "extra-expanded" percentage.public float getSimulateExtraExpanded()
public void setSimulateUltraExpanded(float value)
value
- The new simulated "ultra-expanded" percentage.public float getSimulateUltraExpanded()
public RegisteredFont getRegisteredFont()
public RegisteredFontFamily getRegisteredFontFamily()
public org.axsl.ps.Encoding getEncoding()
public RegisteredFontDesc nextBolderFont()
public RegisteredFontDesc nextLighterFont()
public boolean equivalent(RegisteredFontDesc otherDesc)
otherDesc
- A RegisteredFontDesc instance which should be compared
to this one.
public boolean equivalentExceptWeight(RegisteredFontDesc otherDesc)
otherDesc
- A RegisteredFontDesc instance which should be compared
to this one.
public boolean styleMatches(org.axsl.font.Font.Style inputDesiredStyle, boolean considerSimulated)
inputDesiredStyle
- The style to match.considerSimulated
- Indicates whether simulated features should be
considered in the test.
public boolean variantMatches(org.axsl.font.Font.Variant desiredVariant, boolean considerSimulated)
desiredVariant
- The variant to match.considerSimulated
- Indicates whether simulated features should be
considered in the test.
public boolean stretchMatches(org.axsl.font.Font.Stretch desiredStretch, boolean considerSimulated)
desiredStretch
- The stretch to match.considerSimulated
- Indicates whether simulated features should be
considered in the test.
public boolean weightMatches(org.axsl.font.Font.Weight desiredWeight)
desiredWeight
- The weight to match.
public boolean matchPerfect(RegisteredFontFamily family, boolean considerSimulated, org.axsl.font.Font.Style style, org.axsl.font.Font.Weight weight, org.axsl.font.Font.Variant variant, org.axsl.font.Font.Stretch stretch, boolean freeStandingFonts, boolean systemFonts)
family
- The desired font-family.considerSimulated
- Indicates whether simulated features should be
considered in this selection.style
- The desired style.weight
- The desired weight.variant
- The desired variant.stretch
- The desired stretch.freeStandingFonts
- Indicates whether free-standing fonts can be
considered in this selection.systemFonts
- Indicates whether system fonts can be consdidered in
this selection.
public boolean matchIgnoreWeight(RegisteredFontFamily family, boolean considerSimulated, org.axsl.font.Font.Style style, org.axsl.font.Font.Variant variant, org.axsl.font.Font.Stretch stretch, boolean freeStandingFonts, boolean systemFonts)
family
- The desired font-family.considerSimulated
- Indicates whether simulated features should be
considered in this selection.style
- The desired style.variant
- The desired variant.stretch
- The desired stretch.freeStandingFonts
- Indicates whether free-standing fonts can be
considered in this selection.systemFonts
- Indicates whether system fonts can be consdidered in
this selection.
public boolean generalTypeMatches(boolean freeStandingFonts, boolean systemFonts)
freeStandingFonts
- True iff the returned font can be a
FreeStandingFont.systemFonts
- True iff the returned font can be a SystemFont.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |