POV-Ray : Newsgroups : povray.beta-test : Weird text spacing bug Server Time
30 Jul 2024 18:15:32 EDT (-0400)
  Weird text spacing bug (Message 1 to 4 of 4)  
From: Anders K 
Subject: Weird text spacing bug
Date: 3 Oct 2001 10:30:37
Message: <3bbb210d$1@news.povray.org>
When rendering the word "You" (with a capital Y) in a text object, there is
way too much space between the "o" and the "u". This happens in every font
I've tried it with, but it doesn't seem to happen in other words containing
"ou" (even "you" with a lowercase y). Here's an example:

#default { pigment { rgb 1 } finish { ambient 1 } }
camera { location <1, 0, -2> look_at <1, 0, 0> }
text { ttf "timrom.ttf", "You", 0, 0 }
text { ttf "timrom.ttf", "Zou", 0, 0 translate -y }

If you want, I'll post an image in .b-t.binaries.

Anders
(POV-Ray 3.5 beta 4, Win98, Athlon 700, 256MB)


Post a reply to this message

From: Anders K 
Subject: Re: Weird text spacing bug
Date: 3 Oct 2001 10:32:55
Message: <3bbb2197@news.povray.org>
Hey, I just thought of what is probably happening. Because of kerning,
POV-Ray is moving the "o" towards the "Y", but is not moving the "u" as
well. If this is the case, it should definately be fixed.

"Anders K." <and### [at] f2scom> wrote in message
news:3bbb210d$1@news.povray.org...
> When rendering the word "You" (with a capital Y) in a text object, there
is
> way too much space between the "o" and the "u". This happens in every font
> I've tried it with, but it doesn't seem to happen in other words
containing
> "ou" (even "you" with a lowercase y). Here's an example:
>
> #default { pigment { rgb 1 } finish { ambient 1 } }
> camera { location <1, 0, -2> look_at <1, 0, 0> }
> text { ttf "timrom.ttf", "You", 0, 0 }
> text { ttf "timrom.ttf", "Zou", 0, 0 translate -y }
>
> If you want, I'll post an image in .b-t.binaries.
>
> Anders
> (POV-Ray 3.5 beta 4, Win98, Athlon 700, 256MB)
>
>
>


Post a reply to this message

From: Anders K 
Subject: Re: Weird text spacing bug
Date: 4 Oct 2001 18:33:32
Message: <3bbce3bc$1@news.povray.org>
> Hey, I just thought of what is probably happening. Because of kerning,
> POV-Ray is moving the "o" towards the "Y", but is not moving the "u" as
> well. If this is the case, it should definately be fixed.

And the patch is simple. In TRUETYPE.C, change these lines:

/* Shift next glyph by the width of this one */
total_offset[X] += ffile->hmtx_table[glyph->myMetrics].advanceWidth *
funit_size;

to:

/* Shift next glyph by the width of this one + any kerning amount */
total_offset[X] += (ffile->hmtx_table[glyph->myMetrics].advanceWidth +
kern_value_x) * funit_size;

I tested this with the POV-Ray 3.1 source, and it seems to work properly.


Post a reply to this message

From: Chris Cason
Subject: Re: Weird text spacing bug
Date: 9 Oct 2001 13:05:59
Message: <3bc32e77@news.povray.org>
"Anders K." <and### [at] f2scom> wrote in message news:3bbce3bc$1@news.povray.org...
> I tested this with the POV-Ray 3.1 source, and it seems to work properly.

As it does with 3.5. Thanks for the fix.

-- Chris


Post a reply to this message

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