lib/gruff/base.rb
# Returns the width of a string at this point size.
#
# Not scaled since it deals with dimensions that the regular
# scaling will handle.
Returns the width of a string at this point size.
Not scaled since it deals with dimensions that the regular
scaling will handle.
Returns the width of a string at this point size . Not scaled since it deals with dimensions that the regular scaling will handle .
def calculate_width(font, text)
      text = text.to_s
      return 0 if text.empty?
      metrics = Gruff::Renderer::Text.new(renderer, text, font: font).metrics
      metrics.width
    end
def calculate_width ( font , text ) text = text . to_s return 0 if text . empty? metrics = Gruff :: Renderer :: Text . new ( renderer , text , font : font ) . metrics metrics . width end
Returns the width of a string at this point size.
Returns the width of a string at this point size .
font
<not_specific>
text
<not_specific>