POV-Ray : Newsgroups : povray.programming : The math of circular truetype fonts : Re: The math of circular truetype fonts Server Time
28 Jul 2024 22:30:15 EDT (-0400)
  Re: The math of circular truetype fonts  
From: Ron Parker
Date: 24 Feb 2000 08:16:51
Message: <38b52f43@news.povray.org>
On Wed, 23 Feb 2000 16:48:12 -0800, Jon A. Cruz wrote:
>Ron Parker wrote:
>
>> On 23 Feb 2000 04:16:07 -0500, Nieminen Juha wrote:
>> >Jon A. Cruz <jon### [at] geocitiescom> wrote:
>> >: And another issue (which I think was mentioned) is that without some patch,
>> >: the macro would not have enough information on the characters in a string
>> >: to place them correctly.
>> >
>> >  Wouldn't the min_extent and max_extent functions in megapov help?
>>
>> Not entirely.  Jon is going back to the kerning and character spacing issues
>> that JR raised.  There might also be some issues with descenders; that's
>> something I haven't investigated fully.
>
>Yes, kerning is one issue. And the baseline is a more obvious one.
>
>This documentation on the Java font metrics class can be used to quickly see some
>of the issues.
>
>http://java.sun.com/products/jdk/1.1/docs/api/java.awt.FontMetrics.html#_top_
>
>Just imagine trying to line up "jal_^T" vertically using the extent functions.

The baseline is not actually a problem, believe it or not.  They're taken into
account by the ttf object.  Here are the extents for

  #local CF = text {
    ttf "arial.ttf" C 1 0
  }  

where C is each of the characters you specified.  So the only problem remaining
is the possibility that the correct advance width for the character could be 
less than the total width of the character, and that's taken care of by the 
method I already outlined for discovering it (i.e. width of "|X|" minus width 
of "||".)

C     min_extent             max_extent
------------------------------------------
j  <-0.00 -0.21 -0.00>   <0.20  0.72 1.00>
a  <-0.00 -0.01 -0.00>   <0.48  0.53 1.00>
l  <-0.00 -0.00 -0.00>   <0.09  0.72 1.00>
_  < 0.00 -0.20 -0.00>   <0.58 -0.14 1.00>
^  <-0.00  0.34 -0.00>   <0.42  0.73 1.00>
T  <-0.00 -0.00 -0.00>   <0.57  0.72 1.00>
    
-- 
These are my opinions.  I do NOT speak for the POV-Team.
The superpatch: http://www2.fwi.com/~parkerr/superpatch/
My other stuff: http://www2.fwi.com/~parkerr/traces.html


Post a reply to this message

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