sokoban.love/0032-update_font_settings

27 lines
1009 B
Plaintext

update_font_settings = function(font_height)
Font_height = font_height
Line_height = math.floor(Font_height*1.3)
if Font_filename == nil then
Font = love.graphics.newFont(Font_height)
else
Font = love.graphics.newFont(Font_filename, Font_height)
end
love.graphics.setFont(Font)
Line_number_padding = Line_number_width*Font:getWidth('m')
Menu_height = 5 + Line_height + 5
Menu_bottom = Menu_top + Menu_height
for _,pane in ipairs(Panes) do
pane.editor_state.top = Menu_bottom + 20
pane.editor_state.left = Menu_left + 50 + Line_number_padding
pane.editor_state.right = editor_right_margin()
if pane.editor_state.right < pane.editor_state.left then
pane.editor_state.right = pane.editor_state.left+1
end
pane.editor_state.width = pane.editor_state.right - pane.editor_state.left
edit.update_font_settings(pane.editor_state, Font_height, Font)
Text.redraw_all(pane.editor_state)
end
edit.update_font_settings(Output_editor_state, Font_height, Font)
update_output_editor()
end