class Pixelfont::Font
- Pixelfont::Font
- Reference
- Object
Defined in:
pixelfont/font.crConstructors
- .new(path : String)
- .new(io : IO)
- .new(graphemes : Hash(Char, Pixelfont::Grapheme), properties : Pixelfont::Properties = Properties::None)
Instance Method Summary
-
#draw(string : String, x = 0, y = 0, fixed_width = false, &block : Int32, Int32, Bool -> )
Provides (x, y) cordinates and if the pixel is on
- #graphemes : Hash(Char, Pixelfont::Grapheme)
- #height_of(string : String)
- #leading : Int16
- #leading=(leading : Int16)
- #line_height : UInt16
- #line_height=(line_height : UInt16)
- #properties : Properties
- #properties=(properties : Properties)
-
#set_width : UInt16
em width or set width of the font
- #to_s(string : String, fore : Char = '█', back : Char = ' ', fixed_width = false)
- #tracking : Int16
- #tracking=(tracking : Int16)
- #width_of(string : String, fixed_width = false)
Constructor Detail
def self.new(graphemes : Hash(Char, Pixelfont::Grapheme), properties : Pixelfont::Properties = Properties::None)
#
Instance Method Detail
Provides (x, y) cordinates and if the pixel is on
font.draw("Hello, World!") do |px, py, bit|
my_screen[px, py] = RGB.new(0, 0, 0) if bit
end