From 05861ed6737f6b7b139895c4eeb26791edc333b4 Mon Sep 17 00:00:00 2001 From: Phil Jones Date: Wed, 8 Jun 2022 23:14:38 +0100 Subject: 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. --- src/entry.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/entry.h') 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 +#ifdef USE_PANGO +#include "entry_backend/pango.h" +#else +#include "entry_backend/harfbuzz.h" +#endif + +#include #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; -- cgit v1.2.3