module Thinreports::Generator::PrawnExt::WidthOf

Public Instance Methods

width_of(*) click to toggle source

This patch fixes the character_spacing effect on text width calculation.

The original width_of:

width_of('abcd') #=> 4 + 4 = 8

The width_of in this patch:

width_of('abcd') #=> 4 + 3 = 7
Calls superclass method
# File lib/thinreports/generator/pdf/prawn_ext/width_of.rb, line 17
def width_of(*)
  width = super - character_spacing
  width > 0 ? width : 0
end