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フォントクラス



345
346
347
348
349
350
351
352
353
# File 'bdffont.rb', line 345

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