This repository was archived by the owner on Dec 19, 2023. It is now read-only.
forked from prawnpdf/prawn
-
Notifications
You must be signed in to change notification settings - Fork 1
Adding formatted multi-column text feature #1
Open
MikeBlyth
wants to merge
15
commits into
actblue:master
Choose a base branch
from
MikeBlyth:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You can now pass arbitrary options inline with table cells:
pdf.table([[ {:content => 'hello', :font_style => :bold } ]])
This was inflating the assertion count and increasing test time because it would run the matcher block every time match? was called.
This reverses 8e0de9a, which I probably had a good reason for at the time but for some reason didn't document. The behavior introduced by that commit broke table cells inside stretchy bounds, because the absolute location of the y-position depends on when the bounds are stretched (prawnpdf#153). Introduced a spec to cover the new behavior and prevent regressions. Closes prawnpdf#153.
Previously, we would use the reference bounds (margin box if the parent bounds were stretchy) to determine whether to flow a cell that would not fit on the current page to the next page. This incorrectly handled the case where the parent bounds were stretchy but we were at the top. That has been specced and fixed.
* draw_text should draw exactly the string it is given, even if it is composed entirely of spaces * text may collapse empty strings (due to line wrapping), but if it writes anything to the page, it should be blank. Closes prawnpdf#132.
Check, before rendering the table, to be sure that we can draw the first body row (excluding any header). If we can't, start the entire table on the next page. Closes prawnpdf#152.
Prawn::Images::{PNG,JPG} are now responsible for building the PDF
objects that they represent. This will allow for greater modularity --
adding more image types as needed, and as a stepping stone to table
image cell support. The protocol involves two methods on
Prawn::Images::*:
* #build_pdf_object(document): Build a PDF XObject representing the
image. Return a Reference to that object.
* #min_pdf_version: The minimum PDF version (as a Float) required to
support the image's features (such as alpha transparency or 16-bit
color). This method is optional; it is guarded by respond_to?.
Since '.' is no longer in the $LOAD_PATH in Ruby 1.9.2, we have to run an expand_path over the resulting path from File.dirname(__FILE__). Closes prawnpdf#154.
formatted_text_boxes to make a multi-column layout that is automatically filled (right column to left) and continued to subsequent pages as needed.
* Block form is available via the Prawn::Document#text_rendering_mode() method * Inline for is available as the :mode option to the Prawn::Document#text() method
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
to text_box and formatted_box but flows across a number
of columns on the page then on to the next page.
Example usage:
p.formatted_columns(lorem*15, :columns=>2,
:size=>11, :align=>:left, :inline_format=> true)
An example is at examples/text/formatted_columns.rb