POV-Ray : Newsgroups : povray.general : Rounded or smoothed text? : Re: Rounded or smoothed text? Server Time
13 Aug 2024 03:11:34 EDT (-0400)
  Re: Rounded or smoothed text?  
From: Jerry  Stratton
Date: 19 Nov 1998 10:02:50
Message: <jerry-1911980702500001@cx38767-a.dt1.sdca.home.com>
In article <36533ae4.0@news.povray.org>, "Patrick Dugan"
<pat### [at] usticom> wrote:

>Does anyone know a way to create "rounded off" text?
>When I create a text object using a TTF the edges of the letters are sharp
>and I would like to create a rounded or smooth edge to the letters.  Is
>there a command/parameter or some way to do this?

If you mean beveled text, try the following macro. The code is modified
from some that Michael Lundahl posted to
comp.graphics.rendering.raytracing a few months ago. 'nbr_of_objects' is
actually the 'smoothness' of the beveling; think of it as anti-aliasing.

bevel_text("Courier","I Want My MTV",0.02, 1.0, 10)

//creates beveled text
#macro bevel_text (bevelFont, bevelText, bevel_depth, text_depth,nbr_of_objects)
   union {
      #local i = 0;
      #while (i < 1)
      //This is the bevel itself
      text { 
         ttf bevelFont, bevelText, bevel_depth, <bevel_depth,0,0>
         matrix < 1, 0, 0,
               0, 1, 0,
               cos(i*2*pi), sin(i*2*pi), 1,
               0, 0, 0 >
      }

      //This is what is behind the bevel. 
      //Set text_depth to 0 if you only want the bevel.
      #if (text_depth > 0)
         text {
            ttf bevelFont, bevelText, text_depth, <bevel_depth,0,0>
            translate <cos(i*2*pi)*bevel_depth, 
                  sin(i*2*pi)*bevel_depth, 
                  bevel_depth>    
         }
      #end
   #declare i = i + 1/nbr_of_objects;
   #end
}
#end
jer### [at] hoboescom   
http://www.hoboes.com/jerry/                   e-mail hel### [at] hoboescom
What Your Children Are Doing: http://www.hoboes.com/html/NetLife/Children/


Post a reply to this message

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