BLFontFace Class Reference

Font face [C++ API].

Member Functions

Construction & Destruction
Overloaded Operators
Common Functionality
Create Functionality
Properties

Static Functions

Additional Inherited Members

- Public Attributes inherited from BLFontFaceCore

Member Function Documentation

bool BLFontFace::isNone() const

Tests whether the font-face is a built-in null instance.

bool BLFontFace::empty() const

Tests whether the font-face is empty (which the same as isNone() in this case).

BLResult BLFontFace::createFromFile(const char* fileName, uint32_t readFlags = 0)

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 BLFontData& 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 a BLResult is returned and the existing BLFontFace is kept as is. In other words, it either succeeds and replaces the BLFontFaceImpl or returns an error without touching the existing one.

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.

uint32_t BLFontFace::faceType() const

Returns the font-face type, see BLFontFaceType.

uint32_t BLFontFace::outlineType() const

Returns the font-face type, see BLFontOutlineType.

uint32_t BLFontFace::glyphCount() const

Returns the number of glyphs of this font-face.

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.

uint32_t BLFontFace::faceFlags() const

Returns font-face flags, see BLFontFaceFlags.

bool BLFontFace::hasFaceFlag(uint32_t 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.

uint32_t BLFontFace::diagFlags() const

Returns font-face diagnostics flags, see BLFontFaceDiagFlags.

BLUniqueId BLFontFace::uniqueId() const

Returns a unique identifier describing this BLFontFace.

const BLFontData& BLFontFace::data() const

Returns BLFontData associated with this font-face.

const char* BLFontFace::fullName() const

Returns the font full name as UTF-8 null-terminated string.

size_t BLFontFace::fullNameSize() const

Returns the size of the string returned by fullName().

const BLStringView& BLFontFace::fullNameView() const

Returns the font full name as a UTF-8 string view.

const char* BLFontFace::familyName() const

Returns the family name as UTF-8 null-terminated string.

size_t BLFontFace::familyNameSize() const

Returns the size of the string returned by familyName().

const BLStringView& BLFontFace::familyNameView() const

Returns the family-name as a UTF-8 string view.

const char* BLFontFace::subfamilyName() const

Returns the font subfamily name as UTF-8 null-terminated string.

size_t BLFontFace::subfamilyNameSize() const

Returns the size of the string returned by subfamilyName().

const BLStringView& BLFontFace::subfamilyNameView() const

Returns the font subfamily-name as a UTF-8 string view.

const char* BLFontFace::postScriptName() const

Returns the font PostScript name as UTF-8 null-terminated string.

size_t BLFontFace::postScriptNameSize() const

Returns the size of the string returned by postScriptName().

const BLStringView& BLFontFace::postScriptNameView() const

Returns the font PostScript name as a UTF-8 string view.

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. Use getCharacterCoverage() to get a coverage calculated by Blend2D at character granularity.