Class: Processing::Font

Inherits:
Object
  • Object
show all
Defined in:
lib/processing/font.rb

Overview

Font object.

Instance Method Summary collapse

Instance Method Details

#textBounds(str) ⇒ TextBounds #textBounds(str, x, y) ⇒ TextBounds #textBounds(str, x, y, fontSize) ⇒ TextBounds

Returns bounding box.



26
27
28
29
# File 'lib/processing/font.rb', line 26

def textBounds(str, x = 0, y = 0, fontSize = nil)
  f = fontSize ? Rays::Font.new(@font.name, fontSize) : @font
  TextBounds.new x, y, x + f.width(str), y + f.height
end