POV-Ray : Newsgroups : povray.beta-test : Circle_Text macro problem : Re: Circle_Text macro problem Server Time
30 Jul 2024 14:16:59 EDT (-0400)
  Re: Circle_Text macro problem  
From: Mike Williams
Date: 22 Oct 2001 21:18:17
Message: <Yuwt2BATUM17Ew87@econym.demon.co.uk>
Wasn't it Rune who wrote:
>Due to a limitation (not a bug) in the Circle_Text macro in shapes.inc, the
>spacing for text created with the Circle_Text macro is not optimal.
>Rendering the code at the end of this message will demonstrate it.
>
>Again, it's not a bug, so it's not something that's easy to fix, but perhaps
>someone can come up with a solution anyway? There's a challenge for you! ;)

The obvious fix is to replace

      #if(CI != 1)
         #local LW = TextWidth(F, substr(T,1,CI-1), S);
      #else
         #local LW = 0;
      #end
      #local OE = TextWidth(F, substr(T,CI,1), S);

by

      #local OE = TextWidth(F, substr(T,CI,1), S);
      #local LW = TextWidth(F, substr(T,1,CI), S) - OE;

thus including the kerning of the current letter in the positioning
calculation, rather then just the kerning of the previous letters in the
string.


I don't have the maiandb.ttf font on my machine, but with other fonts,
the two lines in your example file look identical with that change.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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