From f1d4e64fe52b473bc3021f713a1eeb0ba25ad7e3 Mon Sep 17 00:00:00 2001 From: kmwallio Date: Sun, 18 Oct 2020 11:32:37 -0700 Subject: [PATCH] Use font pt provided by user without scaling (unless fullscreen) --- data/com.github.kmwallio.thiefmd.gschema.xml | 2 +- src/Constants/ThiefProperties.vala | 6 +++--- src/Controllers/UI.vala | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/data/com.github.kmwallio.thiefmd.gschema.xml b/data/com.github.kmwallio.thiefmd.gschema.xml index 161318d..a3b3830 100644 --- a/data/com.github.kmwallio.thiefmd.gschema.xml +++ b/data/com.github.kmwallio.thiefmd.gschema.xml @@ -171,7 +171,7 @@ Font Family for editor to use - 12 + 14 Font Size to use Font Size for editor to use diff --git a/src/Constants/ThiefProperties.vala b/src/Constants/ThiefProperties.vala index 8b82a8a..6c0ca3b 100644 --- a/src/Constants/ThiefProperties.vala +++ b/src/Constants/ThiefProperties.vala @@ -97,17 +97,17 @@ The `markdown` editor worth stealing. *Focus* more on **writing**. .small-text { %s; - font-size: %0.2frem; + font-size: %dpt; } .focus-text { %s; - font-size: %0.2frem; + font-size: %dpt; } .full-text { %s; - font-size: %0.2frem; + font-size: %dpt; }"""; public const string DYNAMIC_CSS = """@define-color colorPrimary %s; diff --git a/src/Controllers/UI.vala b/src/Controllers/UI.vala index 39f5c91..e0db9fa 100644 --- a/src/Controllers/UI.vala +++ b/src/Controllers/UI.vala @@ -210,9 +210,9 @@ namespace ThiefMD.Controllers.UI { // Assuming 12pt is 1rem, scale to original CSS based on that string new_font = ThiefProperties.FONT_SETTINGS.printf ( - settings.get_css_font_family (), ((settings.get_css_font_size () / Constants.SIZE_1_REM_IN_PT) * 1.25), - settings.get_css_font_family (), ((settings.get_css_font_size () / Constants.SIZE_1_REM_IN_PT) * 1.35), - settings.get_css_font_family (), ((settings.get_css_font_size () / Constants.SIZE_1_REM_IN_PT) * 1.45) + settings.get_css_font_family (), (int)((settings.get_css_font_size ()) * 1), + settings.get_css_font_family (), (int)((settings.get_css_font_size ()) * 1.2), + settings.get_css_font_family (), (int)((settings.get_css_font_size ()) * 1.4) ); try {