From 1cf0f2009caeac07f5d7345107d810b214e8896e Mon Sep 17 00:00:00 2001 From: Francesco Abbate Date: Mon, 21 Jun 2021 11:18:52 +0200 Subject: Add a C API copy method for font_desc objects Add a renderer.font's method "copy" to clone the font object by specifying an optional new size. In the size is not given the size of the original object is used. Should fulfill the request from issue #288. --- data/core/style.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'data/core/style.lua') diff --git a/data/core/style.lua b/data/core/style.lua index 60df7c73..7cf16eb1 100644 --- a/data/core/style.lua +++ b/data/core/style.lua @@ -22,9 +22,9 @@ style.tab_width = common.round(170 * SCALE) -- On High DPI monitor or non RGB monitor you may consider using antialiasing grayscale instead. -- The antialiasing grayscale with full hinting is interesting for crisp font rendering. style.font = renderer.font.load(DATADIR .. "/fonts/FiraSans-Regular.ttf", 13 * SCALE) -style.big_font = renderer.font.load(DATADIR .. "/fonts/FiraSans-Regular.ttf", 40 * SCALE) +style.big_font = style.font:copy(40 * SCALE) style.icon_font = renderer.font.load(DATADIR .. "/fonts/icons.ttf", 14 * SCALE, {antialiasing="grayscale", hinting="full"}) -style.icon_big_font = renderer.font.load(DATADIR .. "/fonts/icons.ttf", 20 * SCALE, {antialiasing="grayscale", hinting="full"}) +style.icon_big_font = style.icon_font:copy(20 * SCALE) style.code_font = renderer.font.load(DATADIR .. "/fonts/JetBrainsMono-Regular.ttf", 13 * SCALE) style.background = { common.color "#2e2e32" } -- cgit v1.2.3