Shape text using Pango and HarfBuzz; gives us nice ligatures and exotic scripts.
[ccbs] / bigscreen / fonts.h
1 #ifndef _FONTS_H
2 #define _FONTS_H 1
3
4 #include <ft2build.h>
5 #include FT_FREETYPE_H
6 #include <vector>
7 #include <string>
8 #include "widestring.h"
9
10 struct TextDefer {
11         widestring str;
12         double size;
13         unsigned xpos, ypos;
14         std::string theme_element, fresh_theme_element;
15 };
16
17 void init_freetype();
18 void set_screen_size(unsigned width, unsigned height);
19 unsigned my_draw_text(const widestring &str, unsigned char *buf, double size, const std::string &theme_element, int xpos = 0, int ypos = 0);
20
21 // draw_all_deferred_text draws every string in current that is not the same in old, with a different theme
22 void my_draw_text_deferred(std::vector<TextDefer> &td, const widestring &str, double size, const std::string &theme_element, const std::string &fresh_theme_element, int xpos, int ypos);
23 void draw_all_deferred_text(unsigned char *buf, std::vector<TextDefer> &current, std::vector<TextDefer> &old);
24
25 #endif /* !defined(_FONTS_H) */