Class: Image

Inherits:
Object
  • Object
show all
Defined in:
bdffont.rb

Overview

Imageクラスに追加するBDFフォント描画用メソッド

Instance Method Summary (collapse)

Instance Method Details

- (Object) draw_bdffont(x, y, str, bdf)

BDFフォントを描画

Parameters:

  • x (Number)

    描画x座標

  • y (Number)

    描画y座標

  • str (String)

    描画文字列

  • bdf (Object)

    BDFフォントクラス



321
322
323
324
325
326
327
328
329
330
331
# File 'bdffont.rb', line 321

def draw_bdffont(x, y, str, bdf)
  str.split('').each do |code|
    b = bdf[code]
    unless b == nil
      x1 = x + b.ofsx
      y1 = y + bdf.height + bdf.ofsy - b.h - b.ofsy
      self.draw(x1, y1, b.image)
      x += b.dwidth
    end
  end
end