20 #ifndef ANTKEEPER_TYPE_FT_TYPEFACE_HPP
21 #define ANTKEEPER_TYPE_FT_TYPEFACE_HPP
25 #include FT_FREETYPE_H
46 ft_typeface(FT_Library library, FT_Face face, std::unique_ptr<std::vector<FT_Byte>> file_buffer);
54 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;
58 void set_face_pixel_size(
float height)
const;
62 std::unique_ptr<std::vector<FT_Byte>> file_buffer;
Typeface implementation using the FreeType library.
virtual ~ft_typeface()
Destroys a FreeType typeface.
ft_typeface(FT_Library library, FT_Face face, std::unique_ptr< std::vector< FT_Byte >> file_buffer)
Creates a FreeType typeface.
virtual bool get_metrics(float height, font_metrics &metrics) const
Gets metrics for a font of the specified size.
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.
virtual bool has_kerning() const
Returns true if the typeface contains kerning information, false otherwise.
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.
Abstract base class for a typeface, which corresponds to a single digital font file.
T offset(T longitude)
Calculates the UTC offset at a given longitude.
Metrics describing properties of a font.
Metrics describing properties of a glyph.