# File lib/HostSystem.rb, line 113
def self.to_screendump(text,screen_width)
  lines=split_into_lines(text,screen_width)  
  canvas = PNG::Canvas.new font_width*screen_width, (pixels_between_characters+font_height)*[lines.length,screen_rows].max, default_background_colour
  line_number=0
  lines.each do |line|
    col=0
    line.each_byte do |char|
     draw_char_at(canvas,char,line_number,col) 
     col+=1 
    end    
    line_number+=1
  end  
  PNG.new(canvas).raw_bytes
end