BLFontFace Class Referencefinal

Font face [C++ API].

Member Functions

Construction & Destruction
Overloaded Operators
Common Functionality
Create Functionality
Properties

Additional Inherited Members

- Public Attributes inherited from BLObjectCore

Member Function Documentation

bool BLFontFace::isValid() const◆ 

Tests whether the font face is valid.

bool BLFontFace::empty() const◆ 

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

BLResult BLFontFace::createFromFile(const char* fileName, BLFileReadFlags readFlags = BL_FILE_READ_NO_FLAGS)◆ 

Creates a new BLFontFace from a file specified by fileName.

This is a utility function that first creates a BLFontData and then calls createFromData(fontData, 0). See BLFontData::createFromFile() for more details, especially the use of readFlags is important for system fonts.

Note
This function offers a simplified creation of BLFontFace directly from a file, but doesn't provide as much flexibility as createFromData() as it allows to specify a faceIndex, which can be used to load multiple font faces from a TrueType/OpenType collection. The use of createFromData() is recommended for any serious font handling.

BLResult BLFontFace::createFromData(const BLFontDataCore& fontData, uint32_t faceIndex)◆ 

Creates a new BLFontFace from BLFontData at the given faceIndex.

On success the existing BLFontFace is completely replaced by a new one, on failure an error is returned in BLResult and the existing BLFontFace is kept as is.

uint32_t BLFontFace::weight() const◆ 

Returns font weight (returns default weight in case this is a variable font).

uint32_t BLFontFace::stretch() const◆ 

Returns font stretch (returns default weight in case this is a variable font).

uint32_t BLFontFace::style() const◆ 

Returns font style.

const BLFontFaceInfo& BLFontFace::faceInfo() const◆ 

Returns font face information as BLFontFaceInfo.

BLFontFaceType BLFontFace::faceType() const◆ 

Returns the font face type.

BLFontOutlineType BLFontFace::outlineType() const◆ 

Returns the font face type.

uint32_t BLFontFace::glyphCount() const◆ 

Returns the number of glyphs this font face provides.

uint32_t BLFontFace::faceIndex() const◆ 

Returns a zero-based index of this font face.

Note
Face index does only make sense if this face is part of a TrueType or OpenType font collection. In that case the returned value would be the index of this face in that collection. If the face is not part of a collection then the returned value would always be zero.

BLFontFaceFlags BLFontFace::faceFlags() const◆ 

Returns font face flags.

bool BLFontFace::hasFaceFlag(BLFontFaceFlags flag) const◆ 

Tests whether the font face has a given flag set.

bool BLFontFace::hasTypographicNames() const◆ 

Tests whether the font face uses typographic family and subfamily names.

bool BLFontFace::hasTypographicMetrics() const◆ 

Tests whether the font face uses typographic metrics.

bool BLFontFace::hasCharToGlyphMapping() const◆ 

Tests whether the font face provides character to glyph mapping.

bool BLFontFace::hasHorizontalMetrics() const◆ 

Tests whether the font face has horizontal glyph metrics (advances, side bearings).

bool BLFontFace::hasVerticalMetrics() const◆ 

Tests whether the font face has vertical glyph metrics (advances, side bearings).

bool BLFontFace::hasHorizontalKerning() const◆ 

Tests whether the font face has a legacy horizontal kerning feature ('kern' table with horizontal kerning data).

bool BLFontFace::hasVerticalKerning() const◆ 

Tests whether the font face has a legacy vertical kerning feature ('kern' table with vertical kerning data).

bool BLFontFace::hasOpenTypeFeatures() const◆ 

Tests whether the font face has OpenType features (GDEF, GPOS, GSUB).

bool BLFontFace::hasPanoseData() const◆ 

Tests whether the font face has panose classification.

bool BLFontFace::hasUnicodeCoverage() const◆ 

Tests whether the font face has unicode coverage information.

bool BLFontFace::hasBaselineYAt0() const◆ 

Tests whether the font face's baseline equals 0.

bool BLFontFace::hasLSBPointXAt0() const◆ 

Tests whether the font face's left sidebearing point at x equals 0.

bool BLFontFace::hasVariationSequences() const◆ 

Tests whether the font face has unicode variation sequences feature.

bool BLFontFace::hasOpenTypeVariations() const◆ 

Tests whether the font face has OpenType Font Variations feature.

bool BLFontFace::isSymbolFont() const◆ 

This is a symbol font.

bool BLFontFace::isLastResortFont() const◆ 

This is a last resort font.

BLFontFaceDiagFlags BLFontFace::diagFlags() const◆ 

Returns font face diagnostics flags.

BLUniqueId BLFontFace::uniqueId() const◆ 

Returns a unique identifier describing this BLFontFace.

const BLFontData& BLFontFace::data() const◆ 

Returns BLFontData associated with this font face.

const BLString& BLFontFace::fullName() const◆ 

Returns a full of the font.

const BLString& BLFontFace::familyName() const◆ 

Returns a family name of the font.

const BLString& BLFontFace::subfamilyName() const◆ 

Returns a subfamily name of the font.

const BLString& BLFontFace::postScriptName() const◆ 

Returns a PostScript name of the font.

const BLFontDesignMetrics& BLFontFace::designMetrics() const◆ 

Returns design metrics of this BLFontFace.

int BLFontFace::unitsPerEm() const◆ 

Returns units per em, which are part of font's design metrics.

const BLFontPanose& BLFontFace::panose() const◆ 

Returns PANOSE classification of this BLFontFace.

const BLFontUnicodeCoverage& BLFontFace::unicodeCoverage() const◆ 

Returns unicode coverage of this BLFontFace.

Note
The returned unicode-coverage is not calculated by Blend2D so in general the value doesn't have to be correct. Consider getCharacterCoverage() to get a coverage calculated by Blend2D at character granularity.

BLResult BLFontFace::getCharacterCoverage(BLBitSetCore* out) const◆ 

Calculates the character coverage of this BLFontFace.

Each unicode character is represented by a single bit in the given BitSet.

bool BLFontFace::hasScriptTag(BLTag scriptTag) const◆ 

Tests whether the font face provides the given OpenType scriptTag.

bool BLFontFace::hasFeatureTag(BLTag featureTag) const◆ 

Tests whether the font face provides the given OpenType featureTag.

bool BLFontFace::hasVariationTag(BLTag variationTag) const◆ 

Tests whether the font face provides the given OpenType variationTag.

BLResult BLFontFace::getScriptTags(BLArray<BLTag>* out) const◆ 

Retrieves OpenType script tags provided by this BLFontFace.

Each script tag is represented by 4 characters encoded in BLTag.

BLResult BLFontFace::getFeatureTags(BLArray<BLTag>* out) const◆ 

Retrieves OpenType feature tags provided by this BLFontFace.

Each feature tag is represented by 4 characters encoded in BLTag.

Feature tag registry:

BLResult BLFontFace::getVariationTags(BLArray<BLTag>* out) const◆ 

Retrieves OpenType variation tags provided by this BLFontFace.

Each variation tag is represented by 4 characters encoded in BLTag.

Variation tag registry: