POV-Ray : Newsgroups : povray.newusers : --- Server Time
5 Sep 2024 10:25:40 EDT (-0400)
  --- (Message 1 to 2 of 2)  
From: Zero
Subject: ---
Date: 4 Jul 2001 10:28:17
Message: <3b432801$1@news.povray.org>
I'm not really a new user, but this question is so basic (and I'm such an
amateur) that this seemed like the right group to ask.  Ok, here's the deal:
I'm trying to align text around a circle.  I have been trying by making the
individual letters, then translating them down, and subsequently rotating
them into place.  However this gives 2 problems: 1. the origin is in the
lower left of each letter, so after rotating they still don't align nicely
and instead slope to the right a bit, and 2. since I don't know the width of
each character I can't space them correctly.
Now I know in the Win32 GUI there is a function which tells you the width of
a character, but I'm guessing this isn't implemented in povray.  So my
question is: is there any way to calculate the width of each character?  Or,
alternatively, does anyone know how to reach the same effect in a different
way (perhaps with a macro)?

TIA,
  Zero


Post a reply to this message

From: Mike Williams
Subject: Re:
Date: 5 Jul 2001 13:15:43
Message: <ybW3bAAY+JR7EwLs@econym.demon.co.uk>
Wasn't it Zero who wrote:
>I'm not really a new user, but this question is so basic (and I'm such an
>amateur) that this seemed like the right group to ask.  Ok, here's the deal:
>I'm trying to align text around a circle.  I have been trying by making the
>individual letters, then translating them down, and subsequently rotating
>them into place.  However this gives 2 problems: 1. the origin is in the
>lower left of each letter, so after rotating they still don't align nicely
>and instead slope to the right a bit, and 2. since I don't know the width of
>each character I can't space them correctly.
>Now I know in the Win32 GUI there is a function which tells you the width of
>a character, but I'm guessing this isn't implemented in povray.  So my
>question is: is there any way to calculate the width of each character?  Or,
>alternatively, does anyone know how to reach the same effect in a different
>way (perhaps with a macro)?

I don't know any easy way to do it in official PovRAY, but there are
ways to do it in MegaPOV.

One MegaPOV patch adds the max_extent keyword. To use this you have to
#define the letter as an object, then max_extent(that_letter) is a
vector which shows the maximum x, y and z values that the letter
reaches. As the lower left of the letter is at the origin, the x
component of the max_extent is the width.

The easy way to solve the first of your problems (but not the second) is
to use another keyword added by a MegaPOV patch. "align_center" is a
modifier than can be applied to a text object. When you apply it to a
single letter text object then the origin is at the centre of the bottom
of the letter.



-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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