Loading...
Searching...
No Matches
FontFeatureTag Class Referencefinal

Represents a single OpenType font feature. More...

Public Member Functions

constexpr FontFeatureTag (const char(&string)[5])
 Constructs a feature from the specified tag string.
 
constexpr FontFeatureTag (uint32 tagValue)
 Constructs a feature from the specified tag value.
 
String toString () const
 Returns a string representation of this tag.
 
constexpr uint32 getTag () const
 Returns the Harfbuzz compatible OpenType tag as an unsigned 32-bit integer.
 
constexpr bool operator< (FontFeatureTag other) const
 Comparison based on tag value.
 
constexpr bool operator<= (FontFeatureTag other) const
 Comparison based on tag value.
 
constexpr bool operator> (FontFeatureTag other) const
 Comparison based on tag value.
 
constexpr bool operator>= (FontFeatureTag other) const
 Comparison based on tag value.
 
constexpr bool operator== (FontFeatureTag other) const
 Comparison based on tag value.
 
constexpr bool operator!= (FontFeatureTag other) const
 Comparison based on tag value.
 

Static Public Member Functions

static FontFeatureTag fromString (const String &tagString)
 Creates a new FontFeature with the specified tag.
 

Detailed Description

Represents a single OpenType font feature.

OpenType font features are typographic options that can be enabled or disabled to control text rendering behavior. Each feature is identified by a four-character tag (like 'liga' for standard ligatures or 'smcp' for small caps). These features allow fine-grained control over how text is displayed, including ligatures, number styles, stylistic alternates, and positioning adjustments.

The tag must be exactly 4 characters long.

See also
FontOptions, Font

Constructor & Destructor Documentation

◆ FontFeatureTag() [1/2]

FontFeatureTag::FontFeatureTag ( const char(&) string[5])
constexpr

Constructs a feature from the specified tag string.

Referenced by fromString(), operator!=(), operator<(), operator<=(), operator==(), operator>(), and operator>=().

◆ FontFeatureTag() [2/2]

FontFeatureTag::FontFeatureTag ( uint32 tagValue)
explicitconstexpr

Constructs a feature from the specified tag value.

Member Function Documentation

◆ fromString()

static FontFeatureTag FontFeatureTag::fromString ( const String & tagString)
staticnodiscard

Creates a new FontFeature with the specified tag.

References FontFeatureTag().

◆ toString()

String FontFeatureTag::toString ( ) const

Returns a string representation of this tag.

◆ getTag()

uint32 FontFeatureTag::getTag ( ) const
constexpr

Returns the Harfbuzz compatible OpenType tag as an unsigned 32-bit integer.

◆ operator<()

bool FontFeatureTag::operator< ( FontFeatureTag other) const
nodiscardconstexpr

Comparison based on tag value.

References FontFeatureTag().

◆ operator<=()

bool FontFeatureTag::operator<= ( FontFeatureTag other) const
nodiscardconstexpr

Comparison based on tag value.

References FontFeatureTag().

◆ operator>()

bool FontFeatureTag::operator> ( FontFeatureTag other) const
nodiscardconstexpr

Comparison based on tag value.

References FontFeatureTag().

◆ operator>=()

bool FontFeatureTag::operator>= ( FontFeatureTag other) const
nodiscardconstexpr

Comparison based on tag value.

References FontFeatureTag().

◆ operator==()

bool FontFeatureTag::operator== ( FontFeatureTag other) const
nodiscardconstexpr

Comparison based on tag value.

References FontFeatureTag().

◆ operator!=()

bool FontFeatureTag::operator!= ( FontFeatureTag other) const
nodiscardconstexpr

Comparison based on tag value.

References FontFeatureTag().

linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram