POV-Ray : Newsgroups : povray.newusers : is pi in any of the standard included fonts? (also, random character stream= Server Time
25 Nov 2024 11:57:01 EST (-0500)
  is pi in any of the standard included fonts? (also, random character stream= (Message 1 to 7 of 7)  
From: Smws
Subject: is pi in any of the standard included fonts? (also, random character stream=
Date: 4 Dec 2005 22:55:00
Message: <web.4393b945d8624128b59af090@news.povray.org>
So, I have several questions, and this group has been extremely helpful
before:

1)I was wanting to put the greek letter lowercase "pi" on a sphere, and I
was wondering if any of the ttfs included with POV had anything besides the
standard ASCII. If not, are there free ttfs that do? If so, how would I
reference that character in calling the text object? How can I see what
letters are in a given ttf, anyway?

2)In the same vein, is there an elegant way to get a random text stream? I'm
filling a sphere with text and it would be nice to use this. I thought of
referencing an array with each character as an element, but that seems
tedious to construct (maybe I'm just really lazy).

3)In the course of making this scene, I have hacked together some macros for
writing and engraving text (procedurally) on a sphere in various ways. It
was time-consuming for me, as I am fairly new to programming, but if
there's any interest I would be glad to post it. (For example I have a
version of the colors.inc demo scene that writes the name of the colors on
the spheres :))

Thanks!
Stefan Sittler


Post a reply to this message

From: Alain
Subject: Re: is pi in any of the standard included fonts? (also, random character stream=
Date: 4 Dec 2005 23:17:22
Message: <4393bf52@news.povray.org>
Smws nous apporta ses lumieres en ce 2005-12-04 22:51:
> So, I have several questions, and this group has been extremely helpful
> before:
> 
> 1)I was wanting to put the greek letter lowercase "pi" on a sphere, and I
> was wondering if any of the ttfs included with POV had anything besides the
> standard ASCII. If not, are there free ttfs that do? If so, how would I
> reference that character in calling the text object? How can I see what
> letters are in a given ttf, anyway?
> 
> 2)In the same vein, is there an elegant way to get a random text stream? I'm
> filling a sphere with text and it would be nice to use this. I thought of
> referencing an array with each character as an element, but that seems
> tedious to construct (maybe I'm just really lazy).
You can use the ascii code directly.
> 
> 3)In the course of making this scene, I have hacked together some macros for
> writing and engraving text (procedurally) on a sphere in various ways. It
> was time-consuming for me, as I am fairly new to programming, but if
> there's any interest I would be glad to post it. (For example I have a
> version of the colors.inc demo scene that writes the name of the colors on
> the spheres :))
> 
> Thanks!
> Stefan Sittler
> 
> 
> 
> 
> 
The greek leter pi is not in the provided fonts. It is present in some other fonts,
mainly 
mathematical themed ones. It's also available in extended unicode fonts, like arial
uni, at a 
position well past 256. (that font include all of the windings and other extra
characters sets 
besside arabic, chinese and others languages) You need to add charset utf8 in
global_settings to 
enable unicode use.
Take a look in the fonts folder to find what font you need.

-- 
Alain
-------------------------------------------------
If one synchronized swimmer drowns, do the rest have to drown too?


Post a reply to this message

From: Brian Elliott
Subject: Re: is pi in any of the standard included fonts? (also, random character stream=
Date: 5 Dec 2005 04:37:37
Message: <43940a61@news.povray.org>
"Smws" <smw### [at] poboxcom> wrote in message 
news:web.4393b945d8624128b59af090@news.povray.org...
> So, I have several questions, and this group has been extremely helpful
> before:
>
> 1)I was wanting to put the greek letter lowercase "pi" on a sphere, and I
> was wondering if any of the ttfs included with POV had anything besides 
> the
> standard ASCII. If not, are there free ttfs that do? If so, how would I
> reference that character in calling the text object? How can I see what
> letters are in a given ttf, anyway?

As Alain says, Pi is not in PoV-Ray included font files, but if you have
MS Windows, you are still in luck.  Pi is in the standard Windows font,
"Symbol".  It is in the same position in the font as the small letter "p",
and you won't need Unicode to get at it.

text {
  ttf  "symbol.ttf", "p",
  0.2,  0
  pigment {rgb <.8,.5,.4>}
  translate <0,0,2>
}

To access the fonts in Windows without typing full path names, add this
line to your master povray.ini file.

    Library_Path="C:\WINDOWS\Fonts"

You might also need to check your pvengine.ini file to ensure that
%FONTDIR% is included in the [Permitted Input Paths] section, but
I think this is already there by default in the PoV-Ray installation.

> Thanks!
> Stefan Sittler

Cheers!
  Brian


Post a reply to this message

From: Chris B
Subject: Re: is pi in any of the standard included fonts? (also, random character stream=
Date: 5 Dec 2005 07:25:28
Message: <439431b8$1@news.povray.org>
"Smws" <smw### [at] poboxcom> wrote in message 
news:web.4393b945d8624128b59af090@news.povray.org...
>   ... snip ...
>
> 2)In the same vein, is there an elegant way to get a random text stream? 
> I'm
> filling a sphere with text and it would be nice to use this. I thought of
> referencing an array with each character as an element, but that seems
> tedious to construct (maybe I'm just really lazy).
>
>   ... snip ...
> Thanks!
> Stefan Sittler
>

I think it's a little easier to assign the characters you want to use to a 
simple string variable and use the substr function to display one of them 
each time round your loop.
For example:


#declare CharacterSet = 
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz%(){}&$'@!*=;:><.,?#~+_0123456789";
#declare MySeed = seed(42);

#local I = 0;
#while (I<1000)
  text {
    ttf  "arial.ttf",
    substr(CharacterSet,rand(MySeed)*strlen(CharacterSet),1),
    0.2,  0
    pigment {rgb <rand(MySeed),rand(MySeed),rand(MySeed)>}
    translate <-0.25,-0.3,-0.1>
    rotate <rand(MySeed),rand(MySeed),rand(MySeed)>*360
    translate z*(1-pow(rand(MySeed),2))*4
    rotate <rand(MySeed),rand(MySeed),rand(MySeed)>*360
  }
  #local I = I + 1;
#end

camera {location <-1,1,-10> look_at <0,0,0>}
light_source { <100, 1000, -2000> color rgb 1}

Regards,
Chris B.


Post a reply to this message

From: Chris B
Subject: Re: is pi in any of the standard included fonts? (also, random character stream=
Date: 5 Dec 2005 07:32:15
Message: <4394334f$1@news.povray.org>
Slight correction to get rid of unpleasant list of warnings in the message 
stream:

    substr(CharacterSet,1+(rand(MySeed)*(strlen(CharacterSet)-1)),1),

Regards,
Chris B.


Post a reply to this message

From: Smws
Subject: Re: is pi in any of the standard included fonts? (also, random character st=
Date: 5 Dec 2005 10:15:01
Message: <web.439458629df7e1d46d4fb94b0@news.povray.org>
"Chris B" <c_b### [at] btconnectcomnospam> wrote:
> "Smws" <smw### [at] poboxcom> wrote in message
> news:web.4393b945d8624128b59af090@news.povray.org...
> >   ... snip ...
> >
> > 2)In the same vein, is there an elegant way to get a random text stream?
> > I'm
> > filling a sphere with text and it would be nice to use this. I thought of
> > referencing an array with each character as an element, but that seems
> > tedious to construct (maybe I'm just really lazy).
> >
> >   ... snip ...
> > Thanks!
> > Stefan Sittler
> >
>
> I think it's a little easier to assign the characters you want to use to a
> simple string variable and use the substr function to display one of them
> each time round your loop.
> For example:
>
>
> #declare CharacterSet =
>
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz%(){}&$'@!*=;:><.,?#~+_0123456789";
> #declare MySeed = seed(42);
>
> #local I = 0;
> #while (I<1000)
>   text {
>     ttf  "arial.ttf",
>     substr(CharacterSet,rand(MySeed)*strlen(CharacterSet),1),
>     0.2,  0
>     pigment {rgb <rand(MySeed),rand(MySeed),rand(MySeed)>}
>     translate <-0.25,-0.3,-0.1>
>     rotate <rand(MySeed),rand(MySeed),rand(MySeed)>*360
>     translate z*(1-pow(rand(MySeed),2))*4
>     rotate <rand(MySeed),rand(MySeed),rand(MySeed)>*360
>   }
>   #local I = I + 1;
> #end
>
> camera {location <-1,1,-10> look_at <0,0,0>}
> light_source { <100, 1000, -2000> color rgb 1}
>
> Regards,
> Chris B.

Ah! Of course! Thank you very much.
-Stefan


Post a reply to this message

From: Smws
Subject: Re: is pi in any of the standard included fonts? (also, random character st=
Date: 5 Dec 2005 10:15:01
Message: <web.439458bc9df7e1d46d4fb94b0@news.povray.org>
Alain <ele### [at] netscapenet> wrote:
> Smws nous apporta ses lumieres en ce 2005-12-04 22:51:
> > So, I have several questions, and this group has been extremely helpful
> > before:
> >
> > 1)I was wanting to put the greek letter lowercase "pi" on a sphere, and I
> > was wondering if any of the ttfs included with POV had anything besides the
> > standard ASCII. If not, are there free ttfs that do? If so, how would I
> > reference that character in calling the text object? How can I see what
> > letters are in a given ttf, anyway?
> >
> > 2)In the same vein, is there an elegant way to get a random text stream? I'm
> > filling a sphere with text and it would be nice to use this. I thought of
> > referencing an array with each character as an element, but that seems
> > tedious to construct (maybe I'm just really lazy).
> You can use the ascii code directly.
> >
> > 3)In the course of making this scene, I have hacked together some macros for
> > writing and engraving text (procedurally) on a sphere in various ways. It
> > was time-consuming for me, as I am fairly new to programming, but if
> > there's any interest I would be glad to post it. (For example I have a
> > version of the colors.inc demo scene that writes the name of the colors on
> > the spheres :))
> >
> > Thanks!
> > Stefan Sittler
> >
> >
> >
> >
> >
> The greek leter pi is not in the provided fonts. It is present in some other fonts,
mainly
> mathematical themed ones. It's also available in extended unicode fonts, like arial
uni, at a
> position well past 256. (that font include all of the windings and other extra
characters sets
> besside arabic, chinese and others languages) You need to add charset utf8 in
global_settings to
> enable unicode use.
> Take a look in the fonts folder to find what font you need.
>
> --
> Alain
> -------------------------------------------------
> If one synchronized swimmer drowns, do the rest have to drown too?

Thank you. In fact I have now made a prism object, but now I could do it
this way too.
-Stefan


Post a reply to this message

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