POV-Ray : Newsgroups : povray.binaries.images : Other things the text object can do. : Other things the text object can do. Server Time
14 Mar 2025 08:03:58 EDT (-0400)
  Other things the text object can do.  
From: William F Pokorny
Date: 4 Mar 2025 10:35:58
Message: <67c71dde$1@news.povray.org>
I started looking at a yuqk version of documentation for the text{} 
object. I quickly found out I've been decades clueless about the offset 
vector; Always setting the value to 0 - or maybe 0.1*x, if I wanted a 
little extra space between characters.

Well, we can already do vertical and right to left text so long as it is 
a mono-space font. I've long thought this a missing feature in POV-Ray. 
For example:

text {
     ttf "/home/pokorny/Fonts/LiberationMono-Regular.ttf"
     "What the heck?",
     1.0, <-0.6,-1.0,0>
     pigment { rgb <.7,.3,.1> }
     finish { emission 1 }
     translate <-0.3,5.75,0>
     scale 0.1
}

text {
     ttf "/home/pokorny/Fonts/LiberationMono-Regular.ttf"
     "Backwards",
     1.0, <-1.3,0,0>
     pigment { rgb <.7,.3,.1> }
     finish { emission 1 }
     translate <+2.6,8.0,0>
     scale 0.1
}

Only tricky part is figuring out the base character size and spacing. 
I've not found an easy and reliable way to do that as yet. I got to the 
above values by trial and error.

Used box characters for the rectangular frame using the strings: 
"┌─────────┐", "└─────────┘" and
"│││││││││││││││",

Bill P.


Post a reply to this message


Attachments:
Download 'textoffsetsstory.png' (48 KB)

Preview of image 'textoffsetsstory.png'
textoffsetsstory.png


 

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