POV-Ray : Newsgroups : povray.advanced-users : width of a ttf object : Re: width of a ttf object Server Time
8 Jun 2024 05:26:40 EDT (-0400)
  Re: width of a ttf object  
From: clipka
Date: 22 Jan 2014 19:25:48
Message: <52e0618c$1@news.povray.org>
Am 23.01.2014 00:43, schrieb Anton Sherwood:
> I have a scene concept involving centred text, and I want to try it with
> many different fonts (using a Python program to write the .pov files).
> Is there a way to center text without measuring its width by eye, every
> time?  Perhaps a function that returns the dimensions of a bounding box?

Not exactly, but the functions min_extent(MyObj) and max_extent(MyObj) 
do indeed return the "lowest" and "highest" corner, respectively, of the 
bounding box, so the following line should do the job:

#local Width = (max_extent(MyTextObj)-min_extent(MyTextObj)).x;


Post a reply to this message

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