From c00c404006147838fb8af3259cf214396da31c99 Mon Sep 17 00:00:00 2001 From: Matthew Date: Sat, 27 Dec 2025 20:45:44 +1100 Subject: [PATCH] update fonts --- fonts.d | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fonts.d b/fonts.d index 8953093..c7684c6 100644 --- a/fonts.d +++ b/fonts.d @@ -13,6 +13,7 @@ struct FontAtlas f32 descent; f32 line_gap; f32 max_advance; + f32 line_height; u32 width; u32 height; Glyph[128] glyphs; @@ -102,6 +103,10 @@ CreateAtlas(Arena* arena, FontFace font, f32 size, u32 dimension) // TODO: proper packing algorithm if(font != null) { + i64 bbox_ymax = font.bbox.yMax >> 6; + i64 bbox_ymin = font.bbox.yMin >> 6; + + abuf.atlas.line_height = cast(f32)(bbox_ymax - bbox_ymin); abuf.atlas.units_per_em = cast(f32)font.units_per_EM; abuf.atlas.ascent = cast(f32)font.ascender; abuf.atlas.descent = cast(f32)font.descender; @@ -259,3 +264,4 @@ CreateAtlas(Arena* arena, FontFace font, f32 size, u32 dimension) return abuf; } +