Re: Changing fonts on the same line
"spinningwebz2002" <spinningwebz2002-/[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.pdfapi2 |
|---|---|
| Message-ID | <[email protected]> |
--- In [email protected], "Mr. Shawn H. Corey" <shawnhcorey@...> wrote: > > spinningwebz2002 wrote: > > # here is where I am not sure how to do in PDF::API2 > > > > $thisletterwidth = What is the width of the character in $a > > using the current font settings? > > $$thisletterwidth = $text->advancewidth( $a ); > > > > > if ($thisletterwidth + (What is the current print position on > > this line?) >= (Farthest right I want to print) ) > > { > > Insert a little spacing into the current line to > > justify it? > > Start a new line > > } > > > > Add $a to the current line > > > > $thislinetoprint = substr($thislinetoprint,1); > > > > Bypass: > > } > > I suggest to track down PDF::API2::Content.pm on your system and take a > look at it's paragraph method. It can give a lot of ideas especially > the code for a justified paragraph. > > > -- > 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 > 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] Bill H