 |
 |
|
 |
|
 |
|  |
|  |
|
 |
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
William F Pokorny <ano### [at] anonymous org> 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'

|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 3/4/25 15:24, Jörg "Yadgar" Bleimann wrote:
> Banzai!
>
...
>
> Kawaii!
>
> Sayonara,
>
> Yadugaru
>
:-)
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Chris R" <car### [at] comcast net> wrote:
> William F Pokorny <ano### [at] anonymous org> 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:
> > "┌─────────┐",
"└───γ
2;
> ─────┘" and
"│││││││││γ
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Thomas de Groot <tho### [at] degroot org> 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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Op 06/03/2025 om 11:44 schreef ingo:
> Thomas de Groot <tho### [at] degroot org> 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
|
 |
|  |
|  |
|
 |
|
 |
|  |