Class: Textorize::Renderer
- Inherits:
-
Object
- Object
- Textorize::Renderer
- Includes:
- OSX
- Defined in:
- lib/textorize/renderer.rb
Instance Method Summary collapse
- #bitmap ⇒ Object
-
#initialize(window, string, options) ⇒ Renderer
constructor
A new instance of Renderer.
Constructor Details
#initialize(window, string, options) ⇒ Renderer
Returns a new instance of Renderer.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/textorize/renderer.rb', line 7 def initialize(window, string, ) @text_view = NSTextView.alloc.initWithFrame([0,0,0,0]) set_attr_and_text , string window.setContentView @text_view @text_view.sizeToFit window.display window.orderFrontRegardless end |
Instance Method Details
#bitmap ⇒ Object
18 19 20 21 22 23 |
# File 'lib/textorize/renderer.rb', line 18 def bitmap @text_view.lockFocus bitmap = NSBitmapImageRep.alloc.initWithFocusedViewRect(@text_view.bounds) @text_view.unlockFocus bitmap end |