POV-Ray : Newsgroups : povray.general : Wanted: dealing with font style 'bold' and 'italics' : Re: Wanted: dealing with font style 'bold' and 'italics' Server Time
31 Jul 2024 02:24:48 EDT (-0400)
  Re: Wanted: dealing with font style 'bold' and 'italics'  
From: Tim Attwood
Date: 6 Dec 2007 18:23:42
Message: <4758847e$1@news.povray.org>
> Can someone suggest how to deal with font 'bold' and 'italics' ?

#include "transforms.inc"

// normal text
#declare Ntext = text {ttf "timrom.ttf", "Sample Text", 0.1, <0,0,0>};
object { Ntext
   Center_Trans(Ntext,x)
   scale <0.5,0.5,1>
   translate <0,0,0>
   pigment {Gray50}
}

// italic text
#declare Itext = text {ttf "timrom.ttf", "Sample Text", 0.1, <0,0,0>};
object { Itext
   Center_Trans(Itext,x)
   scale <0.5,0.5,1>
   Shear_Trans(x, y+0.25*x, z)
   translate <0,-0.5,0>
   pigment {Gray50}
}

// bold text
#declare Btext = text {ttf "timrom.ttf", "Sample Text", 0.1, <-0.1,0,0>};
object { Btext
   Center_Trans(Btext,x)
   #local Nwidth = max_extent(Ntext).x - min_extent(Ntext).x;
   #local Bwidth = max_extent(Btext).x - min_extent(Btext).x;
   scale <Nwidth/Bwidth,1,1>
   scale <0.5,0.5,1>
   translate <0,0.5,0>
   pigment {Gray50}
}


Post a reply to this message

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