From 306505e714b7caf146b8ec8386b407d57555563d Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Mon, 4 Jan 2021 17:18:15 -0500 Subject: commands to change the font size --- ted-base.c | 72 ++++++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 49 insertions(+), 23 deletions(-) (limited to 'ted-base.c') diff --git a/ted-base.c b/ted-base.c index 784bbe9..6ac9c5f 100644 --- a/ted-base.c +++ b/ted-base.c @@ -1,26 +1,3 @@ -typedef struct { - u32 line_number; // config line number where this was set - Command command; // this will be 0 (COMMAND_UNKNOWN) if there's no action for the key - i64 argument; -} KeyAction; - -#define SCANCODE_COUNT 0x120 // SDL scancodes should be less than this value. -// a "key combo" is some subset of {control, shift, alt} + some key. -#define KEY_COMBO_COUNT (SCANCODE_COUNT << 3) -#define KEY_MODIFIER_CTRL_BIT 0 -#define KEY_MODIFIER_SHIFT_BIT 1 -#define KEY_MODIFIER_ALT_BIT 2 -#define KEY_MODIFIER_CTRL (1<settings.text_size); + if (font) { + if (ted->font) { + text_font_free(ted->font); + } + ted->font = font; + } else { + ted_seterr(ted, "Couldn't load font: %s", text_get_err()); + text_clear_err(); + } + } else { + ted_seterr(ted, "Couldn't find font file. There is probably a problem with your ted installation."); + } +} -- cgit v1.2.3