POV-Ray : Newsgroups : povray.binaries.images : Do I relly need a raytracer... : Re: Do I relly need a raytracer... Server Time
1 Oct 2024 11:25:46 EDT (-0400)
  Re: Do I relly need a raytracer...  
From: Ron Parker
Date: 15 Sep 2000 09:44:06
Message: <slrn8s4ajs.2q7.ron.parker@fwi.com>
On Fri, 15 Sep 2000 08:34:48 +0200, Karl Pelzer wrote:
>Ron Parker wrote:
>> 
>> http://bibliofile.mc.duke.edu/gww/fonts/Bocklin/Bocklin.html
>> 
>> --
>> Ron Parker   http://www2.fwi.com/~parkerr/traces.html
>> My opinions.  Mine.  Not anyone else's.
>
>Thanks Ron. But this font fits to the time between 1900 and 1920. In the
>meantime I found two fancy fonts that fit to the 1960's.
>I'll post a new version when I changed my character placing routine.
>Every character can be placed according to its dimensions. The effect is
>that I can manipulate every single character of a string.
>The problem lies in one of the new fonts. The characters can be
>overlapping that means an "a" can be placed under the bow of a
>preceeding "P".
>I'll have to think about it...

That's called kerning.  You can determine how much kerning is applied to
a pair; I posted at length on this subject deep in a thread over in 
povray.programming.  I even wrote a couple macros.

// Find the advance width of character C in font F
#macro WidthWithSpacing( C, F )
  #local T=text {ttf F concat("|",C,"|") 1 0}
  #local W1=max_extent(T).x-min_extent(T).x;
  #local T=text {ttf F "||" 1 0}
  (W1-max_extent(T).x+min_extent(T).x)
#end

// Find the width of the glyph for character C in font F
#macro WidthNoSpacing( C, F )
  #local T=text {ttf F C 1 0}
  (max_extent(T).x-min_extent(T).x)
#end

// Find the kern for characters A and B from font F
#macro Kern( A, B, F )
  (WidthWithSpacing( concat(A, B), F)-WidthWithSpacing(A,F)
   -WidthWithSpacing(B,F))
#end

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

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