aboutsummaryrefslogtreecommitdiff
path: root/src/graphics
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-11-27 23:02:35 +0100
committerdec05eba <dec05eba@protonmail.com>2021-11-27 23:02:35 +0100
commit993eea20151d881735c667757e3b64e4f85ac687 (patch)
tree5c3eaa326425045f99de73fe21d524ed6f743593 /src/graphics
parent08fe64b91e7e43db54628f922f07864a8d8e5402 (diff)
Add max glyph height property
Diffstat (limited to 'src/graphics')
-rw-r--r--src/graphics/font.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/graphics/font.c b/src/graphics/font.c
index cad5790..603b1d4 100644
--- a/src/graphics/font.c
+++ b/src/graphics/font.c
@@ -59,6 +59,7 @@ int mgl_font_load_from_file(mgl_font *self, const mgl_memory_mapped_file *mapped
self->ascent = round_float(font_scale * ascent);
self->descent = round_float(font_scale * descent);
self->linegap = round_float(font_scale * linegap);
+ self->max_glyph_height = self->character_size - self->descent;
/* TODO: Use stbtt_GetCodepointSDF */
return 0;
@@ -72,6 +73,7 @@ void mgl_font_unload(mgl_font *self) {
self->ascent = 0;
self->descent = 0;
self->linegap = 0;
+ self->max_glyph_height = 0;
free(self->font_info);
self->font_info = NULL;