6.0.0-beta1
7/7/25

[#8945] Different font styles in justified cells in PDF files
Summary Different font styles in justified cells in PDF files
Queue Horde Framework Packages
Queue Version FRAMEWORK_3
Type Enhancement
State No Feedback
Priority 1. Low
Owners
Requester sebastian.radish (at) gmx (dot) de
Created 04/01/2010 (5576 days ago)
Due
Updated 01/22/2011 (5280 days ago)
Assigned
Resolved 01/22/2011 (5280 days ago)
Milestone
Patch No

History
01/22/2011 05:12:51 PM Jan Schneider State ⇒ No Feedback
 
10/22/2010 12:39:00 PM sebastian (dot) radish (at) gmx (dot) de Comment #3 Reply to this comment
I think the problem is in the write function of the PDF class. It 
supports justified text, but it is impossible to change the font in 
the text string.
Besides, the function sends the data directly to the output stream, so 
you can't use 2 write calls.

I don't have a nice solution (yet). My hack solves the problem for me, 
but probably not for many others.
10/21/2010 05:04:46 PM Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
This sounds really hackish. But without a patch, I'm not even sure I 
understand what you suggested.
04/01/2010 12:15:14 AM sebastian (dot) radish (at) gmx (dot) de Comment #1
Priority ⇒ 1. Low
Patch ⇒ No
Milestone ⇒
Queue ⇒ Horde Framework Packages
Summary ⇒ Different font styles in justified cells in PDF files
Type ⇒ Enhancement
State ⇒ New
Reply to this comment
Justified text looks really nice and the File_PDF class can do this 
with the multiCell function.
BUT if you want to mark a word bold/italic inside this text there is 
no simple way to get the whole line justified.

I wrote a dirty hack. (It's very, very dirty, so I won't post a patch 
(yet)) But the idea is the following:
1. Add some HTML/BBCode tags to the text.
2. While parsing the text char after char, use the tags to update the 
font internally (Don't print the new font to the buffer.) but ignore 
them in the string width.
3. When formating the text for output (done in cell()), replace the 
HTML tags with something like this: ") Tj <NEW FONT INFORMATION> ("
The PDF viewer does the rest.

It took me some hours to figure this out. But with some help, maybe I 
can write a nice patch.

Saved Queries