1 #ifndef _customfont__hpp__included__
2 #define _customfont__hpp__included__
10 #include "framebuffer.hpp"
12 struct font_glyph_data
15 font_glyph_data(std::istream
& s
);
19 std::vector
<uint32_t> glyph
; //Bitpacked, element breaks between rows.
20 void render(framebuffer
<false>& fb
, int32_t x
, int32_t y
, premultiplied_color fg
, premultiplied_color bg
)
22 void render(framebuffer
<true>& fb
, int32_t x
, int32_t y
, premultiplied_color fg
, premultiplied_color bg
) const;
29 custom_font(const std::string
& file
);
30 void add(const std::u32string
& key
, const font_glyph_data
& glyph
) throw(std::bad_alloc
);
31 std::u32string
best_ligature_match(const std::u32string
& codepoints
, size_t start
) const
32 throw(std::bad_alloc
);
33 const font_glyph_data
& lookup_glyph(const std::u32string
& key
) const throw();
34 unsigned get_rowadvance() const throw() { return rowadvance
; }
36 std::map
<std::u32string
, font_glyph_data
> glyphs
;