Add support for the new glyphs
The 194 is because in UTF-8, 128 to 191 get encoded as \194\###
This commit is contained in:
parent
6ecee00c59
commit
05e8ba8401
2
api.lua
2
api.lua
|
@ -105,7 +105,7 @@ function api.print(str, x, y, col)
|
|||
pico8.cursor[2]=flr(tonumber(y) or 0)
|
||||
end
|
||||
love.graphics.setShader(pico8.text_shader)
|
||||
love.graphics.print(tostring(str):gsub("[%z\1-\31\127-\255]", " "), pico8.cursor[1], pico8.cursor[2])
|
||||
love.graphics.print(tostring(str):gsub("[%z\1-\31\154-\255]", " "):gsub("[\128-\153]", "\194%1"), pico8.cursor[1], pico8.cursor[2])
|
||||
love.graphics.setShader(pico8.draw_shader)
|
||||
if not x and not y then
|
||||
pico8.cursor[1]=0
|
||||
|
|
BIN
font.png
BIN
font.png
Binary file not shown.
Before Width: | Height: | Size: 605 B After Width: | Height: | Size: 486 B |
5
main.lua
5
main.lua
|
@ -215,9 +215,12 @@ function love.load(argv)
|
|||
pico8.screen:setFilter('linear', 'nearest')
|
||||
|
||||
local glyphs=""
|
||||
for i=32, 126 do
|
||||
for i=32, 127 do
|
||||
glyphs=glyphs..string.char(i)
|
||||
end
|
||||
for i=128, 153 do
|
||||
glyphs=glyphs..string.char(194, i)
|
||||
end
|
||||
local font=love.graphics.newImageFont("font.png", glyphs, 1)
|
||||
love.graphics.setFont(font)
|
||||
font:setFilter('nearest', 'nearest')
|
||||
|
|
Loading…
Reference in New Issue