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:
> 	# 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.