You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First - thank you for the library. This thing is great. :) I think I found a bug I'd like to report. I'd fix it, I'm just not sure how/where to go to fix it.
Steps to reproduce:
Save this file as example.rb and run it via ruby example.rb
require 'date'
require 'prawn'
timestamp = (Time.now.to_f * 1000).to_i
generated_pdf_name = "render-#{timestamp}.pdf"
Prawn::Document.generate(generated_pdf_name, page_layout: :landscape, page_size: "A0") do
formatted_text_box [{
text: "This really long text should fit inside of the box and it should shrink to fit as this is a test.",
size: 124,
styles: [:bold]
}],
at: [485, 1700],
width: 2240,
height: 345,
overflow: :shrink_to_fit
end
You'll notice that the text looks like this:
The text is truncated.
Next, change the shrink_to_fit to expand (overflow: :expand) and re-run the file and you'll get this:
The :expand option seems to work, yet the :shrink_to_fit does not.
Expected results: :shrink_to_fit would shrink the text to fill the box as it does with text_box.
I cannot use text_box because I need additional formatting (highlighters). Those have been removed in this example for brevity. The :shrink_to_fit option works fine on a regular `text_box though.
TLDR; It seems that the shrink_to_fit option does not work with the formatted_text_box. Why would that occur? Am I doing something incorrectly?
The text was updated successfully, but these errors were encountered:
First - thank you for the library. This thing is great. :) I think I found a bug I'd like to report. I'd fix it, I'm just not sure how/where to go to fix it.
Steps to reproduce:
Save this file as
example.rb
and run it viaruby example.rb
You'll notice that the text looks like this:
The text is truncated.
Next, change the
shrink_to_fit
toexpand
(overflow: :expand
) and re-run the file and you'll get this:The
:expand
option seems to work, yet the:shrink_to_fit
does not.Expected results:
:shrink_to_fit
would shrink the text to fill the box as it does withtext_box
.I cannot use
text_box
because I need additional formatting (highlighters). Those have been removed in this example for brevity. The:shrink_to_fit
option works fine on a regular `text_box though.TLDR; It seems that the
shrink_to_fit
option does not work with theformatted_text_box
. Why would that occur? Am I doing something incorrectly?The text was updated successfully, but these errors were encountered: