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_backend/harfbuzz.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/entry_backend/harfbuzz.h (limited to 'src/entry_backend/harfbuzz.h') diff --git a/src/entry_backend/harfbuzz.h b/src/entry_backend/harfbuzz.h new file mode 100644 index 0000000..0b07538 --- /dev/null +++ b/src/entry_backend/harfbuzz.h @@ -0,0 +1,26 @@ +#ifndef ENTRY_BACKEND_HARFBUZZ_H +#define ENTRY_BACKEND_HARFBUZZ_H + +#include +#include +#include FT_FREETYPE_H +#include +#include + +struct entry; + +struct entry_backend { + FT_Library ft_library; + FT_Face ft_face; + + cairo_font_face_t *cairo_face; + + hb_font_t *hb_font; + hb_buffer_t *hb_buffer; +}; + +void entry_backend_init(struct entry *entry, uint32_t width, uint32_t height, uint32_t scale); +void entry_backend_destroy(struct entry *entry); +void entry_backend_update(struct entry *entry); + +#endif /* ENTRY_BACKEND_HARFBUZZ_H */ -- cgit v1.2.3