Returns a new Imlib2::Font
Note: the specified font must be in the font path. See Imlib2::Font::list_paths() for a list of font paths, and Imlib2::Font::list_fonts() for a list of fonts.
Examples:
font = Imlib2::Font.new 'helvetica/24' font = Imlib2::Font.load 'helvetica/24'
Returns a new Imlib2::Font
Note: the specified font must be in the font path. See Imlib2::Font::list_paths() for a list of font paths, and Imlib2::Font::list_fonts() for a list of fonts.
Examples:
font = Imlib2::Font.new 'helvetica/24' font = Imlib2::Font.load 'helvetica/24'
Remove a path from the list of font paths.
Example:
Imlib2::Font.remove_path '/usr/lib/X11/fonts/Truetype'
Get the horizontal and vertical advance of the given string using this font.
Example:
font = Imlib2::Font.new 'verdana/36' advances = font.advance "what's my advance?" ['horizontal', 'vertical'].each_index { |i, v| puts 'text ' << v << ' advance = ' << advances[i] }
Get the horizontal and vertical advance of the given string using this font.
Example:
font = Imlib2::Font.new 'verdana/36' advances = font.advance "what's my advance?" ['horizontal', 'vertical'].each_index { |i, v| puts 'text ' << v << ' advance = ' << advances[i] }
Get the character index of the pixel at the given coordinates using this font.
Example:
x, y, char_w, char_h = font.index "index\nstring\n", 5, 5
Get the inset of the given string using this font
Example:
font = Imlib2::Font.new 'palatino/9' inset = font.inset 'wonder what the inset for this string is...'
Get the character coordinates of the at the given index using this font.
Example:
x, y, char_w, char_h = font.index "index\nstring\n", 8
Get the width and height of the given string using this font.
Example:
font = Imlib2::Font.new 'helvetica/12' size = font.size 'how big am i?' ['width', 'height'].each_index { |i, v| puts 'text ' << v << ' = ' << size[i] }
Get the character index of the pixel at the given coordinates using this font.
Example:
x, y, char_w, char_h = font.index "index\nstring\n", 5, 5
Get the inset of the given string using this font
Example:
font = Imlib2::Font.new 'palatino/9' inset = font.inset 'wonder what the inset for this string is...'
Get the character coordinates of the at the given index using this font.
Example:
x, y, char_w, char_h = font.index "index\nstring\n", 8
Get the width and height of the given string using this font.
Example:
font = Imlib2::Font.new 'helvetica/12' size = font.size 'how big am i?' ['width', 'height'].each_index { |i, v| puts 'text ' << v << ' = ' << size[i] }
Get the horizontal and vertical advance of the given string using this font.
Example:
font = Imlib2::Font.new 'verdana/36' advances = font.advance "what's my advance?" ['horizontal', 'vertical'].each_index { |i, v| puts 'text ' << v << ' advance = ' << advances[i] }
Get the character index of the pixel at the given coordinates using this font.
Example:
x, y, char_w, char_h = font.index "index\nstring\n", 5, 5
Get the character index of the pixel at the given coordinates using this font.
Example:
x, y, char_w, char_h = font.index "index\nstring\n", 5, 5
Get the inset of the given string using this font
Example:
font = Imlib2::Font.new 'palatino/9' inset = font.inset 'wonder what the inset for this string is...'
Get the character coordinates of the at the given index using this font.
Example:
x, y, char_w, char_h = font.index "index\nstring\n", 8
Get the character coordinates of the at the given index using this font.
Example:
x, y, char_w, char_h = font.index "index\nstring\n", 8