Skip to content

Commit

Permalink
Merge pull request #19 from schollz/grid
Browse files Browse the repository at this point in the history
Grid
  • Loading branch information
schollz authored Feb 14, 2021
2 parents 4abf5a9 + 34a12fb commit f2abf9f
Show file tree
Hide file tree
Showing 5 changed files with 915 additions and 10 deletions.
1 change: 1 addition & 0 deletions lib/glyphs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"glyph":" ","positions":[]},{"glyph":"!","positions":[{"x":1,"y":0},{"x":1,"y":1},{"x":1,"y":3}]},{"glyph":"\"","positions":[{"x":0,"y":0},{"x":2,"y":0},{"x":0,"y":1},{"x":2,"y":1}]},{"glyph":"#","positions":[{"x":2,"y":0},{"x":0,"y":1},{"x":2,"y":2},{"x":0,"y":3}]},{"glyph":"$","positions":[{"x":1,"y":0},{"x":2,"y":0},{"x":0,"y":1},{"x":1,"y":1},{"x":1,"y":2},{"x":2,"y":2},{"x":0,"y":3},{"x":1,"y":3}]},{"glyph":"%","positions":[{"x":0,"y":0},{"x":1,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":1,"y":2},{"x":2,"y":3}]},{"glyph":"\u0026","positions":[{"x":1,"y":1},{"x":0,"y":2},{"x":1,"y":2},{"x":2,"y":2},{"x":1,"y":3}]},{"glyph":"'","positions":[{"x":1,"y":0},{"x":1,"y":1}]},{"glyph":"(","positions":[{"x":1,"y":0},{"x":0,"y":1},{"x":0,"y":2},{"x":1,"y":3}]},{"glyph":")","positions":[{"x":1,"y":0},{"x":2,"y":1},{"x":2,"y":2},{"x":1,"y":3}]},{"glyph":"*","positions":[{"x":0,"y":0},{"x":2,"y":0},{"x":1,"y":1},{"x":0,"y":2},{"x":2,"y":2}]},{"glyph":"+","positions":[{"x":1,"y":0},{"x":0,"y":1},{"x":1,"y":1},{"x":2,"y":1},{"x":1,"y":2}]},{"glyph":",","positions":[{"x":2,"y":2},{"x":1,"y":3}]},{"glyph":"-","positions":[{"x":0,"y":1},{"x":1,"y":1},{"x":2,"y":1}]},{"glyph":".","positions":[{"x":1,"y":3}]},{"glyph":"/","positions":[{"x":2,"y":0},{"x":1,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":1,"y":2},{"x":0,"y":3}]},{"glyph":"0","positions":[{"x":0,"y":0},{"x":1,"y":0},{"x":0,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":2,"y":2},{"x":1,"y":3},{"x":2,"y":3}]},{"glyph":"1","positions":[{"x":1,"y":0},{"x":0,"y":1},{"x":1,"y":1},{"x":1,"y":2},{"x":1,"y":3}]},{"glyph":"2","positions":[{"x":0,"y":0},{"x":1,"y":0},{"x":1,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":0,"y":3},{"x":1,"y":3},{"x":2,"y":3}]},{"glyph":"3","positions":[{"x":0,"y":0},{"x":1,"y":0},{"x":1,"y":1},{"x":2,"y":1},{"x":2,"y":2},{"x":0,"y":3},{"x":1,"y":3}]},{"glyph":"4","positions":[{"x":0,"y":0},{"x":2,"y":0},{"x":0,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":1,"y":2},{"x":2,"y":2},{"x":2,"y":3}]},{"glyph":"5","positions":[{"x":0,"y":0},{"x":1,"y":0},{"x":2,"y":0},{"x":0,"y":1},{"x":1,"y":1},{"x":2,"y":2},{"x":0,"y":3},{"x":1,"y":3}]},{"glyph":"6","positions":[{"x":1,"y":0},{"x":2,"y":0},{"x":0,"y":1},{"x":1,"y":1},{"x":0,"y":2},{"x":2,"y":2},{"x":1,"y":3},{"x":2,"y":3}]},{"glyph":"7","positions":[{"x":0,"y":0},{"x":1,"y":0},{"x":2,"y":0},{"x":2,"y":1},{"x":1,"y":2},{"x":1,"y":3}]},{"glyph":"8","positions":[{"x":1,"y":0},{"x":2,"y":0},{"x":0,"y":1},{"x":1,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":2,"y":2},{"x":0,"y":3},{"x":1,"y":3},{"x":2,"y":3}]},{"glyph":"9","positions":[{"x":0,"y":0},{"x":1,"y":0},{"x":0,"y":1},{"x":2,"y":1},{"x":1,"y":2},{"x":2,"y":2},{"x":0,"y":3},{"x":1,"y":3}]},{"glyph":":","positions":[{"x":1,"y":1},{"x":1,"y":3}]},{"glyph":";","positions":[{"x":1,"y":0},{"x":2,"y":2},{"x":1,"y":3}]},{"glyph":"\u003c","positions":[{"x":2,"y":0},{"x":0,"y":1},{"x":1,"y":1},{"x":2,"y":2}]},{"glyph":"=","positions":[{"x":0,"y":0},{"x":1,"y":0},{"x":2,"y":0},{"x":0,"y":2},{"x":1,"y":2},{"x":2,"y":2}]},{"glyph":"\u003e","positions":[{"x":0,"y":0},{"x":1,"y":1},{"x":2,"y":1},{"x":0,"y":2}]},{"glyph":"?","positions":[{"x":0,"y":0},{"x":1,"y":0},{"x":2,"y":0},{"x":1,"y":1},{"x":2,"y":1},{"x":1,"y":3}]},{"glyph":"@","positions":[{"x":0,"y":0},{"x":1,"y":0},{"x":2,"y":0},{"x":0,"y":1},{"x":2,"y":1},{"x":2,"y":2},{"x":1,"y":3},{"x":2,"y":3}]},{"glyph":"A","positions":[{"x":1,"y":0},{"x":0,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":1,"y":2},{"x":2,"y":2},{"x":0,"y":3},{"x":2,"y":3}]},{"glyph":"B","positions":[{"x":0,"y":0},{"x":1,"y":0},{"x":0,"y":1},{"x":1,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":2,"y":2},{"x":0,"y":3},{"x":1,"y":3}]},{"glyph":"C","positions":[{"x":1,"y":0},{"x":2,"y":0},{"x":0,"y":1},{"x":0,"y":2},{"x":0,"y":3},{"x":1,"y":3},{"x":2,"y":3}]},{"glyph":"D","positions":[{"x":0,"y":0},{"x":1,"y":0},{"x":0,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":2,"y":2},{"x":0,"y":3},{"x":1,"y":3}]},{"glyph":"E","positions":[{"x":0,"y":0},{"x":1,"y":0},{"x":2,"y":0},{"x":0,"y":1},{"x":1,"y":1},{"x":0,"y":2},{"x":0,"y":3},{"x":1,"y":3},{"x":2,"y":3}]},{"glyph":"F","positions":[{"x":1,"y":0},{"x":2,"y":0},{"x":0,"y":1},{"x":0,"y":2},{"x":1,"y":2},{"x":2,"y":2},{"x":0,"y":3}]},{"glyph":"G","positions":[{"x":1,"y":0},{"x":2,"y":0},{"x":0,"y":1},{"x":0,"y":2},{"x":2,"y":2},{"x":0,"y":3},{"x":1,"y":3},{"x":2,"y":3}]},{"glyph":"H","positions":[{"x":0,"y":0},{"x":2,"y":0},{"x":0,"y":1},{"x":1,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":2,"y":2},{"x":0,"y":3},{"x":2,"y":3}]},{"glyph":"I","positions":[{"x":0,"y":0},{"x":1,"y":0},{"x":2,"y":0},{"x":1,"y":1},{"x":1,"y":2},{"x":0,"y":3},{"x":1,"y":3},{"x":2,"y":3}]},{"glyph":"J","positions":[{"x":1,"y":0},{"x":2,"y":0},{"x":2,"y":1},{"x":0,"y":2},{"x":2,"y":2},{"x":1,"y":3}]},{"glyph":"K","positions":[{"x":0,"y":0},{"x":2,"y":0},{"x":0,"y":1},{"x":1,"y":1},{"x":0,"y":2},{"x":1,"y":2},{"x":0,"y":3},{"x":2,"y":3}]},{"glyph":"L","positions":[{"x":0,"y":0},{"x":0,"y":1},{"x":0,"y":2},{"x":1,"y":3},{"x":2,"y":3}]},{"glyph":"M","positions":[{"x":1,"y":0},{"x":2,"y":0},{"x":0,"y":1},{"x":1,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":1,"y":2},{"x":2,"y":2},{"x":0,"y":3},{"x":2,"y":3}]},{"glyph":"N","positions":[{"x":1,"y":0},{"x":2,"y":0},{"x":0,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":2,"y":2},{"x":0,"y":3},{"x":2,"y":3}]},{"glyph":"O","positions":[{"x":1,"y":0},{"x":2,"y":0},{"x":0,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":2,"y":2},{"x":0,"y":3},{"x":1,"y":3},{"x":2,"y":3}]},{"glyph":"P","positions":[{"x":1,"y":0},{"x":2,"y":0},{"x":0,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":1,"y":2},{"x":2,"y":2},{"x":0,"y":3}]},{"glyph":"Q","positions":[{"x":0,"y":0},{"x":1,"y":0},{"x":2,"y":0},{"x":0,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":1,"y":2},{"x":1,"y":3},{"x":2,"y":3}]},{"glyph":"R","positions":[{"x":0,"y":0},{"x":1,"y":0},{"x":0,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":1,"y":2},{"x":0,"y":3},{"x":2,"y":3}]},{"glyph":"S","positions":[{"x":1,"y":0},{"x":2,"y":0},{"x":0,"y":1},{"x":1,"y":2},{"x":2,"y":2},{"x":0,"y":3},{"x":1,"y":3},{"x":2,"y":3}]},{"glyph":"T","positions":[{"x":0,"y":0},{"x":1,"y":0},{"x":2,"y":0},{"x":1,"y":1},{"x":1,"y":2},{"x":1,"y":3}]},{"glyph":"U","positions":[{"x":0,"y":0},{"x":2,"y":0},{"x":0,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":2,"y":2},{"x":1,"y":3},{"x":2,"y":3}]},{"glyph":"V","positions":[{"x":0,"y":0},{"x":2,"y":0},{"x":0,"y":1},{"x":2,"y":1},{"x":1,"y":2},{"x":2,"y":2},{"x":1,"y":3},{"x":2,"y":3}]},{"glyph":"W","positions":[{"x":0,"y":0},{"x":2,"y":0},{"x":0,"y":1},{"x":1,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":1,"y":2},{"x":2,"y":2},{"x":0,"y":3},{"x":1,"y":3}]},{"glyph":"X","positions":[{"x":0,"y":0},{"x":2,"y":0},{"x":1,"y":1},{"x":0,"y":2},{"x":2,"y":2},{"x":0,"y":3},{"x":2,"y":3}]},{"glyph":"Y","positions":[{"x":0,"y":0},{"x":2,"y":0},{"x":0,"y":1},{"x":2,"y":1},{"x":1,"y":2},{"x":1,"y":3}]},{"glyph":"Z","positions":[{"x":0,"y":0},{"x":1,"y":0},{"x":2,"y":0},{"x":1,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":0,"y":3},{"x":1,"y":3},{"x":2,"y":3}]},{"glyph":"[","positions":[{"x":0,"y":0},{"x":1,"y":0},{"x":0,"y":1},{"x":0,"y":2},{"x":0,"y":3},{"x":1,"y":3}]},{"glyph":"\\","positions":[{"x":0,"y":0},{"x":0,"y":1},{"x":1,"y":1},{"x":1,"y":2},{"x":2,"y":2},{"x":2,"y":3}]},{"glyph":"]","positions":[{"x":1,"y":0},{"x":2,"y":0},{"x":2,"y":1},{"x":2,"y":2},{"x":1,"y":3},{"x":2,"y":3}]},{"glyph":"^","positions":[{"x":1,"y":0},{"x":0,"y":1},{"x":2,"y":1}]},{"glyph":"_","positions":[{"x":0,"y":3},{"x":1,"y":3},{"x":2,"y":3}]},{"glyph":"`","positions":[{"x":0,"y":0},{"x":1,"y":1}]},{"glyph":"a","positions":[{"x":1,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":2,"y":2},{"x":1,"y":3},{"x":2,"y":3}]},{"glyph":"b","positions":[{"x":0,"y":0},{"x":0,"y":1},{"x":1,"y":1},{"x":0,"y":2},{"x":2,"y":2},{"x":0,"y":3},{"x":1,"y":3}]},{"glyph":"c","positions":[{"x":1,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":0,"y":3},{"x":1,"y":3},{"x":2,"y":3}]},{"glyph":"d","positions":[{"x":2,"y":0},{"x":1,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":2,"y":2},{"x":1,"y":3},{"x":2,"y":3}]},{"glyph":"e","positions":[{"x":1,"y":0},{"x":2,"y":0},{"x":0,"y":1},{"x":1,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":1,"y":3},{"x":2,"y":3}]},{"glyph":"f","positions":[{"x":2,"y":0},{"x":1,"y":1},{"x":0,"y":2},{"x":1,"y":2},{"x":2,"y":2},{"x":1,"y":3}]},{"glyph":"g","positions":[{"x":1,"y":0},{"x":2,"y":0},{"x":0,"y":1},{"x":2,"y":1},{"x":1,"y":2},{"x":2,"y":2},{"x":0,"y":3},{"x":1,"y":3}]},{"glyph":"h","positions":[{"x":0,"y":0},{"x":0,"y":1},{"x":1,"y":1},{"x":0,"y":2},{"x":2,"y":2},{"x":0,"y":3},{"x":2,"y":3}]},{"glyph":"i","positions":[{"x":0,"y":0},{"x":1,"y":2},{"x":1,"y":3}]},{"glyph":"j","positions":[{"x":1,"y":0},{"x":2,"y":1},{"x":0,"y":2},{"x":2,"y":2},{"x":1,"y":3}]},{"glyph":"k","positions":[{"x":0,"y":0},{"x":0,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":1,"y":2},{"x":0,"y":3},{"x":2,"y":3}]},{"glyph":"l","positions":[{"x":1,"y":0},{"x":1,"y":1},{"x":1,"y":2},{"x":2,"y":3}]},{"glyph":"m","positions":[{"x":1,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":1,"y":2},{"x":2,"y":2},{"x":0,"y":3},{"x":2,"y":3}]},{"glyph":"n","positions":[{"x":1,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":2,"y":2},{"x":0,"y":3},{"x":2,"y":3}]},{"glyph":"o","positions":[{"x":1,"y":1},{"x":0,"y":2},{"x":2,"y":2},{"x":0,"y":3},{"x":1,"y":3}]},{"glyph":"p","positions":[{"x":1,"y":0},{"x":0,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":1,"y":2},{"x":0,"y":3}]},{"glyph":"q","positions":[{"x":1,"y":0},{"x":0,"y":1},{"x":2,"y":1},{"x":1,"y":2},{"x":2,"y":2},{"x":2,"y":3}]},{"glyph":"r","positions":[{"x":1,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":0,"y":3}]},{"glyph":"s","positions":[{"x":1,"y":0},{"x":2,"y":0},{"x":0,"y":1},{"x":1,"y":1},{"x":2,"y":2},{"x":0,"y":3},{"x":1,"y":3}]},{"glyph":"t","positions":[{"x":1,"y":0},{"x":0,"y":1},{"x":1,"y":1},{"x":2,"y":1},{"x":1,"y":2},{"x":2,"y":3}]},{"glyph":"u","positions":[{"x":0,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":2,"y":2},{"x":1,"y":3},{"x":2,"y":3}]},{"glyph":"v","positions":[{"x":0,"y":1},{"x":2,"y":1},{"x":1,"y":2},{"x":2,"y":2},{"x":1,"y":3},{"x":2,"y":3}]},{"glyph":"w","positions":[{"x":0,"y":1},{"x":2,"y":1},{"x":0,"y":2},{"x":1,"y":2},{"x":2,"y":2},{"x":0,"y":3},{"x":1,"y":3}]},{"glyph":"x","positions":[{"x":0,"y":1},{"x":2,"y":1},{"x":1,"y":2},{"x":0,"y":3},{"x":2,"y":3}]},{"glyph":"y","positions":[{"x":0,"y":0},{"x":2,"y":0},{"x":1,"y":1},{"x":2,"y":1},{"x":2,"y":2},{"x":0,"y":3},{"x":1,"y":3}]},{"glyph":"z","positions":[{"x":0,"y":1},{"x":1,"y":1},{"x":1,"y":2},{"x":1,"y":3},{"x":2,"y":3}]},{"glyph":"{","positions":[{"x":1,"y":0},{"x":2,"y":0},{"x":0,"y":1},{"x":1,"y":1},{"x":1,"y":2},{"x":1,"y":3},{"x":2,"y":3}]},{"glyph":"|","positions":[{"x":0,"y":0},{"x":1,"y":0},{"x":0,"y":1},{"x":1,"y":1},{"x":0,"y":2},{"x":1,"y":2},{"x":0,"y":3},{"x":1,"y":3}]},{"glyph":"}","positions":[{"x":0,"y":0},{"x":1,"y":0},{"x":1,"y":1},{"x":2,"y":1},{"x":1,"y":2},{"x":0,"y":3},{"x":1,"y":3}]},{"glyph":"~","positions":[{"x":0,"y":1},{"x":1,"y":1},{"x":1,"y":2},{"x":2,"y":2}]}]
31 changes: 31 additions & 0 deletions lib/glyphs.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
local Glyphs={}
local json=include("oooooo/lib/json")
local f=io.open(_path.code.."oooooo/lib/glyphs.json","rb")
local content=f:read("*all")
f:close()

local glyphs=json.decode(content)


function Glyphs.pixels(name)
pixels={}
for i=1,#name do
if i==5 then
break
end
letter=name:sub(i,i)
for _,glyph in ipairs(glyphs) do
if glyph.glyph==letter then
for _,position in ipairs(glyph.positions) do
table.insert(pixels,{position.y+1,position.x+(i-1)*4+1,15})
end
break
end
end
end


return pixels
end

return Glyphs
Loading

0 comments on commit f2abf9f

Please sign in to comment.