summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2022-06-01 21:40:02 +0200
committerDaniel Friesel <derf@finalrewind.org>2022-06-01 21:40:02 +0200
commit7a78aa58004896a45ba825e56e846fbd32a6fa0a (patch)
tree6ef79a9cc2df52bfacfd12a1c77180cca5c19fe3
parentfb3373297f7dacc6f20d1d87f683d3976f02daf2 (diff)
framebuffer: use string glyphs
-rw-r--r--framebuffer.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/framebuffer.lua b/framebuffer.lua
index 92e90f6..644aba1 100644
--- a/framebuffer.lua
+++ b/framebuffer.lua
@@ -38,12 +38,12 @@ function fb.put(font, c)
end
local glyph = font.glyphs[c - 31]
local fh = font.height/8
- for i = 1, table.getn(glyph) do
+ for i = 1, string.len(glyph) do
local x1 = (i-1) / fh
local y8 = (i-1) % fh
- fb.buf[fb.y/8+y8 + (fb.x+x1) * (fb.h/8) + 1] = glyph[i]
+ fb.buf[fb.y/8+y8 + (fb.x+x1) * (fb.h/8) + 1] = string.byte(glyph, i)
end
- fb.x = fb.x + table.getn(glyph) / fh + 2
+ fb.x = fb.x + string.len(glyph) / fh + 2
if fb.x > fb.w then
fb.put(font, 10)
end