Method: FPDF#GetStringWidth

Defined in:
lib/fpdf.rb

#GetStringWidth(s) ⇒ Object



378
379
380
381
382
383
384
385
386
# File 'lib/fpdf.rb', line 378

def GetStringWidth(s)
    # Get width of a string in the current font
    cw=@CurrentFont['cw']
    w=0
    s.each_byte do |c|
        w=w+cw[c]
    end
    w*@FontSize/1000.0
end