POV-Ray : Newsgroups : povray.programming : The math of circular truetype fonts : Re: The math of circular truetype fonts Server Time
28 Jul 2024 16:22:24 EDT (-0400)
  Re: The math of circular truetype fonts  
From: Lummox JR
Date: 21 Feb 2000 15:01:20
Message: <38B19AA2.5222@aol.com>
Ron Parker wrote:
[snip]
> I'm also not sure this is the right group for this question; he might
> find better answers in .advanced-users.

So noted. I posted here because I couldn't think of a better group for
the discussion. Although to be honest, I think the mathematics make this
more of a programming question than anything else.

> Also, as an aside to the original poster, how about writing this routine
> as a macro using min_extent and max_extent instead of modifying truetype.c?
> The result will be the same without having to make a new patch, and you
> might even be able to offer more options (such as an optional angle
> that can be used to rotate each character around the x axis before moving
> it to its final position, making a cone shape or a cylinder instead of a
> flat circle)

Using macros would be nice, but I really can't think of a good way to go
about that. min_extent and max_extent cover the bounding area just fine,
but they don't go into issues like character spacing and kerning. It
might be possible to adjust for that somehow, but only with great
difficulty. The reason I decided to try to modify the primitive was
because I wanted to preserve proper spacing as much as
possible--although I realize some amount of distance would be added as a
result of the curvature of the circle.
Creating the glyphs individually would work, but it wouldn't correct for
kerning or other issues I consider somewhat important.
Perhaps what we really need here is a nice compile-time function added
to the library. Something like this:

character_center("Arial.ttf","Test message",depth,spacing,n)
dimensions("Arial.ttf","Test message",depth,spacing)

If character_center() were to return the proper coordinates for the
center of the (n+1)th character, and dimensions() could return the size
of the string's bounding box without actually creating a text object,
then we'd be in business.
A macro is in many ways a better way to go because of the greater
flexibility. However, without some way to account for the character
spacing, it would be difficult to pull this off satisfactorily.

Lummox JR


Post a reply to this message

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