BLFont Class Referencefinal

Font [C++ API].

Member Functions

Construction & Destruction
Overloaded Operators
Common Functionality
Create Functionality
Accessors
Glyphs & Text

Additional Inherited Members

- Public Attributes inherited from BLObjectCore

Member Function Documentation

bool BLFont::isValid() const◆ 

Tests whether the font is a valid instance.

bool BLFont::empty() const◆ 

Tests whether the font is empty, which is the same as !isValid().

BLResult BLFont::createFromFace(const BLFontFaceCore& face, float size)[1/3]◆ 

Creates a new font from the existing font face scaled to the given size.

BLResult BLFont::createFromFace(const BLFontFaceCore& face, float size, const BLFontFeatureSettingsCore& featureSettings)[2/3]◆ 

Creates a new font from the existing font face scaled to the given size.

This is an overloaded function that takes additional argument `featureSettings.

BLResult BLFont::createFromFace(const BLFontFaceCore& face, float size, const BLFontFeatureSettingsCore& featureSettings, const BLFontVariationSettingsCore& variationSettings)[3/3]◆ 

Creates a new font from the existing font face scaled to the given size.

This is an overloaded function that takes additional arguments, which are used to override font featureSettings and font variationSettings.

BLFontFaceType BLFont::faceType() const◆ 

Returns the type of the font's associated font face.

BLFontFaceFlags BLFont::faceFlags() const◆ 

Returns the flags of the font.

float BLFont::size() const◆ 

Returns the size of the font (as float).

BLResult BLFont::setSize(float size)◆ 

Sets the font size to size.

const BLFontFace& BLFont::face() const◆ 

Returns the font's associated font face.

Returns the same font face, which was passed to createFromFace().

uint32_t BLFont::weight() const◆ 

Returns the weight of the font.

uint32_t BLFont::stretch() const◆ 

Returns the stretch of the font.

uint32_t BLFont::style() const◆ 

Returns the style of the font.

int BLFont::unitsPerEm() const◆ 

Returns the "units per em" (UPEM) of the font's associated font face.

const BLFontMatrix& BLFont::matrix() const◆ 

Returns a 2x2 matrix of the font.

The returned BLFontMatrix is used to scale fonts from design units into user units. The matrix usually has a negative m11 member as fonts use a different coordinate system than Blend2D.

const BLFontMetrics& BLFont::metrics() const◆ 

Returns the scaled metrics of the font.

The returned metrics is a scale of design metrics that match the font size and its options.

const BLFontDesignMetrics& BLFont::designMetrics() const◆ 

Returns the design metrics of the font.

The returned metrics is compatible with the metrics of BLFontFace associated with this font.

const BLFontFeatureSettings& BLFont::featureSettings() const◆ 

Returns font feature settings.

BLResult BLFont::setFeatureSettings(const BLFontFeatureSettingsCore& featureSettings)◆ 

Sets font feature settings to featureSettings.

BLResult BLFont::resetFeatureSettings()◆ 

Resets font feature settings.

const BLFontVariationSettings& BLFont::variationSettings() const◆ 

Returns font variation settings.

BLResult BLFont::setVariationSettings(const BLFontVariationSettingsCore& variationSettings)◆ 

Sets font variation settings to variationSettings.

BLResult BLFont::resetVariationSettings()◆ 

Resets font variation settings.