summaryrefslogtreecommitdiff
path: root/src/entry_backend/harfbuzz.h
blob: acaa2eb11f2da01f346caaf10e7ecd90394d430e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef ENTRY_BACKEND_HARFBUZZ_H
#define ENTRY_BACKEND_HARFBUZZ_H

#include <stdbool.h>
#include <cairo/cairo-ft.h>
#include <ft2build.h>
#include FT_FREETYPE_H
#include <harfbuzz/hb.h>

#define MAX_FONT_VARIATIONS 16
#define MAX_FONT_FEATURES 16

struct entry;

struct entry_backend_harfbuzz {
	FT_Library ft_library;
	FT_Face ft_face;

	cairo_font_face_t *cairo_face;

	hb_font_t *hb_font;
	hb_font_extents_t hb_font_extents;
	hb_buffer_t *hb_buffer;
	hb_variation_t hb_variations[MAX_FONT_VARIATIONS];
	hb_feature_t hb_features[MAX_FONT_FEATURES];
	uint8_t num_variations;
	uint8_t num_features;

	double scale;

	bool disable_hinting;
};

void entry_backend_harfbuzz_init(struct entry *entry, uint32_t *width, uint32_t *height);
void entry_backend_harfbuzz_destroy(struct entry *entry);
void entry_backend_harfbuzz_update(struct entry *entry);

#endif /* ENTRY_BACKEND_HARFBUZZ_H */