class SDL::TTF::Font

Defined in:

ttf.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(path, point_size = 16, index = nil) #

[View source]

Class Method Detail

def self.open(path, &) #

[View source]

Instance Method Detail

def ascent #

Returns the maximum pixel ascent of all glyphs of the font.


[View source]
def close #

[View source]
def descent #

Returns the maximum pixel descent of all glyphs of the font.


[View source]
def face_family_name #

[View source]
def face_fixed_width? #

[View source]
def face_style_name #

[View source]
def faces #

Returns the number of faces (sub-fonts) available in the font.


[View source]
def finalize #

[View source]
def glyph_metrics(char : UInt16) #

[View source]
def glyph_provided?(char : UInt16) #

[View source]
def height #

Returns the maximum pixel height of all glyphs of the font.


[View source]
def height_of(text : String, ascii = false) #

Returns the #height of text if rendered with the current font.


[View source]
def kerning=(allowed : Bool) #

[View source]
def line_skip #

Returns the reccomended pixel height of a rendered line of text of the font.


[View source]
def outline #

[View source]
def outline=(outline) #

[View source]
def render(text : String, color, background, ascii = false) #

Renders text using this font as an SDL::Surface using the "slow and nice" shaded mode.


[View source]
def render_blended(text : String, color, ascii = false) #

Renders text using this font as an SDL::Surface using the "slow, slow, slow but ultra nice over another image" blended mode.


[View source]
def render_shaded(text : String, color, background, ascii = false) #

Renders text using this font as an SDL::Surface using the "slow and nice" shaded mode.


[View source]
def render_solid(text : String, color, ascii = false) #

Renders text using this font as an SDL::Surface using the "quick and dirty" solid mode.


[View source]
def size_of(text : String, ascii = false) #

Returns the {width, height} of text if rendered with the current font.


[View source]
def style #

[View source]
def style=(style : Style) #

[View source]
def to_unsafe : Pointer(LibTTF::Font) #

[View source]
def width_of(text : String, ascii = false) #

Returns the width of text if rendered with the current font.


[View source]