Antkeeper
0.0.1
|
Typeface implementation using the FreeType library. More...
#include <ft-typeface.hpp>
Public Member Functions | |
ft_typeface (FT_Library library, FT_Face face, std::unique_ptr< std::vector< FT_Byte >> file_buffer) | |
Creates a FreeType typeface. More... | |
virtual | ~ft_typeface () |
Destroys a FreeType typeface. More... | |
virtual bool | has_kerning () const |
Returns true if the typeface contains kerning information, false otherwise. More... | |
virtual bool | get_metrics (float height, font_metrics &metrics) const |
Gets metrics for a font of the specified size. More... | |
virtual bool | get_metrics (float height, char32_t code, glyph_metrics &metrics) const |
Gets metrics for a glyph in a font of the specified size. More... | |
virtual bool | get_bitmap (float height, char32_t code, std::vector< std::byte > &bitmap, std::uint32_t &bitmap_width, std::uint32_t &bitmap_height) const |
Gets a bitmap of a glyph in a font of the specified size. More... | |
virtual bool | get_kerning (float height, char32_t first, char32_t second, math::fvec2 &offset) const |
Gets the kerning offset for a pair of glyphs. More... | |
![]() | |
typeface (typeface_style style, int weight) | |
Creates a typeface, setting its style and weight. More... | |
typeface () | |
Creates an empty typeface. More... | |
virtual | ~typeface ()=default |
Destroys a typeface. More... | |
void | set_style (typeface_style style) |
Sets the style of the typeface. More... | |
void | set_weight (int weight) |
Sets the weight of the typeface. More... | |
typeface_style | get_style () const noexcept |
Returns the style of the typeface. More... | |
int | get_weight () const noexcept |
Returns the weight of the typeface. More... | |
const std::unordered_set< char32_t > & | get_charset () const noexcept |
Returns the set of characters supported by the typeface. More... | |
Additional Inherited Members | |
![]() | |
std::unordered_set< char32_t > | charset |
Typeface implementation using the FreeType library.
Definition at line 36 of file ft-typeface.hpp.
type::ft_typeface::ft_typeface | ( | FT_Library | library, |
FT_Face | face, | ||
std::unique_ptr< std::vector< FT_Byte >> | file_buffer | ||
) |
Creates a FreeType typeface.
library | Pointer to a FreeType library instance. |
face | Pointer to the FreeType object instance. |
file_buffer | File buffer containing FreeType face data. |
Build charset
Definition at line 26 of file ft-typeface.cpp.
|
virtual |
Destroys a FreeType typeface.
Definition at line 42 of file ft-typeface.cpp.
|
virtual |
Gets a bitmap of a glyph in a font of the specified size.
[in] | height | Height of the font, in pixels. |
[in] | code | UTF-32 character code of a glyph. |
[out] | bitmap | Glyph bitmap data. |
true
if glyph bitmap data was returned, false
otherwise. Implements type::typeface.
Definition at line 99 of file ft-typeface.cpp.
|
virtual |
Gets the kerning offset for a pair of glyphs.
[in] | height | Height of the font, in pixels. |
[in] | first | UTF-32 character code of the first glyph. |
[in] | second | UTF-32 character code of the second glyph. |
[out] | offset | Kerning offset. |
true
if a kerning offset was returned, false
otherwise. Implements type::typeface.
Definition at line 123 of file ft-typeface.cpp.
|
virtual |
Gets metrics for a glyph in a font of the specified size.
[in] | height | Height of the font, in pixels. |
[in] | code | UTF-32 character code of a glyph. |
[out] | metrics | Glyph metrics. |
true
if glyph metrics were returned, false
otherwise. Implements type::typeface.
Definition at line 72 of file ft-typeface.cpp.
|
virtual |
Gets metrics for a font of the specified size.
[in] | height | Height of the font, in pixels. |
[out] | metrics | Font metrics. |
true
if font metrics were returned, false
otherwise. Implements type::typeface.
Definition at line 53 of file ft-typeface.cpp.
|
virtual |
Returns true
if the typeface contains kerning information, false
otherwise.
Implements type::typeface.
Definition at line 48 of file ft-typeface.cpp.