diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-06-02 23:44:34 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-06-02 23:44:34 -0700 |
commit | 1fc4214029c166adeb8a478e814dd77043576f46 (patch) | |
tree | 541333ea2f052cc8bee47f0a071811a333241308 /main.lua | |
parent | 0b63721bb0eb2c8feb62450d34e1eb86ae2352d0 (diff) | |
download | text.love-1fc4214029c166adeb8a478e814dd77043576f46.tar.gz |
default font size and line-height
Diffstat (limited to 'main.lua')
-rw-r--r-- | main.lua | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/main.lua b/main.lua index f75e287..2892baf 100644 --- a/main.lua +++ b/main.lua @@ -61,8 +61,10 @@ Cursor_x, Cursor_y = 0, 0 -- in pixels Current_drawing_mode = 'line' Previous_drawing_mode = nil +-- values for tests Font_height = 14 Line_height = 15 + Margin_top = 15 Filename = love.filesystem.getUserDirectory()..'/lines.txt' @@ -97,6 +99,10 @@ function App.initialize(arg) Line_width = math.floor(App.screen.width/2/40)*40 --? Line_width = 100 + Font_height = 20 + love.graphics.setFont(love.graphics.newFont(Font_height)) + Line_height = 26 + -- still in App.initialize if #arg > 0 then Filename = arg[1] @@ -258,18 +264,18 @@ function App.keychord_pressed(chord) elseif chord == 'C-=' then Font_height = Font_height+2 love.graphics.setFont(love.graphics.newFont(Font_height)) - Line_height = math.floor(Font_height*1.1) + Line_height = math.floor(Font_height*1.3) Text.redraw_all() elseif chord == 'C--' then Font_height = Font_height-2 love.graphics.setFont(love.graphics.newFont(Font_height)) Text.redraw_all() - Line_height = math.floor(Font_height*1.1) + Line_height = math.floor(Font_height*1.3) elseif chord == 'C-0' then - Font_height = 14 + Font_height = 20 love.graphics.setFont(love.graphics.newFont(Font_height)) Text.redraw_all() - Line_height = 15 + Line_height = 26 elseif love.mouse.isDown('1') or chord:sub(1,2) == 'C-' then Drawing.keychord_pressed(chord) elseif chord == 'escape' and love.mouse.isDown('1') then |