BLFontFace Class Reference

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 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 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.

BLFontFaceType BLFontFace::faceType() const

Returns the font-face type, see BLFontFaceType.

BLFontOutlineType 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.

BLFontFaceFlags BLFontFace::faceFlags() const

Returns font-face flags, see BLFontFaceFlags.

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, 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 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. Use 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.