1 #ifndef _library__customfont__hpp__included__
2 #define _library__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
,
21 premultiplied_color hl
) const;
22 void render(framebuffer
<true>& fb
, int32_t x
, int32_t y
, premultiplied_color fg
, premultiplied_color bg
,
23 premultiplied_color hl
) const;
30 custom_font(const std::string
& file
);
31 void add(const std::u32string
& key
, const font_glyph_data
& glyph
) throw(std::bad_alloc
);
32 std::u32string
best_ligature_match(const std::u32string
& codepoints
, size_t start
) const
33 throw(std::bad_alloc
);
34 const font_glyph_data
& lookup_glyph(const std::u32string
& key
) const throw();
35 unsigned get_rowadvance() const throw() { return rowadvance
; }
37 std::map
<std::u32string
, font_glyph_data
> glyphs
;