> That seems the most sensible yeah ? Any others thinking along the same
> lines (or) even better have code kicking around to do it ?
The best bet is to generalize what can be displayed in a cell. Search
for 'Section' in this email,
we've later been calling this concept an element.
http://groups.google.com/group/prawn-ruby/msg/3467f25d0506e7e7
--
Technical Blaag at: http://blog.majesticseacreature.com | Non-tech
stuff at: http://metametta.blogspot.com
I may need it for a job I'm doing, if so, big win for all of us.
However, the Ruby Mendicant hours I owe are still dedicated to cleanup
and speed optimization.
So basically... patches welcome :)
> I currently have a project to display data in a table, with styled
> fonts, and images in table cells. I didn't see any obvious way to
> achieve what I needed to do, so I took a stab at allowing font_style,
> font_color, and font_size to be specified for a cell.
>
> While font_color and font_style seem ok, I'm not confident about
> font_size enough to submit it as a patch yet, because I don't have
> sufficient test coverage, and I think there are issues in calculating
> cell height.
font_style is likely only okay for certain fonts. If you're not
re-doing the cell size calculations,
you will eventually run into spacing issues because a bold or italic
font is not necessarily the same width and height as a normal one.
> Questions:
> 1. Is there already a way to get font_style and font_color on a per
> cell basis within a table?
No
> 2. Is there already a way to get an image and text into a cell in a
> table?
No.
> 3. Is there a way to get different font styles and colors within a
> table cell?
No.
> I'm looking for something like this (Imagine there are just two big
> cells, not 6)
> | || error!(red
> text) |
> | cell one || expected value(black text) |
> | || actual value(black or red text) |
>
> While thinking through the design, it occurred to us that people will
> most likely PRINT these pdfs, and in most cases the color would be
> lost on a non-color printer. Then we started to think more about using
> some clean images to denote 'success' vs. 'fail', and now I'm trying
> to figure out if its possible to have a cell with an image, \n text,
> \n text.
>
> I've run all the examples (which were quite helpful), and looked
> through the code, but I'll keep poking around to see if I can figure
> it out.
Text is uniform across the table. To handle different fonts in
different cells, we'd need to consider this at the time of
calculation.
An interim solution are fixed width and height bounding_boxes with
borders. That's what a "Section" or "Element" will be, but it has not
been implemented yet.
-greg