aboutsummaryrefslogtreecommitdiff
path: root/src/sysapp/login
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2017-05-03 20:37:59 +0200
committerAlex Auvolat <alex@adnab.me>2017-05-03 20:37:59 +0200
commit1161e1d8be014945266017cb0ce735537a287677 (patch)
tree118f2201a5e12f79aefb404295794eed0d52cd6d /src/sysapp/login
parent0b583122fb6cfcff991c54836d37cb3958c343b1 (diff)
downloadkogata-1161e1d8be014945266017cb0ce735537a287677.tar.gz
kogata-1161e1d8be014945266017cb0ce735537a287677.zip
Truetype fonts
Diffstat (limited to 'src/sysapp/login')
-rw-r--r--src/sysapp/login/main.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/sysapp/login/main.lua b/src/sysapp/login/main.lua
index 40aa9d9..de258b9 100644
--- a/src/sysapp/login/main.lua
+++ b/src/sysapp/login/main.lua
@@ -19,14 +19,18 @@ end
gui.show_cursor()
-local fnt = draw.load_font('sys:/fonts/default.bf')
+local fnt = draw.load_ttf_font('sys:/fonts/vera.ttf')
+if fnt == nil then
+ print("Could not load vera.ttf!")
+ os.exit()
+end
local txt_x, txt_y = 0, 0
gui.on_mouse_down = function (lb, rb, mb)
if lb then
gui.hide_cursor()
- gui.surface:write(gui.mouse_x, gui.mouse_y, string.format("Click at %d, %d", gui.mouse_x, gui.mouse_y), fnt, gui.surface:rgb(0, 0, 255))
+ gui.surface:write(gui.mouse_x, gui.mouse_y, string.format("Click at %d, %d", gui.mouse_x, gui.mouse_y), fnt, 16, gui.surface:rgb(0, 0, 255))
txt_x = gui.mouse_x
txt_y = gui.mouse_y + fnt:text_height(" ")
gui.show_cursor()
@@ -35,7 +39,7 @@ end
gui.on_text_input = function(chr)
gui.hide_cursor()
- gui.surface:write(txt_x, txt_y, chr, fnt, gui.surface:rgb(0, 0, 255))
+ gui.surface:write(txt_x, txt_y, chr, fnt, 16, gui.surface:rgb(0, 0, 255))
txt_x = txt_x + fnt:text_width(chr)
gui.show_cursor()
end