Returns |
[minx, maxx, miny, maxy, advance], or nil on failure. |
# File lib/ruby-sdl-ffi/ttf.rb, line 111 def self.GlyphMetrics( font, char ) minx, maxx = FFI::Buffer.new(:int), FFI::Buffer.new(:int) miny, maxy = FFI::Buffer.new(:int), FFI::Buffer.new(:int) advance = FFI::Buffer.new(:int) result = __GlyphMetrics( font, char, minx, maxx, miny, maxy, advance ) if( result == 0 ) return [minx.get_int(0), maxx.get_int(0), miny.get_int(0), maxy.get_int(0), advance.get_int(0)] else nil end end
# File lib/ruby-sdl-ffi/ttf.rb, line 129 def self.SizeText( font, text ) w = FFI::Buffer.new( :int ) h = FFI::Buffer.new( :int ) __SizeText( font, text, w, h ) return [w.get_int(0),h.get_int(0)] end
# File lib/ruby-sdl-ffi/ttf.rb, line 153 def self.SizeUNICODE( font, text ) w = FFI::Buffer.new( :int ) h = FFI::Buffer.new( :int ) __SizeUNICODE( font, text, w, h ) return [w.get_int(0),h.get_int(0)] end
Generated with the Darkfish Rdoc Generator 2.