6.0.0-beta1
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
11/8/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#8945] Different font styles in justified cells in PDF files
*
Your Email Address
*
Spam protection
Enter the letters below:
\ /. ..___.._.. . >< |__| | | | | / \| | | _|_|/\|
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.
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers