default font size and line-height

This commit is contained in:
Kartik K. Agaram 2022-06-02 23:44:34 -07:00
parent 0b63721bb0
commit 1fc4214029

View File

@ -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