From 585e68cc589b0d439e72fcba82313542e4584feb Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Wed, 18 May 2022 10:52:29 +0200 Subject: [PATCH] Make font sizes relative to the image size --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index c6b8572..92121b7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -129,8 +129,8 @@ fn gen_svg() -> Document { .time() .num_seconds_from_midnight() as i32; - let local_hour_font_size = 16.5; - let hour_name_font_size = 13.37699; + let local_hour_font_size = image_width as f32 * 0.02357; + let hour_name_font_size = image_width as f32 * 0.019109; let utc_hour_font_size = image_width as f32 * 0.021462; let outer_r = (image_width as f32) / 2.0 - 3.0 * hour_name_font_size; let ring_width = hour_name_font_size * 3.0;