|
aXSL API 0.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.axsl.font.FontUtility
public final class FontUtility
Class containing font-related utility methods.
References to CSS2 are to the Cascading Style Sheet standard, version 2.0, found at:
http://www.w3.org/TR/REC-CSS2/
References to XSL-FO refer to the eXtensible Stylesheet Language Formatting Objects standard, version 1.0, found at:
http://www.w3.org/TR/2001/REC-xsl-20011015/
Field Summary | |
---|---|
static java.lang.String[] |
EMPTY_STRING_ARRAY
An array of Strings with zero elements, useful especially as a return value. |
static java.lang.String |
INPUT_100
String value for input "100". |
static java.lang.String |
INPUT_200
String value for input "200". |
static java.lang.String |
INPUT_300
String value for input "300". |
static java.lang.String |
INPUT_400
String value for input "400". |
static java.lang.String |
INPUT_500
String value for input "500". |
static java.lang.String |
INPUT_600
String value for input "600". |
static java.lang.String |
INPUT_700
String value for input "700". |
static java.lang.String |
INPUT_800
String value for input "800". |
static java.lang.String |
INPUT_900
String value for input "900". |
static java.lang.String |
INPUT_BACKSLANT
String value for input "backslant". |
static java.lang.String |
INPUT_BOLD
String value for input "bold". |
static java.lang.String |
INPUT_CONDENSED
String value for input "condensed". |
static java.lang.String |
INPUT_EXPANDED
String value for input "expanded". |
static java.lang.String |
INPUT_EXTRA_CONDENSED
String value for input "extra-condensed". |
static java.lang.String |
INPUT_EXTRA_EXPANDED
String value for input "extra-expanded". |
static java.lang.String |
INPUT_INVALID
String value for invalid input. |
static java.lang.String |
INPUT_ITALIC
String value for input "italic". |
static java.lang.String |
INPUT_NORMAL
String value for input "normal". |
static java.lang.String |
INPUT_OBLIQUE
String value for input "oblique". |
static java.lang.String |
INPUT_SEMI_CONDENSED
String value for input "semi-condensed". |
static java.lang.String |
INPUT_SEMI_EXPANDED
String value for input "semi-expanded". |
static java.lang.String |
INPUT_SMALL_CAPS
String value for input "small-caps". |
static java.lang.String |
INPUT_ULTRA_CONDENSED
String value for input "ultra-condensed". |
static java.lang.String |
INPUT_ULTRA_EXPANDED
String value for input "ultra-expanded". |
static java.lang.String[] |
VALID_STRETCH_STRINGS
Array containing the valid font stretch input values, sorted alphabetically so that they can be binary searched. |
static Font.Stretch[] |
VALID_STRETCH_VALUES
Array containing the parsed font stretch values that correspond to the Strings in VALID_STRETCH_STRINGS . |
static java.lang.String[] |
VALID_WEIGHT_STRINGS
Array containing the valid font weight input values, sorted alphabetically so that they can be binary searched. |
static Font.Weight[] |
VALID_WEIGHT_VALUES
Array containing the parsed font weight values that correspond to the Strings in VALID_WEIGHT_STRINGS . |
Method Summary | |
---|---|
static java.lang.String[] |
cssFontFamily(java.lang.String input)
Converts a CSS2-style String input for font-family into a value expected by FontConsumer.selectFontCss(String[], Font.Style, Font.Weight,
Font.Variant, Font.Stretch, int, int) . |
static Font.Stretch |
cssFontStretch(java.lang.String input,
boolean lowerCaseOnly)
Converts a CSS2-style String input for font-stretch into a value expected by FontConsumer.selectFontCss(String[], Font.Style, Font.Weight,
Font.Variant, Font.Stretch, int, int) . |
static Font.Style |
cssFontStyle(java.lang.String input,
boolean lowerCaseOnly)
Converts a CSS2-style String input for font-style into a value expected by FontConsumer.selectFontCss(String[], Font.Style, Font.Weight,
Font.Variant, Font.Stretch, int, int) . |
static Font.Variant |
cssFontVariant(java.lang.String input,
boolean lowerCaseOnly)
Converts a CSS2-style String input for font-variant into a value expected by FontConsumer.selectFontCss(String[], Font.Style, Font.Weight,
Font.Variant, Font.Stretch, int, int) . |
static Font.Weight |
cssFontWeight(java.lang.String input,
boolean lowerCaseOnly)
Converts a CSS2-style String input for font-weight into a value expected by FontConsumer.selectFontCss(String[], Font.Style, Font.Weight,
Font.Variant, Font.Stretch, int, int) . |
static java.lang.String[] |
foFontFamily(java.lang.String input)
Same as cssFontFamily(String) , except input is an
XSL-FO-style String. |
static Font.SelectionStrategy |
foFontSelectionStrategy(java.lang.String input,
boolean lowerCaseOnly)
Converts XSL-FO String input for font-selection-strategy into a value expected by FontConsumer.selectFontXsl(Font.SelectionStrategy,
String[], Font.Style, Font.Weight, Font.Variant, Font.Stretch, int,
int) . |
static Font.Stretch |
foFontStretch(java.lang.String input,
boolean lowerCaseOnly)
Same as cssFontStretch(String, boolean) , except input is an
XSL-FO-style String. |
static Font.Style |
foFontStyle(java.lang.String input,
boolean lowerCaseOnly)
Same as cssFontStyle(String, boolean) , except input is an
XSL-FO-style String. |
static Font.Variant |
foFontVariant(java.lang.String input,
boolean lowerCaseOnly)
Same as cssFontVariant(String, boolean) , except input is an
XSL-FO-style String. |
static Font.Weight |
foFontWeight(java.lang.String input,
boolean lowerCaseOnly)
Same as cssFontWeight(String, boolean) , except input is an
XSL-FO-style String. |
static java.lang.String |
fontStretchName(Font.Stretch fontStretch)
Returns a String description for a numeric font-weight value, suitable for using in user messages. |
static java.lang.String |
fontStyleName(Font.Style fontStyle)
Returns a String description for a font-style value, suitable for using in user messages. |
static java.lang.String |
fontVariantName(Font.Variant fontVariant)
Returns a String description for a numeric font-weight value, suitable for using in user messages. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String INPUT_INVALID
public static final java.lang.String INPUT_NORMAL
public static final java.lang.String INPUT_ITALIC
public static final java.lang.String INPUT_OBLIQUE
public static final java.lang.String INPUT_BACKSLANT
public static final java.lang.String INPUT_SMALL_CAPS
public static final java.lang.String INPUT_ULTRA_CONDENSED
public static final java.lang.String INPUT_EXTRA_CONDENSED
public static final java.lang.String INPUT_CONDENSED
public static final java.lang.String INPUT_SEMI_CONDENSED
public static final java.lang.String INPUT_SEMI_EXPANDED
public static final java.lang.String INPUT_EXPANDED
public static final java.lang.String INPUT_EXTRA_EXPANDED
public static final java.lang.String INPUT_ULTRA_EXPANDED
public static final java.lang.String INPUT_100
public static final java.lang.String INPUT_200
public static final java.lang.String INPUT_300
public static final java.lang.String INPUT_400
public static final java.lang.String INPUT_500
public static final java.lang.String INPUT_600
public static final java.lang.String INPUT_700
public static final java.lang.String INPUT_800
public static final java.lang.String INPUT_900
public static final java.lang.String INPUT_BOLD
public static final java.lang.String[] EMPTY_STRING_ARRAY
public static final java.lang.String[] VALID_WEIGHT_STRINGS
VALID_WEIGHT_VALUES
.
public static final Font.Weight[] VALID_WEIGHT_VALUES
VALID_WEIGHT_STRINGS
.
public static final java.lang.String[] VALID_STRETCH_STRINGS
VALID_STRETCH_VALUES
.
public static final Font.Stretch[] VALID_STRETCH_VALUES
VALID_STRETCH_STRINGS
.
Method Detail |
---|
public static Font.SelectionStrategy foFontSelectionStrategy(java.lang.String input, boolean lowerCaseOnly)
FontConsumer.selectFontXsl(Font.SelectionStrategy,
String[], Font.Style, Font.Weight, Font.Variant, Font.Stretch, int,
int)
.
input
- The XSL-FO-style String to be converted.lowerCaseOnly
- Set to true to insist that all input values be
lowercase.
Font.SelectionStrategy.CHARACTER_BY_CHARACTER
or
Font.SelectionStrategy.AUTO
.
If the input is invalid, returns null.public static Font.Style cssFontStyle(java.lang.String input, boolean lowerCaseOnly)
FontConsumer.selectFontCss(String[], Font.Style, Font.Weight,
Font.Variant, Font.Stretch, int, int)
.
input
- The CSS2-style String to be converted.lowerCaseOnly
- Set to true to insist that all input values be
lowercase.
There is some ambiguity about whether CSS is case-sensitive or not. If
it is, all input should be lower case.
Font.Style.NORMAL
,
Font.Style.ITALIC
,
Font.Style.OBLIQUE
, or
Font.Style.BACKSLANT
.
For invalid input, return null.FontConsumer.selectFontCss(String[], Font.Style, Font.Weight,
Font.Variant, Font.Stretch, int, int)
public static Font.Style foFontStyle(java.lang.String input, boolean lowerCaseOnly)
cssFontStyle(String, boolean)
, except input is an
XSL-FO-style String.
input
- The XSL-FO-style String to be converted.lowerCaseOnly
- Set to true to insist that all input values be
lowercase.
There is some ambiguity about whether XSL-FO is case-sensitive or not. If
it is, all input should be lower case.
Font.Style.NORMAL
,
Font.Style.ITALIC
,
Font.Style.OBLIQUE
, or
Font.Style.BACKSLANT
.
For invalid input, returns null.cssFontStyle(String, boolean)
public static Font.Weight cssFontWeight(java.lang.String input, boolean lowerCaseOnly)
FontConsumer.selectFontCss(String[], Font.Style, Font.Weight,
Font.Variant, Font.Stretch, int, int)
.
input
- The CSS2-style String to be converted.lowerCaseOnly
- Set to true to insist that all input values be
lowercase.
There is some ambiguity about whether CSS is case-sensitive or not. If
it is, all input should be lower case.
Font.Weight.EXTREMELY_LIGHT
, Font.Weight.VERY_LIGHT
,
Font.Weight.LIGHT
, Font.Weight.NORMAL
,
Font.Weight.DARK
, Font.Weight.SEMI_BOLD
,
Font.Weight.BOLD
, Font.Weight.EXTRA_BOLD
, or
Font.Weight.BLACK
.
For invalid input, return null.FontConsumer.selectFontCss(String[], Font.Style, Font.Weight,
Font.Variant, Font.Stretch, int, int)
public static Font.Weight foFontWeight(java.lang.String input, boolean lowerCaseOnly)
cssFontWeight(String, boolean)
, except input is an
XSL-FO-style String.
input
- The XSL-FO-style String to be converted.lowerCaseOnly
- Set to true to insist that all input values be
lowercase.
There is some ambiguity about whether XSL-FO is case-sensitive or not. If
it is, all input should be lower case.
Font.Weight.EXTREMELY_LIGHT
, Font.Weight.VERY_LIGHT
,
Font.Weight.LIGHT
, Font.Weight.NORMAL
,
Font.Weight.DARK
, Font.Weight.SEMI_BOLD
,
Font.Weight.BOLD
, Font.Weight.EXTRA_BOLD
, or
Font.Weight.BLACK
.
For invalid input, return null.cssFontWeight(String, boolean)
public static Font.Variant cssFontVariant(java.lang.String input, boolean lowerCaseOnly)
FontConsumer.selectFontCss(String[], Font.Style, Font.Weight,
Font.Variant, Font.Stretch, int, int)
.
input
- The CSS2-style String to be converted.lowerCaseOnly
- Set to true to insist that all input values be
lowercase.
There is some ambiguity about whether CSS is case-sensitive or not. If
it is, all input should be lower case.
Font.Variant.NORMAL
or
Font.Variant.SMALL_CAPS
.
For invalid input, return null.FontConsumer.selectFontCss(String[], Font.Style, Font.Weight,
Font.Variant, Font.Stretch, int, int)
public static Font.Variant foFontVariant(java.lang.String input, boolean lowerCaseOnly)
cssFontVariant(String, boolean)
, except input is an
XSL-FO-style String.
input
- The XSL-FO-style String to be converted.lowerCaseOnly
- Set to true to insist that all input values be
lowercase.
There is some ambiguity about whether XSL-FO is case-sensitive or not. If
it is, all input should be lower case.
Font.Variant.NORMAL
or
Font.Variant.SMALL_CAPS
.
For invalid input, return null.cssFontVariant(String, boolean)
public static Font.Stretch cssFontStretch(java.lang.String input, boolean lowerCaseOnly)
FontConsumer.selectFontCss(String[], Font.Style, Font.Weight,
Font.Variant, Font.Stretch, int, int)
.
input
- The CSS2-style String to be converted.lowerCaseOnly
- Set to true to insist that all input values be
lowercase.
There is some ambiguity about whether CSS is case-sensitive or not. If
it is, all input should be lower case.
Font.Stretch.ULTRA_CONDENSED
,
Font.Stretch.EXTRA_CONDENSED
,
Font.Stretch.CONDENSED
,
Font.Stretch.SEMI_CONDENSED
,
Font.Stretch.NORMAL
,
Font.Stretch.SEMI_EXPANDED
,
Font.Stretch.EXPANDED
,
Font.Stretch.EXTRA_EXPANDED
,
Font.Stretch.ULTRA_EXPANDED
.
For invalid input, return null.FontConsumer.selectFontCss(String[], Font.Style, Font.Weight,
Font.Variant, Font.Stretch, int, int)
public static Font.Stretch foFontStretch(java.lang.String input, boolean lowerCaseOnly)
cssFontStretch(String, boolean)
, except input is an
XSL-FO-style String.
input
- The XSL-FO-style String to be converted.lowerCaseOnly
- Set to true to insist that all input values be
lowercase.
There is some ambiguity about whether XSL-FO is case-sensitive or not. If
it is, all input should be lower case.
Font.Stretch.ULTRA_CONDENSED
,
Font.Stretch.EXTRA_CONDENSED
,
Font.Stretch.CONDENSED
,
Font.Stretch.SEMI_CONDENSED
,
Font.Stretch.NORMAL
,
Font.Stretch.SEMI_EXPANDED
,
Font.Stretch.EXPANDED
,
Font.Stretch.EXTRA_EXPANDED
,
Font.Stretch.ULTRA_EXPANDED
.
For invalid input, return null.cssFontStretch(String, boolean)
public static java.lang.String[] cssFontFamily(java.lang.String input)
FontConsumer.selectFontCss(String[], Font.Style, Font.Weight,
Font.Variant, Font.Stretch, int, int)
.
input
- The CSS2-style font-family String to be converted.
This is a comma-delimited String containing one or more potential
font-family items to be selected. Consult the CSS2 standard for
details.
FontConsumer.selectFontCss(String[], Font.Style, Font.Weight,
Font.Variant, Font.Stretch, int, int)
public static java.lang.String[] foFontFamily(java.lang.String input)
cssFontFamily(String)
, except input is an
XSL-FO-style String.
input
- The XSL-FO font-family String to be converted.
This is a comma-delimited String containing one or more potential
font-family items to be selected. Consult the XSL-FO standard for
details.
cssFontFamily(String)
public static java.lang.String fontStyleName(Font.Style fontStyle)
fontStyle
- The Font.Style
instance for which
public static java.lang.String fontVariantName(Font.Variant fontVariant)
fontVariant
- One of Font.Variant.NORMAL
or
Font.Variant.SMALL_CAPS
.
public static java.lang.String fontStretchName(Font.Stretch fontStretch)
fontStretch
- One of
Font.Stretch.ULTRA_CONDENSED
,
Font.Stretch.EXTRA_CONDENSED
,
Font.Stretch.CONDENSED
,
Font.Stretch.SEMI_CONDENSED
,
Font.Stretch.NORMAL
,
Font.Stretch.SEMI_EXPANDED
,
Font.Stretch.EXPANDED
,
Font.Stretch.EXTRA_EXPANDED
, or
Font.Stretch.ULTRA_EXPANDED
.
|
aXSL API 0.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This documentation was created August 8 2007 by The aXSL Group and may be freely copied. See license for details.