[Tickets #8945] Different font styles in justified cells in PDF files

bugs at horde.org bugs at horde.org
Thu Apr 1 00:15:14 UTC 2010


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/8945
------------------------------------------------------------------------------
  Ticket             | 8945
  Created By         | sebastian.radish at gmx.de
  Summary            | Different font styles in justified cells in PDF files
  Queue              | Horde Framework Packages
  Version            | FRAMEWORK_3
  Type               | Enhancement
  State              | New
  Priority           | 1. Low
  Milestone          |
  Patch              |
  Owners             |
------------------------------------------------------------------------------


sebastian.radish at gmx.de (2010-03-31 20:15) wrote:

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.






More information about the bugs mailing list