|
|
Wasn't it Rune who wrote:
>"Mike Williams" wrote:
>> thus including the kerning of the current letter in
>> the positioning calculation, rather then just the
>> kerning of the previous letters in the string.
>
>Thanks!
>
>> 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.
>
>It sure is much better, but not exactly identical. Try the following code:
That effect seems to be being caused by something strange in the
behaviour of the TextWidth() macro.
If we rip out the "|" characters from the TextWidth() macro, like this:-
#macro TextWidth(Font, Text, Size)
#local TO = text {ttf Font Text 1 0 scale <Size,Size,1>}
((max_extent(TO).x-min_extent(TO).x))
#end
Together with my previous change, it looks a bit better.
In case anyone out there is using TextWidth() directly in their scenes,
it might be better to give my simplified version a different name and
use that throughout Circle_Text().
My version returns just the width of the string (which is what we now
need in the version of Circle_Text with corrected kerning). The current
TextWidth() returns the width of the string plus possibly some extra
space at the ends.
> You seem to understand the macro well, so could you possible do
> another change to it?
> I'd like to have a spacing option added that works like the x
> component of the offset vector in regular fonts in POV-Ray.
That's easy. Just pass that value into the Circle_Text() macro, and pass
it forward into the (new) TextWidth() macro and use it as the x
component of the offset vector in the local text object, like this:-
#macro TextWidth(Font, Text, Size, Offset)
#local TO = text {ttf Font Text 1 Offset*x scale <Size,Size,1>}
((max_extent(TO).x-min_extent(TO).x))
#end
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
|