1 #ifndef _library__framebuffer_font2__hpp__included__
2 #define _library__framebuffer_font2__hpp__included__
11 #include "framebuffer.hpp"
21 glyph(std::istream
& s
);
25 std::vector
<uint32_t> fglyph
; //Bitpacked, element breaks between rows.
26 void render(fb
<false>& fb
, int32_t x
, int32_t y
, color fg
, color bg
, color hl
) const;
27 void render(fb
<true>& fb
, int32_t x
, int32_t y
, color fg
, color bg
, color hl
) const;
28 void render(uint8_t* buf
, size_t stride
, uint32_t u
, uint32_t v
, uint32_t w
, uint32_t h
) const;
31 font2(const std::string
& file
);
32 font2(struct font
& bfont
);
33 void add(const std::u32string
& key
, const glyph
& fglyph
) throw(std::bad_alloc
);
34 std::u32string
best_ligature_match(const std::u32string
& codepoints
, size_t start
) const
35 throw(std::bad_alloc
);
36 const glyph
& lookup_glyph(const std::u32string
& key
) const throw();
37 unsigned get_rowadvance() const throw() { return rowadvance
; }
38 std::pair
<uint32_t, uint32_t> get_metrics(const std::u32string
& str
, uint32_t xalign
) const;
39 void for_each_glyph(const std::u32string
& str
, uint32_t xalign
, std::function
<void(uint32_t x
, uint32_t y
,
40 const glyph
& g
)> cb
) const;
42 std::map
<std::u32string
, glyph
> glyphs
;