class Pixelfont::Font

Defined in:

pixelfont/font.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(path : String) #

[View source]
def self.new(io : IO) #

[View source]
def self.new(graphemes : Hash(Char, Pixelfont::Grapheme), properties : Pixelfont::Properties = Properties::None) #

[View source]

Instance Method Detail

def draw(string : String, x = 0, y = 0, fixed_width = false, &block : Int32, Int32, Bool -> ) #

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

[View source]
def graphemes : Hash(Char, Pixelfont::Grapheme) #

[View source]
def height_of(string : String) #

[View source]
def leading : Int16 #

[View source]
def leading=(leading : Int16) #

[View source]
def line_height : UInt16 #

[View source]
def line_height=(line_height : UInt16) #

[View source]
def properties : Properties #

[View source]
def properties=(properties : Properties) #

[View source]
def set_width : UInt16 #

em width or set width of the font


[View source]
def to_s(string : String, fore : Char = '█', back : Char = ' ', fixed_width = false) #

[View source]
def tracking : Int16 #

[View source]
def tracking=(tracking : Int16) #

[View source]
def width_of(string : String, fixed_width = false) #

[View source]