POV-Ray : Newsgroups : povray.programming : The math of circular truetype fonts Server Time
28 Jul 2024 22:20:05 EDT (-0400)
  The math of circular truetype fonts (Message 8 to 17 of 27)  
<<< Previous 7 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Thorsten Froehlich
Subject: Re: The math of circular truetype fonts
Date: 21 Feb 2000 15:43:43
Message: <38b1a37f@news.povray.org>
In article <38b18d1f@news.povray.org> , ron### [at] povrayorg (Ron Parker)
wrote:

>>Given that you know the total length you can use 2*pi*r (perimeter of a
>>circle) and the fact that  2*pi*r*360/angle = length
>
> This is only true in the limit as the number of characters approaches
> infinity.  He's only got the lengths of the chords, not of the arcs.
> The length of a chord is 2*r*sin(angle/2).

It seems I don't understand the question completely then.  I learned math in
German and the English terms might have confused me ... but I still think
there should be a simple solution to the problem.

I have posted a diagram in povray.binaries.images which should help me
understand the problem.  To make it simple, could you state in terms of that
diagram which variables are known?


     Thorsten


____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Ron Parker
Subject: Re: The math of circular truetype fonts
Date: 21 Feb 2000 16:37:57
Message: <38b1b035@news.povray.org>
On Mon, 21 Feb 2000 14:43:43 -0600, Thorsten Froehlich wrote:
>I have posted a diagram in povray.binaries.images which should help me
>understand the problem.  To make it simple, could you state in terms of that
>diagram which variables are known?

The blue line comes closest to being what is known.  The letters are,
as I understand it, inside the circle (though I really don't know why.)

-- 
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

From: Ron Parker
Subject: Re: The math of circular truetype fonts
Date: 21 Feb 2000 16:45:47
Message: <38b1b20b@news.povray.org>
On Mon, 21 Feb 2000 15:05:54 -0500, Lummox JR wrote:
>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.

Probably, but I'm guessing some of our smarter math guys (For example, Adam 
Coffman, who teaches math at a university a few miles from me) don't hang out 
here.

>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.

You shouldn't worry about kerning anyway, since it is usually used to make
characters overlap and is really only valid if they're going to be in a 
straight line.  Perhaps character spacing is something best left to the user
to decide.  If not, it is possible to determine the character spacing for
a given character.  Just subtract the width of "|X|" from the width of "||"
where X is the character you want the advance widths for.  A modified version 
of this can give you kerning, too.  Find the advance widths for the two 
characters individually, and for the two characters in one string.  The 
difference is the kern.  Obviously this doesn't work when kerning extends
over multiple characters, but that's rare.  If TrueType fonts handled
ligatures like fi and ffi correctly, you'd also have problems, but fortunately
(or unfortunately) it doesn't.  You'll also have problems if there are kern
pairs using "|" but that doesn't seem likely either.

-- 
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

From: Thorsten Froehlich
Subject: Re: The math of circular truetype fonts
Date: 21 Feb 2000 16:49:49
Message: <38b1b2fd@news.povray.org>
In article <38b1b035@news.povray.org> , ron### [at] povrayorg (Ron Parker)
wrote:

> The blue line comes closest to being what is known.  The letters are,
> as I understand it, inside the circle (though I really don't know why.)

OK, now I understand the problem.  I makes much more sense now.


     Thorsten


____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Nieminen Juha
Subject: Re: The math of circular truetype fonts
Date: 22 Feb 2000 08:00:49
Message: <38b28881@news.povray.org>
Lummox JR <Lum### [at] aolcom> wrote:
: Here's the problem: I want to modify truetype.c in the POV-Ray source to
: allow text objects to be bent around a circle (without distorting the
: characters).

  I think this can be easyly done with a #macro. Why should the source code
be modified?

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Chris Huff
Subject: Re: The math of circular truetype fonts
Date: 22 Feb 2000 16:14:36
Message: <chrishuff_99-FDCC21.16155722022000@news.povray.org>
In article <38b28881@news.povray.org>, Nieminen Juha 
<war### [at] sarakerttunencstutfi> wrote:

>   I think this can be easyly done with a #macro. Why should the source 
>   code be modified?

If the characters are just being rearranged, than a macro would be easy 
to develop. If the characters also taper toward the center of the 
circle(which would be a more useful feature, in my opinion), than a 
patch would almost be required.(You might be able to get something by 
trace()'ing text objects and using that data to make prisms, but the 
results probably wouldn't be very good, it would be difficult to make, 
and could take a while to parse)

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Jon A  Cruz
Subject: Re: The math of circular truetype fonts
Date: 23 Feb 2000 01:52:38
Message: <38B38519.2368071E@geocities.com>
Chris Huff wrote:

> In article <38b28881@news.povray.org>, Nieminen Juha
> <war### [at] sarakerttunencstutfi> wrote:
>
> >   I think this can be easyly done with a #macro. Why should the source
> >   code be modified?
>
> If the characters are just being rearranged, than a macro would be easy
> to develop. If the characters also taper toward the center of the
> circle(which would be a more useful feature, in my opinion), than a
> patch would almost be required.(You might be able to get something by
> trace()'ing text objects and using that data to make prisms, but the
> results probably wouldn't be very good, it would be difficult to make,
> and could take a while to parse)
>

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.

--
"My new computer's got the clocks, it rocks
But it was obsolete before I opened the box" - W.A.Y.


Post a reply to this message

From: Nieminen Juha
Subject: Re: The math of circular truetype fonts
Date: 23 Feb 2000 04:16:07
Message: <38b3a557@news.povray.org>
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?

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Ron Parker
Subject: Re: The math of circular truetype fonts
Date: 23 Feb 2000 08:04:44
Message: <38b3daec@news.povray.org>
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.

-- 
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

From: Jon A  Cruz
Subject: Re: The math of circular truetype fonts
Date: 23 Feb 2000 19:42:28
Message: <38B47FCC.29CFA12E@geocities.com>
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.

--
"My new computer's got the clocks, it rocks
But it was obsolete before I opened the box" - W.A.Y.


Post a reply to this message

<<< Previous 7 Messages Goto Latest 10 Messages Next 10 Messages >>>

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