Class: RubySketch::Processing::Font
- Inherits:
-
Object
- Object
- RubySketch::Processing::Font
- Defined in:
- lib/rubysketch/processing.rb
Overview
Font object.
Instance Method Summary collapse
-
#textBounds(str, x = 0, y = 0, fontSize = nil) ⇒ TextBounds
Returns bounding box.
Instance Method Details
#textBounds(str) ⇒ TextBounds #textBounds(str, x, y) ⇒ TextBounds #textBounds(str, x, y, fontSize) ⇒ TextBounds
Returns bounding box.
671 672 673 674 |
# File 'lib/rubysketch/processing.rb', line 671 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 |