POV-Ray : Newsgroups : povray.binaries.images : Other things the text object can do. Server Time
9 May 2025 19:15:44 EDT (-0400)
  Other things the text object can do. (Message 4 to 13 of 37)  
<<< Previous 3 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Jörg "Yadgar" Bleimann
Subject: Re: Other things the text object can do.
Date: 4 Mar 2025 15:24:58
Message: <67c7619a$1@news.povray.org>
Banzai!

On 04.03.25 16:35, William F Pokorny wrote:
> 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
> }

Kawaii!

Sayonara,

Yadugaru


Post a reply to this message

From: Chris R
Subject: Re: Other things the text object can do.
Date: 5 Mar 2025 09:15:00
Message: <web.67c85b769216b80b33dbb0635cc1b6e@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:
>
> 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.

If you are using a mono-type font, this worked for me:

#local _t1 = text { ttf "fontname.ttf" "A" 1.0, 0 }
#local _t2 = text { ttf "fontname.ttf" "AA" 1.0, 0 }
#local _t1sz = max_extent(_t1) - min_extent(_t1);
#local _t2sz = max_extent(_t2) - min_extent(_t2);
#local _unit_width = (_t2sz - _t1sz).x;

text { ttf "fontname.ttf" "What the heck?" 1.0, -2*unit_width*x }
text { ttf "fontname.ttf" "What the heck?" 1.0, <-unit_width, -1, 0> translate
<0, 14, 0> }

-- Chris R


Post a reply to this message


Attachments:
Download 'text_test.png' (155 KB)

Preview of image 'text_test.png'
text_test.png


 

From: William F Pokorny
Subject: Re: Other things the text object can do.
Date: 5 Mar 2025 11:26:06
Message: <67c87b1e$1@news.povray.org>
On 3/4/25 15:24, Jörg "Yadgar" Bleimann wrote:
> Banzai!
> 
...
> 
> Kawaii!
> 
> Sayonara,
> 
> Yadugaru
> 

:-)


Post a reply to this message

From: William F Pokorny
Subject: Re: Other things the text object can do.
Date: 5 Mar 2025 11:31:07
Message: <67c87c4b$1@news.povray.org>
On 3/5/25 09:11, Chris R wrote:

> If you are using a mono-type font, this worked for me:
> 
> #local _t1 = text { ttf "fontname.ttf" "A" 1.0, 0 }
> #local _t2 = text { ttf "fontname.ttf" "AA" 1.0, 0 }
> #local _t1sz = max_extent(_t1) - min_extent(_t1);
> #local _t2sz = max_extent(_t2) - min_extent(_t2);
> #local _unit_width = (_t2sz - _t1sz).x;

Thank you Chris!

This approach is working for me with the couple of mono-space fonts just 
tried.

Along with using the height of the vertical box character for the unit 
height.

Bill P.


Post a reply to this message

From: ingo
Subject: Re: Other things the text object can do.
Date: 5 Mar 2025 11:45:00
Message: <web.67c87f1b9216b80b17bac71e8ffb8ce3@news.povray.org>
"ingo" <nomail@nomail> wrote:

> I.i.r.c. Ron Parker has once posted a macro for "kerning"(?), can't find it any
> more.
>

This post references the macro, but still can't find it:

https://news.povray.org/povray.general/message/%3Cslrn90m9mi.23r.ron.parker%40fwi.com%3E/#%3Cslrn90m9mi.23r.ron.parker%
40fwi.com%3E

ingo


Post a reply to this message

From: Bald Eagle
Subject: Re: Other things the text object can do.
Date: 5 Mar 2025 14:25:00
Message: <web.67c8a4779216b80b3018e75b25979125@news.povray.org>
"ingo" <nomail@nomail> wrote:
> "ingo" <nomail@nomail> wrote:
>
> > I.i.r.c. Ron Parker has once posted a macro for "kerning"(?), can't find it any
> > more.
> >
>
> This post references the macro, but still can't find it:
>
>
https://news.povray.org/povray.general/message/%3Cslrn90m9mi.23r.ron.parker%40fwi.com%3E/#%3Cslrn90m9mi.23r.ron.parke
r%
> 40fwi.com%3E
>
> ingo

It looks like it might not be on the (current) server anymore.
Which means that this is either a job for TdG or Chris Cason ...


Post a reply to this message

From: Leroy
Subject: Re: Other things the text object can do.
Date: 5 Mar 2025 18:40:00
Message: <web.67c8df239216b80b89cd8458f712fc00@news.povray.org>
"Chris R" <car### [at] comcastnet> wrote:
> William F Pokorny <ano### [at] anonymousorg> wrote:
> >
> > 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:
> > "┌─────────┐",
"└───&#947
2;
> ─────┘" and
"│││││││││&#947
4;
> │││││",
> >
> > Bill P.
>
> If you are using a mono-type font, this worked for me:
>
> #local _t1 = text { ttf "fontname.ttf" "A" 1.0, 0 }
> #local _t2 = text { ttf "fontname.ttf" "AA" 1.0, 0 }
> #local _t1sz = max_extent(_t1) - min_extent(_t1);
> #local _t2sz = max_extent(_t2) - min_extent(_t2);
> #local _unit_width = (_t2sz - _t1sz).x;
>
> text { ttf "fontname.ttf" "What the heck?" 1.0, -2*unit_width*x }
> text { ttf "fontname.ttf" "What the heck?" 1.0, <-unit_width, -1, 0> translate
> <0, 14, 0> }
>
> -- Chris R

I remember this little trick. But I didn't want to be limited to  mono-type
fonts so I wrote a macro that cut a string into pieces and place each letter
separately. And promptly forgot about it.


Post a reply to this message

From: Thomas de Groot
Subject: Re: Other things the text object can do.
Date: 6 Mar 2025 03:09:42
Message: <67c95846$1@news.povray.org>
Op 05/03/2025 om 20:22 schreef Bald Eagle:
> "ingo" <nomail@nomail> wrote:
>> "ingo" <nomail@nomail> wrote:
>>
>>> I.i.r.c. Ron Parker has once posted a macro for "kerning"(?), can't find it any
>>> more.
>>>
>>
>> This post references the macro, but still can't find it:
>>
>>
https://news.povray.org/povray.general/message/%3Cslrn90m9mi.23r.ron.parker%40fwi.com%3E/#%3Cslrn90m9mi.23r.ron.parke
> r%
>> 40fwi.com%3E
>>
>> ingo
> 
> It looks like it might not be on the (current) server anymore.
> Which means that this is either a job for TdG or Chris Cason ...
> 

Could this be it?

https://news.povray.org/povray.binaries.images/message/%3Cslrn8s4ajs.2q7.ron.parker%40fwi.com%3E/#%3Cslrn8s4ajs.2q7.ron.parker%40fwi.com%3E


-- 
Thomas [just waking up from his winter sleep]


Post a reply to this message

From: ingo
Subject: Re: Other things the text object can do.
Date: 6 Mar 2025 05:45:00
Message: <web.67c97ca89216b80b17bac71e8ffb8ce3@news.povray.org>
Thomas de Groot <tho### [at] degrootorg> wrote:

> Could this be it?
>
>
https://news.povray.org/povray.binaries.images/message/%3Cslrn8s4ajs.2q7.ron.parker%40fwi.com%3E/#%3Cslrn8s4ajs.2q7.r
on.parker%40fwi.com%3E
>

Yes, that is the core of the macro(s) Ron posted in p.programming. Thanks.


Lekker geslapen deze winter?

ingo


Post a reply to this message

From: Thomas de Groot
Subject: Re: Other things the text object can do.
Date: 6 Mar 2025 07:46:07
Message: <67c9990f$1@news.povray.org>
Op 06/03/2025 om 11:44 schreef ingo:
> Thomas de Groot <tho### [at] degrootorg> wrote:
> 
>> Could this be it?
>>
>>
https://news.povray.org/povray.binaries.images/message/%3Cslrn8s4ajs.2q7.ron.parker%40fwi.com%3E/#%3Cslrn8s4ajs.2q7.r
> on.parker%40fwi.com%3E
>>
> 
> Yes, that is the core of the macro(s) Ron posted in p.programming. Thanks.
> 
Strangely enough, My search did not show the relevant message(s) in 
p.programming. I used "Ron Parker + kerning" In the Search bar of the 
povray.org newsgroups...

> 
> Lekker geslapen deze winter?
> 
Ach ja, bedankt! Wel een beetje onrustig... ;-)

> ingo
> 
> 
> 


-- 
Thomas


Post a reply to this message

<<< Previous 3 Messages Goto Latest 10 Messages Next 10 Messages >>>

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