BLFontFeatureSettings Class Referencefinal

Font feature settings [C++ API].

Member Functions

Construction & Destruction
Overloaded Operators
Common Functionality
Accessors
Equality & Comparison

Additional Inherited Members

- Public Attributes inherited from BLObjectCore

Member Function Documentation

bool BLFontFeatureSettings::empty() const◆ 

Tests whether the container is empty, which means that no tag/value pairs are stored in it.

size_t BLFontFeatureSettings::size() const◆ 

Returns the number of feature tag/value pairs stored in the container.

size_t BLFontFeatureSettings::capacity() const◆ 

Returns the container capacity

Note
If the container is in SSO mode, it would return the SSO capacity, however, such capacity can only be used for simple feature tag/value pairs. Some tags from these can only hold a boolean value (0 or 1) and ther others can hold a value from 0 to 15. So, if any tag/value pair requires a greater value than 15 it would never be able to use SSO representation.

BLResult BLFontFeatureSettings::getView(BLFontFeatureSettingsView* out) const◆ 

Returns a normalized view of tag/value pairs as an iterable BLFontFeatureItem array in the output view out.

Note
If the container is in SSO mode then all BLFontFeatureItem values will be created from the underlying SSO representation and BLFontFeatureSettingsView::data will point to BLFontFeatureSettingsView::ssoData. If the container is dynamic, BLFontFeatureSettingsView::ssoData won't be initialized and BLFontFeatureSettingsView::data will point to the container's data. This means that the view cannot outlive the container, and also during iteration the view the container cannot be modified as that coult invalidate the entire view.

bool BLFontFeatureSettings::hasValue(BLTag featureTag) const◆ 

Tests whether the settings contains the given featureTag.

uint32_t BLFontFeatureSettings::getValue(BLTag featureTag) const◆ 

Returns the value associated with the given featureTag.

If the featureTag doesn't exist or is invalid BL_FONT_FEATURE_INVALID_VALUE is returned.

BLResult BLFontFeatureSettings::setValue(BLTag featureTag, uint32_t value)◆ 

Sets or inserts the given featureTag to the settings, associating the featureTag with value.

The featureTag must be valid, which means that it must contain 4 characters within ' ' to '~' range - [32, 126] in ASCII. If the given featureTag is not valid or value is out of range (maximum value is 65535) BL_ERROR_INVALID_VALUE is returned.

The following tags only support values that are either 0 (disabled) or 1 (enabled):

  • 'case'
  • 'clig'
  • 'cpct'
  • 'cpsp'
  • 'dlig'
  • 'dnom'
  • 'expt'
  • 'falt'
  • 'frac'
  • 'fwid'
  • 'halt'
  • 'hist'
  • 'hwid'
  • 'jalt'
  • 'kern'
  • 'liga'
  • 'lnum'
  • 'onum'
  • 'ordn'
  • 'palt'
  • 'pcap'
  • 'ruby'
  • 'smcp'
  • 'subs'
  • 'sups'
  • 'titl'
  • 'tnam'
  • 'tnum'
  • 'unic'
  • 'valt'
  • 'vkrn'
  • 'zero'

Trying to use any other value with these tags would fail with BL_ERROR_INVALID_VALUE error.

BLResult BLFontFeatureSettings::removeValue(BLTag featureTag)◆ 

Removes the given featureTag and its associated value from the settings.

Nothing happens if the featureTag is not in the settings (BL_SUCCESS is returned).

bool BLFontFeatureSettings::equals(const BLFontFeatureSettings& other) const◆ 

Tests whether this font feature settings is equal to other - equality means that it has the same tag/value pairs.