IndexTextBLFont

BLFont Class Referencefinal [¶]

Font [C++ API].

Member Functions

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

! !

inline BLResult shape(BLGlyphBufferCore& gb) const noexcept { return bl_font_shape(this, &gb); }

inline BLResult map_text_to_glyphs(BLGlyphBufferCore& gb) const noexcept { return bl_font_map_text_to_glyphs(this, &gb, nullptr); }

inline BLResult map_text_to_glyphs(BLGlyphBufferCore& gb, BLGlyphMappingState& state_out) const noexcept { return bl_font_map_text_to_glyphs(this, &gb, &state_out); }

inline BLResult position_glyphs(BLGlyphBufferCore& gb) const noexcept { return bl_font_position_glyphs(this, &gb); }

inline BLResult apply_kerning(BLGlyphBufferCore& gb) const noexcept { return bl_font_apply_kerning(this, &gb); }

inline BLResult apply_gsub(BLGlyphBufferCore& gb, const BLBitArrayCore& lookups) const noexcept { return bl_font_apply_gsub(this, &gb, &lookups); }

inline BLResult apply_gpos(BLGlyphBufferCore& gb, const BLBitArrayCore& lookups) const noexcept { return bl_font_apply_gpos(this, &gb, &lookups); }

inline BLResult get_text_metrics(BLGlyphBufferCore& gb, BLTextMetrics& out) const noexcept { return bl_font_get_text_metrics(this, &gb, &out); }

inline BLResult get_glyph_bounds(const uint32_t* glyph_data, intptr_t glyph_advance, BLBoxI* out, size_t count) const noexcept { return bl_font_get_glyph_bounds(this, glyph_data, glyph_advance, out, count); }

inline BLResult get_glyph_advances(const uint32_t* glyph_data, intptr_t glyph_advance, BLGlyphPlacement* out, size_t count) const noexcept { return bl_font_get_glyph_advances(this, glyph_data, glyph_advance, out, count); }

! Retrieves outlines of a single glyph into the out path. ! ! Optionally, a user can provide a sink function with user_data, which will be called periodically by the ! glyph outline decoder. The sink can be used to immediately process the outline to prevent accumulating a ! large path in out. inline BLResult get_glyph_outlines(BLGlyphId glyph_id, BLPathCore& out, BLPathSinkFunc sink = nullptr, void* user_data = nullptr) const noexcept { return bl_font_get_glyph_outlines(this, glyph_id, nullptr, &out, sink, user_data); }

! Retrieves outlines of a single glyph into the out path transformed by user_transform. ! ! Optionally, a user can provide a sink function with user_data, which will be called periodically by the ! glyph outline decoder. The sink can be used to immediately process the outline to prevent accumulating a ! large path in out. inline BLResult get_glyph_outlines(BLGlyphId glyph_id, const BLMatrix2D& user_transform, BLPathCore& out, BLPathSinkFunc sink = nullptr, void* user_data = nullptr) const noexcept { return bl_font_get_glyph_outlines(this, glyph_id, &user_transform, &out, sink, user_data); }

! Retrieves outlines of a glyph run into the out path. ! ! Optionally, a user can provide a sink function with user_data, which will be called periodically by the ! glyph outline decoder. The sink can be used to immediately process the outline to prevent accumulating a ! large path in out. inline BLResult get_glyph_run_outlines(const BLGlyphRun& glyph_run, BLPathCore& out, BLPathSinkFunc sink = nullptr, void* user_data = nullptr) const noexcept { return bl_font_get_glyph_run_outlines(this, &glyph_run, nullptr, &out, sink, user_data); }

! Retrieves outlines of a glyph run into the out path transformed by user_transform. ! ! Optionally, a user can provide a sink function with user_data, which will be called periodically by the ! glyph outline decoder. The sink can be used to immediately process the outline to prevent accumulating a ! large path in out.

Additional Inherited Members

Public Attributes inherited from BLObjectCore

BLFont::BLFont()noexcept[1/3][¶]

Creates a default initialized font

A default initialized font is not a valid font that could be used for rendering. It can be considered an empty or null font, which has no family, no glyphs, no tables, it's essentially empty.

BLFont::BLFont(
BLFont&& other
)noexcept[2/3][¶]

Move constructor moves the underlying representation of the other font into this newly created instance and resets the other font to a default constructed state.

BLFont::BLFont(
const BLFont& other
)noexcept[3/3][¶]

Copy constructor makes a weak copy of the underlying representation of the other font.

BLFont::~BLFont()noexcept[¶]

Destroys the font.

BLFont::operator bool() constexplicitnoexcept[¶]

Returns whether the font is valid, which means that it was constructed from a valid BLFontFace.

BLResult BLFont::reset()noexcept[¶]

Resets the font to a default constructed state.

Note

This operation always succeeds and returns BL_SUCCESS.

void BLFont::swap(
BLFont& other
)noexcept[¶]

Swaps the underlying representation of this font with the other font.

BLResult BLFont::assign(
const BLFont& other
)noexcept[1/2][¶]

Copy assignment creates a weak copy of the underlying representation of the other font and stores it in this font.

BLResult BLFont::assign(
BLFont&& other
)noexcept[2/2][¶]

Move assignment moves the underlying representation of the other font into this font and then resets the other font to a default constructed state.

bool BLFont::is_valid() constnodiscardnoexcept[¶]

Tests whether the font is a valid instance.

bool BLFont::is_empty() constnodiscardnoexcept[¶]

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

bool BLFont::equals(
const BLFontCore& other
) constnodiscardnoexcept[¶]

Tests whether this and other fonts are equal.

BLResult BLFont::create_from_face(
const BLFontFaceCore& face,
float size
)noexcept[¶]

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