diff options
author | Phil Jones <philj56@gmail.com> | 2022-06-08 23:14:38 +0100 |
---|---|---|
committer | Phil Jones <philj56@gmail.com> | 2022-06-09 16:51:44 +0100 |
commit | 05861ed6737f6b7b139895c4eeb26791edc333b4 (patch) | |
tree | 2f6af9e3038ec900f3968a1f2ee687f7a7238414 /src/entry.h | |
parent | 51bbf779ba2c9d5954e2c9470a8eae7c1ddd38a5 (diff) |
Add Harfbuzz backend.
Another source of slow startup is initialising Pango. If the user
supplies a ttf file, we can skip any Pango stuff and use Harfbuzz
directly with Cairo to do our font rendering, providing a large speedup.
Diffstat (limited to 'src/entry.h')
-rw-r--r-- | src/entry.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/entry.h b/src/entry.h index 6efe773..341e340 100644 --- a/src/entry.h +++ b/src/entry.h @@ -1,7 +1,13 @@ #ifndef ENTRY_H #define ENTRY_H -#include <pango/pangocairo.h> +#ifdef USE_PANGO +#include "entry_backend/pango.h" +#else +#include "entry_backend/harfbuzz.h" +#endif + +#include <cairo/cairo.h> #include "color.h" #include "history.h" #include "image.h" @@ -12,12 +18,7 @@ struct entry { struct image image; - struct { - PangoContext *context; - PangoLayout *prompt_layout; - PangoLayout *entry_layout; - PangoLayout *result_layouts[5]; - } pango; + struct entry_backend backend; struct { cairo_surface_t *surface; cairo_t *cr; |