module Clacky::BlockFont
def self.render(text)
Render a string as block-font art. Unknown characters fall back to space.
def self.render(text) chars = text.downcase.chars glyphs = chars.map { |c| GLYPHS[c] || GLYPHS[" "] } HEIGHT.times.map do |row| glyphs.map { |g| g[row] }.join(GLYPH_GAP) end.join("\n") end
def self.width(text)
def self.width(text) render(text).lines.map { |l| l.chomp.length }.max.to_i end