about summary refs log tree commit diff stats
path: root/main.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-06-14 21:07:04 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-06-14 21:07:04 -0700
commit4f9789db413fa92417a5d4ae4ec6a27c6d357550 (patch)
tree5f1746331724b51f9bfddfef13ce30a526b44cab /main.lua
parent0114cd1e781fee4002fb7090d64d8219fa41330b (diff)
downloadtext.love-4f9789db413fa92417a5d4ae4ec6a27c6d357550.tar.gz
test: naming a point
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.lua b/main.lua
index f717397..165538a 100644
--- a/main.lua
+++ b/main.lua
@@ -65,6 +65,8 @@ Previous_drawing_mode = nil
 -- values for tests
 Font_height = 14
 Line_height = 15
+-- widest possible character width
+Em = App.newText(love.graphics.getFont(), 'm')
 
 Margin_top = 15
 Margin_left = 25
@@ -174,8 +176,9 @@ function initialize_font_settings(font_height)
   love.graphics.setFont(love.graphics.newFont(Font_height))
   Line_height = math.floor(font_height*1.3)
 
-  -- maximum width available to either text or drawings, in pixels
   Em = App.newText(love.graphics.getFont(), 'm')
+
+  -- maximum width available to either text or drawings, in pixels
   -- readable text width is 50-75 chars
   Line_width = math.min(40*App.width(Em), App.screen.width-50)
 end