Sha256: fc5fbc53a5be7c688df1e1da97d7e90cffb88a8753e1160dc9fa3f33c9cb649a
Contents?: true
Size: 814 Bytes
Versions: 5
Compression:
Stored size: 814 Bytes
Contents
# frozen_string_literal: true module Thinreports module BasicReport module Generator module PrawnExt module WidthOf # 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 # def width_of(*) width = super - character_spacing width > 0 ? width : 0 end end end end end end # Prawn v2.3 and later includes this patch by https://github.com/prawnpdf/prawn/pull/1117. if Prawn::VERSION < '2.3.0' Prawn::Document.prepend Thinreports::BasicReport::Generator::PrawnExt::WidthOf end
Version data entries
5 entries across 5 versions & 1 rubygems