aboutsummaryrefslogtreecommitdiff
path: root/terminal.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-07-29 18:12:33 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-07-29 18:12:33 +0000
commitd1b88f67e463fa2443efe903c3e2e736dd7282f3 (patch)
treed70328d758ff8b22508425b0a7b848f63e1dccf1 /terminal.h
parentrender: reset "last cursor" when resizing (diff)
parentfont: 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.h26
1 files changed, 20 insertions, 6 deletions
diff --git a/terminal.h b/terminal.h
index 1971d3f4..86b92d17 100644
--- a/terminal.h
+++ b/terminal.h
@@ -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 {