POV-Ray : Newsgroups : povray.newusers : text manipulation+coordinates : Re: text manipulation+coordinates Server Time
5 Nov 2024 03:16:42 EST (-0500)
  Re: text manipulation+coordinates  
From: me
Date: 26 Jul 2002 12:07:29
Message: <20020726121007.4b98b87c.me@me.org>
Thx for the info TinCanMan and Tom.  I just installed povray yesterday, so I'm
not sure how to use the macro.... but I'll read up on it.  I'm using 3.2
because 3.5 hasnt been ported to FreeBSD UNIX yet and thats the OS I am on.

Again, much Thx,
michael

On Fri, 26 Jul 2002 07:55:53 -0400
"TinCanMan" <Tin### [at] hotmailcom> wrote:

> Also, if you are using 3.5 you can centre the text better and automatically
> using the min_extents/max_extents keyword.
> 
> Here's a macro I wrote a while ago to fit text to a certain area (scales the
> text as well):
> 
> -----8<-----
> //p1-p2 define box containing text
> //FNam = font name
> //Txt = text string
> //Spac = letter spacing
> #macro TxtFit(p1,p2,FNam,Txt,Spac)
>   #local T1=text{ttf FNam, Txt, 1,Spac*x}
>   #local TMn = min_extent (T1);
>   #local TMx = max_extent (T1);
>   #local TScal=(p2-p1)/(TMx-TMn);
>   object{T1 translate -TMn scale TScal translate p1}
> #end
> -----8<-----
> 
> used like:
> 
> object{TxtFit(<-1,-1,0>,<2,1,1>,"arial","If the text fits...",0)
> //extra transformations, materials, etc.
> }
> 
> this fits the given text between the two points along the x-y plane.  You
> can then rotate the text or translate as needed to suit.
> 
> -tgq
> 
>


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.