[fxruby-users] FXDCWindow::drawText encoding

Jannis Pohlmann info at sten-net.de
Wed Mar 23 10:59:13 EST 2005


BTW, this should be most typical for Ruby (assuming you already know the 
coordinates
where you want to draw):

    str = "foo\nbar" # or "foo\r\nbar"
    lines = str.split(/[\r]?\n/)
    nr = 0
    lines.each do |line|
        dc.drawText(x, y + dc.font.fontAscent + nr * dc.font.fontHeight, 
line)
        nr += 1
    end

Hails,
Jannis


More information about the fxruby-users mailing list