lib/prawn/text/formatted/wrap.rb in prawn-2.0.1 vs lib/prawn/text/formatted/wrap.rb in prawn-2.0.2
- old
+ new
@@ -13,19 +13,17 @@
module Text
module Formatted #:nodoc:
# @private
module Wrap #:nodoc:
-
def initialize(array, options)
@line_wrap = Prawn::Text::Formatted::LineWrap.new
@arranger = Prawn::Text::Formatted::Arranger.new(@document,
- :kerning => options[:kerning])
+ :kerning => options[:kerning])
@disable_wrap_by_char = options[:disable_wrap_by_char]
end
-
# See the developer documentation for PDF::Core::Text#wrap
#
# Formatted#wrap should set the following variables:
# <tt>@line_height</tt>::
# the height of the tallest fragment in the last printed line
@@ -101,13 +99,11 @@
@printed_lines << printed_fragments.map { |s| s.force_encoding(::Encoding::UTF_8) }.join
end
def word_spacing_for_this_line
- if @align == :justify &&
- @line_wrap.space_count > 0 &&
- !@line_wrap.paragraph_finished?
+ if @align == :justify && @line_wrap.space_count > 0 && !@line_wrap.paragraph_finished?
(available_width - @line_wrap.width) / @line_wrap.space_count
else
0
end
end
@@ -151,10 +147,9 @@
@arranger.apply_color_and_font_settings(fragment) do
draw_fragment(fragment, accumulated_width,
line_width, word_spacing)
end
end
-
end
end
end
end