From d534443387791a4cdae10241cbc3584afd22ee9b Mon Sep 17 00:00:00 2001 From: Rui Miguel Santos Date: Thu, 8 Feb 2018 14:04:03 +0000 Subject: [PATCH 1/2] Allow setting disable_wrap_by_char option Added in Prawn 1.2, disable_wrap_by_char allows text boxes to disable wrapping by character. When used with :shrink_to_fit overflow option, this will shrink the word all the way down to fit it in a single unbroken line, instead of having mid-word line breaks. --- lib/prawn/table/cell/text.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/prawn/table/cell/text.rb b/lib/prawn/table/cell/text.rb index ff28789..c8b82e1 100644 --- a/lib/prawn/table/cell/text.rb +++ b/lib/prawn/table/cell/text.rb @@ -17,7 +17,7 @@ class Text < Cell TextOptions = [:inline_format, :kerning, :size, :align, :valign, :rotate, :rotate_around, :leading, :single_line, :skip_encoding, - :overflow, :min_font_size] + :overflow, :min_font_size, :disable_wrap_by_char] TextOptions.each do |option| define_method("#{option}=") { |v| @text_options[option] = v } From fc912016885841694d8ad55e474714ee06b56b5d Mon Sep 17 00:00:00 2001 From: Rui Miguel Santos Date: Thu, 8 Feb 2018 14:28:11 +0000 Subject: [PATCH 2/2] Update manual's accepted options for text cells. --- manual/table/cell_text.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/manual/table/cell_text.rb b/manual/table/cell_text.rb index 7647f02..897d565 100644 --- a/manual/table/cell_text.rb +++ b/manual/table/cell_text.rb @@ -1,11 +1,11 @@ # encoding: utf-8 # # Text cells accept the following options: align, -# font, font_style, inline_format, -# kerning, leading, min_font_size, -# overflow, rotate, rotate_around, -# single_line, size, text_color, -# and valign. +# disable_wrap_by_char, font, font_style, +# inline_format, kerning, leading, +# min_font_size, overflow, rotate, +# rotate_around, single_line, size, +# text_color and valign. # # Most of these style options are direct translations from the text methods # styling options.