summaryrefslogtreecommitdiff
path: root/src/entry_backend
diff options
context:
space:
mode:
authorPhil Jones <philj56@gmail.com>2023-03-12 16:26:48 +0000
committerPhil Jones <philj56@gmail.com>2023-03-12 16:27:46 +0000
commit2f76c924bbc38fdea6663ef37525adae8db8e8d2 (patch)
treeed93b820c07281168cd2daddfb8dea45e1e9e874 /src/entry_backend
parent69df3f7007a26d7a37cc75a0ceb32bcc8ef2cc80 (diff)
Minor cleanup of harfbuzz initialisation code.
Diffstat (limited to 'src/entry_backend')
-rw-r--r--src/entry_backend/harfbuzz.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/entry_backend/harfbuzz.c b/src/entry_backend/harfbuzz.c
index 5f0a30e..7443b1e 100644
--- a/src/entry_backend/harfbuzz.c
+++ b/src/entry_backend/harfbuzz.c
@@ -553,8 +553,7 @@ void entry_backend_harfbuzz_init(
/* If we somehow fail to get an m from the font, just guess. */
entry->cursor_theme.em_width = font_size * 5.0 / 8.0;
}
- hb_font_extents_t font_extents;
- hb_font_get_h_extents(hb->hb_font, &font_extents);
+ hb_font_get_h_extents(hb->hb_font, &hb->hb_font_extents);
int32_t underline_depth;
#ifdef NO_HARFBUZZ_METRIC_FALLBACK
if (!hb_ot_metrics_get_position(
@@ -569,7 +568,7 @@ void entry_backend_harfbuzz_init(
HB_OT_METRICS_TAG_UNDERLINE_OFFSET,
&underline_depth);
#endif
- entry->cursor_theme.underline_depth = (font_extents.ascender - underline_depth) / 64.0;
+ entry->cursor_theme.underline_depth = (hb->hb_font_extents.ascender - underline_depth) / 64.0;
if (entry->cursor_theme.style == CURSOR_STYLE_UNDERSCORE && !entry->cursor_theme.thickness_specified) {
int32_t thickness;
@@ -590,14 +589,13 @@ void entry_backend_harfbuzz_init(
}
- log_debug("Creating Harfbuzz buffer.\n");
- hb->hb_buffer = hb_buffer_create();
-
- hb_font_get_h_extents(hb->hb_font, &hb->hb_font_extents);
if (hb->hb_font_extents.line_gap == 0) {
hb->hb_font_extents.line_gap = (hb->hb_font_extents.ascender - hb->hb_font_extents.descender);
}
+ log_debug("Creating Harfbuzz buffer.\n");
+ hb->hb_buffer = hb_buffer_create();
+
log_debug("Creating Cairo font.\n");
hb->cairo_face = cairo_ft_font_face_create_for_ft_face(hb->ft_face, 0);