FontFeature

Inheritance: java.lang.Object

public class FontFeature

Features provide information about how glyphs are used in a font to render a script. https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags

Fields

FieldDescription
CONTEXTUAL_LIGATURESReplaces a sequence of glyphs with a single glyph which is preferred for typographic purposes.
DISCRETIONARY_LIGATURESReplaces a sequence of glyphs with a single glyph which is preferred for typographic purposes.
GLYPH_COMPOSITION_DECOMPOSITIONTo minimize the number of glyph alternates, it is sometimes desirable to decompose the default glyph for a character into two or more glyphs.
HISTORICAL_LIGATURESSome ligatures were in common use in the past, but appear anachronistic today.
KERNINGAdjusts amount of space between glyphs, generally to provide optically consistent spacing between glyphs.
LINING_FIGURESThis feature changes selected non-lining figures to lining figures.
OLDSTYLE_FIGURESThis feature changes selected figures from the default or lining style to oldstyle form.
PROPORTIONAL_FIGURESReplaces figure glyphs set on uniform (tabular) widths with corresponding glyphs set on glyph-specific (proportional) widths.
REQUIRED_LIGATURESReplaces a sequence of glyphs with a single glyph which is preferred for typographic purposes.
STANDARD_LIGATURESReplaces a sequence of glyphs with a single glyph which is preferred for typographic purposes.
STYLISTIC_SET_01Stylistic Set 1 In addition to, or instead of, stylistic alternatives of individual glyphs (see ‘salt’ feature), some fonts may contain sets of stylistic variant glyphs corresponding to portions of the character set, e.g.
STYLISTIC_SET_02Stylistic Set 2 Equivalent OpenType tag: ‘ss02’
STYLISTIC_SET_03Stylistic Set 3 Equivalent OpenType tag: ‘ss03’
STYLISTIC_SET_04Stylistic Set 4 Equivalent OpenType tag: ‘ss04’
STYLISTIC_SET_05Stylistic Set 5 Equivalent OpenType tag: ‘ss05’
STYLISTIC_SET_06Stylistic Set 6 Equivalent OpenType tag: ‘ss06’
STYLISTIC_SET_07Stylistic Set 7 Equivalent OpenType tag: ‘ss07’
STYLISTIC_SET_08Stylistic Set 8 Equivalent OpenType tag: ‘ss08’
STYLISTIC_SET_09Stylistic Set 9 Equivalent OpenType tag: ‘ss09’
STYLISTIC_SET_10Stylistic Set 10 Equivalent OpenType tag: ‘ss10’
STYLISTIC_SET_11Stylistic Set 11 Equivalent OpenType tag: ‘ss11’
STYLISTIC_SET_12Stylistic Set 12 Equivalent OpenType tag: ‘ss12’
STYLISTIC_SET_13Stylistic Set 13 Equivalent OpenType tag: ‘ss13’
STYLISTIC_SET_14Stylistic Set 14 Equivalent OpenType tag: ‘ss14’
STYLISTIC_SET_15Stylistic Set 15 Equivalent OpenType tag: ‘ss15’
STYLISTIC_SET_16Stylistic Set 16 Equivalent OpenType tag: ‘ss16’
STYLISTIC_SET_17Stylistic Set 17 Equivalent OpenType tag: ‘ss17’
STYLISTIC_SET_18Stylistic Set 18 Equivalent OpenType tag: ‘ss18’
STYLISTIC_SET_19Stylistic Set 19 Equivalent OpenType tag: ‘ss19’
STYLISTIC_SET_20Stylistic Set 20 Equivalent OpenType tag: ‘ss20’
TABULAR_FIGURESReplaces figure glyphs set on proportional widths with corresponding glyphs set on uniform (tabular) widths.
VERTICAL_ALTERNATESTransforms default glyphs into glyphs that are appropriate for upright presentation in vertical writing mode.
VERTICAL_ALTERNATES_AND_ROTATIONReplaces some fixed-width (half-, third- or quarter-width) or proportional-width glyphs (mostly Latin or katakana) with forms suitable for vertical writing (that is, rotated 90 degrees clockwise).
length

Methods

MethodDescription
fromName(String fontFeatureName)
getName(int fontFeature)
getValues()
toString(int fontFeature)

CONTEXTUAL_LIGATURES

public static int CONTEXTUAL_LIGATURES

Replaces a sequence of glyphs with a single glyph which is preferred for typographic purposes. Unlike other ligature features, ‘clig’ specifies the context in which the ligature is recommended. This capability is important in some script designs and for swash ligatures. https://docs.microsoft.com/en-us/typography/opentype/spec/features_ae#clig Equivalent OpenType tag: ‘clig’

DISCRETIONARY_LIGATURES

public static int DISCRETIONARY_LIGATURES

Replaces a sequence of glyphs with a single glyph which is preferred for typographic purposes. This feature covers those ligatures which may be used for special effect, at the user\u2019s preference. https://docs.microsoft.com/en-us/typography/opentype/spec/features_ae#dlig Equivalent OpenType tag: ‘dlig’

GLYPH_COMPOSITION_DECOMPOSITION

public static int GLYPH_COMPOSITION_DECOMPOSITION

To minimize the number of glyph alternates, it is sometimes desirable to decompose the default glyph for a character into two or more glyphs. Additionally, it may be preferable to compose default glyphs for two or more characters into a single glyph for better glyph processing. This feature permits such composition/decomposition. https://docs.microsoft.com/en-us/typography/opentype/spec/features_ae#ccmp Equivalent OpenType tag: ‘ccmp’

HISTORICAL_LIGATURES

public static int HISTORICAL_LIGATURES

Some ligatures were in common use in the past, but appear anachronistic today. Some fonts include the historical forms as alternates, so they can be used for a “period” effect. This feature replaces the default (current) forms with the historical alternates. https://docs.microsoft.com/en-us/typography/opentype/spec/features_fj#hlig Equivalent OpenType tag: ‘hlig’

KERNING

public static int KERNING

Adjusts amount of space between glyphs, generally to provide optically consistent spacing between glyphs. Although a well-designed typeface has consistent inter-glyph spacing overall, some glyph combinations require adjustment for improved legibility. Besides standard adjustment in the horizontal direction, this feature can supply size-dependent kerning data via device tables, “cross-stream” kerning in the Y text direction, and adjustment of glyph placement independent of the advance adjustment. Note that this feature may apply to runs of more than two glyphs, and would not be used in monospaced fonts. Also note that this feature does not apply to text set vertically. https://docs.microsoft.com/en-us/typography/opentype/spec/features_ko#kern Equivalent OpenType tag: ‘kern’

LINING_FIGURES

public static int LINING_FIGURES

This feature changes selected non-lining figures to lining figures. https://docs.microsoft.com/en-us/typography/opentype/spec/features_ko#lnum Equivalent OpenType tag: ’lnum’

OLDSTYLE_FIGURES

public static int OLDSTYLE_FIGURES

This feature changes selected figures from the default or lining style to oldstyle form. https://docs.microsoft.com/en-us/typography/opentype/spec/features_ko#onum Equivalent OpenType tag: ‘onum’

PROPORTIONAL_FIGURES

public static int PROPORTIONAL_FIGURES

Replaces figure glyphs set on uniform (tabular) widths with corresponding glyphs set on glyph-specific (proportional) widths. https://docs.microsoft.com/en-us/typography/opentype/spec/features_pt#tag-pnum Equivalent OpenType tag: ‘pnum’

REQUIRED_LIGATURES

public static int REQUIRED_LIGATURES

Replaces a sequence of glyphs with a single glyph which is preferred for typographic purposes. This feature covers those ligatures, which the script determines as required to be used in normal conditions. This feature is important for some scripts to ensure correct glyph formation. https://docs.microsoft.com/en-us/typography/opentype/spec/features_pt#rlig Equivalent OpenType tag: ‘rlig’

STANDARD_LIGATURES

public static int STANDARD_LIGATURES

Replaces a sequence of glyphs with a single glyph which is preferred for typographic purposes. This feature covers the ligatures which the designer/manufacturer judges should be used in normal conditions. Equivalent OpenType tag: ’liga’ https://docs.microsoft.com/en-us/typography/opentype/spec/features_ko#liga

STYLISTIC_SET_01

public static int STYLISTIC_SET_01

Stylistic Set 1 In addition to, or instead of, stylistic alternatives of individual glyphs (see ‘salt’ feature), some fonts may contain sets of stylistic variant glyphs corresponding to portions of the character set, e.g. multiple variants for lowercase letters in a Latin font. https://docs.microsoft.com/en-us/typography/opentype/spec/features_pt#tag-ss01—ss20 Equivalent OpenType tag: ‘ss01’

STYLISTIC_SET_02

public static int STYLISTIC_SET_02

Stylistic Set 2 Equivalent OpenType tag: ‘ss02’

STYLISTIC_SET_03

public static int STYLISTIC_SET_03

Stylistic Set 3 Equivalent OpenType tag: ‘ss03’

STYLISTIC_SET_04

public static int STYLISTIC_SET_04

Stylistic Set 4 Equivalent OpenType tag: ‘ss04’

STYLISTIC_SET_05

public static int STYLISTIC_SET_05

Stylistic Set 5 Equivalent OpenType tag: ‘ss05’

STYLISTIC_SET_06

public static int STYLISTIC_SET_06

Stylistic Set 6 Equivalent OpenType tag: ‘ss06’

STYLISTIC_SET_07

public static int STYLISTIC_SET_07

Stylistic Set 7 Equivalent OpenType tag: ‘ss07’

STYLISTIC_SET_08

public static int STYLISTIC_SET_08

Stylistic Set 8 Equivalent OpenType tag: ‘ss08’

STYLISTIC_SET_09

public static int STYLISTIC_SET_09

Stylistic Set 9 Equivalent OpenType tag: ‘ss09’

STYLISTIC_SET_10

public static int STYLISTIC_SET_10

Stylistic Set 10 Equivalent OpenType tag: ‘ss10’

STYLISTIC_SET_11

public static int STYLISTIC_SET_11

Stylistic Set 11 Equivalent OpenType tag: ‘ss11’

STYLISTIC_SET_12

public static int STYLISTIC_SET_12

Stylistic Set 12 Equivalent OpenType tag: ‘ss12’

STYLISTIC_SET_13

public static int STYLISTIC_SET_13

Stylistic Set 13 Equivalent OpenType tag: ‘ss13’

STYLISTIC_SET_14

public static int STYLISTIC_SET_14

Stylistic Set 14 Equivalent OpenType tag: ‘ss14’

STYLISTIC_SET_15

public static int STYLISTIC_SET_15

Stylistic Set 15 Equivalent OpenType tag: ‘ss15’

STYLISTIC_SET_16

public static int STYLISTIC_SET_16

Stylistic Set 16 Equivalent OpenType tag: ‘ss16’

STYLISTIC_SET_17

public static int STYLISTIC_SET_17

Stylistic Set 17 Equivalent OpenType tag: ‘ss17’

STYLISTIC_SET_18

public static int STYLISTIC_SET_18

Stylistic Set 18 Equivalent OpenType tag: ‘ss18’

STYLISTIC_SET_19

public static int STYLISTIC_SET_19

Stylistic Set 19 Equivalent OpenType tag: ‘ss19’

STYLISTIC_SET_20

public static int STYLISTIC_SET_20

Stylistic Set 20 Equivalent OpenType tag: ‘ss20’

TABULAR_FIGURES

public static int TABULAR_FIGURES

Replaces figure glyphs set on proportional widths with corresponding glyphs set on uniform (tabular) widths. Tabular widths will generally be the default, but this cannot be safely assumed. Of course this feature would not be present in monospaced designs. https://docs.microsoft.com/en-us/typography/opentype/spec/features_pt#tag-tnum Equivalent OpenType tag: ’tnum’

VERTICAL_ALTERNATES

public static int VERTICAL_ALTERNATES

Transforms default glyphs into glyphs that are appropriate for upright presentation in vertical writing mode. https://docs.microsoft.com/en-us/typography/opentype/spec/features_uz#tag-vert Equivalent OpenType tag: ‘vert’

VERTICAL_ALTERNATES_AND_ROTATION

public static int VERTICAL_ALTERNATES_AND_ROTATION

Replaces some fixed-width (half-, third- or quarter-width) or proportional-width glyphs (mostly Latin or katakana) with forms suitable for vertical writing (that is, rotated 90 degrees clockwise). https://docs.microsoft.com/en-us/typography/opentype/spec/features_uz#tag-vrt2 Equivalent OpenType tag: ‘vrt2’

length

public static int length

fromName(String fontFeatureName)

public static int fromName(String fontFeatureName)

Parameters:

ParameterTypeDescription
fontFeatureNamejava.lang.String

Returns: int

getName(int fontFeature)

public static String getName(int fontFeature)

Parameters:

ParameterTypeDescription
fontFeatureint

Returns: java.lang.String

getValues()

public static int[] getValues()

Returns: int[]

toString(int fontFeature)

public static String toString(int fontFeature)

Parameters:

ParameterTypeDescription
fontFeatureint

Returns: java.lang.String