From b09f0e832dd0fef91aa8fa1b4e5e8625935eb307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Stensg=C3=A5rd?= Date: Sun, 20 Apr 2025 16:45:23 +0200 Subject: neue haas grotesk grid --- opplysning.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'opplysning.c') diff --git a/opplysning.c b/opplysning.c index e8bc6df..5c2af13 100644 --- a/opplysning.c +++ b/opplysning.c @@ -131,7 +131,9 @@ main(void) int ncp = 0; int *cp = LoadCodepoints(the_alphabet, &ncp); Font font_h = LoadFontEx("font/adventpro-bold.ttf", 60, cp, ncp); - Font font_p = LoadFontEx("font/adventpro-semibold.ttf", 40, cp, ncp); + // Font font_p = LoadFontEx("font/adventpro-semibold.ttf", 40, cp, ncp); + Font font_p = + LoadFontEx("font/NHaasGroteskTXPro-55Rg.ttf", 40, cp, ncp); UnloadCodepoints(cp); Color bg = RAYWHITE; @@ -147,7 +149,8 @@ main(void) BeginDrawing(); ClearBackground(bg); - line(sw / 2 - 60, 0, font_h, fg, ts); + Vector2 v2_ts = MeasureTextEx(font_h, ts, font_h.baseSize, 0); + line(sw / 2 - v2_ts.x / 2, 0, font_h, fg, ts); int y = 0; int year = 0, month = 0, day = 0; @@ -163,14 +166,21 @@ main(void) snprintf(s, sizeof(s), "%s %u. %s", ukedag[e->wday], e->day, maaned[e->month]); - line(20, y += 50, font_h, hd, s); + line(25, y += 50, font_h, hd, s); y += 20; } { + y += 40; char s[64] = {0}; - snprintf(s, sizeof(s), "%02u:%02u %s", e->hour, - e->minute, e->title); - line(25, y += 40, font_p, fg, s); + snprintf(s, sizeof(s), "%02u:%02u", e->hour, + e->minute); + Vector2 m = MeasureTextEx(font_p, s, + font_p.baseSize, 0); + line(2.8 * font_p.baseSize - m.x, y, font_p, fg, + s); + + line(3.5 * font_p.baseSize, y, font_p, fg, + e->title); } } EndDrawing(); -- cgit v1.2.3