summaryrefslogtreecommitdiff
path: root/src/entry_backend/pango.h
diff options
context:
space:
mode:
authorPhil Jones <philj56@gmail.com>2022-06-08 23:14:38 +0100
committerPhil Jones <philj56@gmail.com>2022-06-09 16:51:44 +0100
commit05861ed6737f6b7b139895c4eeb26791edc333b4 (patch)
tree2f6af9e3038ec900f3968a1f2ee687f7a7238414 /src/entry_backend/pango.h
parent51bbf779ba2c9d5954e2c9470a8eae7c1ddd38a5 (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_backend/pango.h')
-rw-r--r--src/entry_backend/pango.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/entry_backend/pango.h b/src/entry_backend/pango.h
new file mode 100644
index 0000000..08572ae
--- /dev/null
+++ b/src/entry_backend/pango.h
@@ -0,0 +1,19 @@
+#ifndef ENTRY_BACKEND_PANGO_H
+#define ENTRY_BACKEND_PANGO_H
+
+#include <pango/pangocairo.h>
+
+struct entry;
+
+struct entry_backend {
+ PangoContext *context;
+ PangoLayout *prompt_layout;
+ PangoLayout *entry_layout;
+ PangoLayout *result_layouts[5];
+};
+
+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_PANGO_H */