IndexTextBLFontFeatureSettings

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

bool BLFontFeatureSettings::is_empty() constnodiscardnoexcept[¶]

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

size_t BLFontFeatureSettings::size() constnodiscardnoexcept[¶]

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

size_t BLFontFeatureSettings::capacity() constnodiscardnoexcept[¶]

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::get_view() constnoexcept[¶]

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::sso_data. If the container is dynamic, BLFontFeatureSettingsView::sso_data 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 could invalidate the entire view.

bool BLFontFeatureSettings::has_value(
BLTag feature_tag
) constnodiscardnoexcept[¶]

Tests whether the settings contains the given feature_tag.

uint32_t BLFontFeatureSettings::get_value(
BLTag feature_tag
) constnodiscardnoexcept[¶]

Returns the value associated with the given feature_tag.

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

BLResult BLFontFeatureSettings::set_value(
BLTag feature_tag,
uint32_t value
)noexcept[¶]

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

The feature_tag must be valid, which means that it must contain 4 characters within ' ' to '~' range - [32, 126] in ASCII. If the given feature_tag 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::remove_value(
BLTag feature_tag
)noexcept[¶]

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

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

bool BLFontFeatureSettings::equals() constnodiscardnoexcept[¶]

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