Re: Re: Changing fonts on the same line
"Mr. Shawn H. Corey" <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.pdfapi2 |
|---|---|
| Message-ID | <[email protected]> |
spinningwebz2002 wrote:
> I have been doing that. I think using advancedwidth will allow me to
> build a "map" of each line of text and be able to do it. Do you know
> what information it is looking for in this:
>
> qw[ font fontsize wordspace charspace hspace]
>
> Which comes from %textstate when called
>
> $txt->advancewidth $string [, %textstate]
They are used to calculate the width of the text without making changes
to the PDF. Whenever you do a command like `$text->font( $fontobj,
$fontsize );` a command is added to the PDF to set the font. If you
change the font every time you calculate an advancewidth, you end up
with a lot of set font commands in a row. This means they a wasted
effort since only the last one will be effective.
--
Just my 0.00000002 million dollars worth,
Shawn
"For the things we have to learn before we can do them, we learn by
doing them."
Aristotle