diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2019-07-29 18:12:33 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2019-07-29 18:12:33 +0000 |
| commit | d1b88f67e463fa2443efe903c3e2e736dd7282f3 (patch) | |
| tree | d70328d758ff8b22508425b0a7b848f63e1dccf1 /terminal.h | |
| parent | render: reset "last cursor" when resizing (diff) | |
| parent | font: set FT load and render flags from FontConfig properties (diff) | |
Merge branch 'use-freetype-to-render-glyphs'
Diffstat (limited to 'terminal.h')
| -rw-r--r-- | terminal.h | 26 |
1 files changed, 20 insertions, 6 deletions
@@ -6,6 +6,9 @@ #include <threads.h> +#include <ft2build.h> +#include FT_FREETYPE_H + #include <cairo.h> #include <wayland-client.h> #include <primary-selection-unstable-v1.h> @@ -203,13 +206,18 @@ struct primary { uint32_t serial; }; -struct glyph_cache { - cairo_glyph_t *glyphs; - int count; +struct glyph { + void *data; + cairo_surface_t *surf; + int left; + int top; }; struct font { - cairo_scaled_font_t *font; + FT_Face face; + int load_flags; + int render_flags; + FT_LcdFilter lcd_filter; struct { double position; double thickness; @@ -219,7 +227,8 @@ struct font { double thickness; } strikeout; - struct glyph_cache glyph_cache[256]; + struct glyph cache[256]; + mtx_t lock; }; enum cursor_style { CURSOR_BLOCK, CURSOR_UNDERLINE, CURSOR_BAR }; @@ -321,7 +330,12 @@ struct terminal { struct grid *grid; struct font fonts[4]; - cairo_font_extents_t fextents; + struct { + int height; + int descent; + int ascent; + int max_x_advance; + } fextents; struct wayland wl; struct { |
