POV-Ray : Newsgroups : povray.beta-test : String handling bug Server Time
31 Jul 2024 08:26:37 EDT (-0400)
  String handling bug (Message 1 to 7 of 7)  
From: N'Jarl the Libarian
Subject: String handling bug
Date: 7 Sep 2001 02:26:04
Message: <3b98687c@news.povray.org>
Hi,

    Running a first test or two of existing code (MegaPov 0.7)  I believe I
have found a small problem:

    The following code generates the error "font not found". Replacing the
POV string variable font_to_map
    with an actual string works.

        #declare font_to_map = "c:\WINDOWS\FONTS\musical.ttf"
        #declare theChar = 110;

        #declare character =
          text { ttf  font_to_map chr(theChar) 0.1, 0
             pigment { color Black }
             scale 10
             translate <0,0,0>
          }


Post a reply to this message

From: Ron Parker
Subject: Re: String handling bug
Date: 7 Sep 2001 02:45:22
Message: <slrn9pgr82.2o0.ron.parker@fwi.com>
On Fri, 7 Sep 2001 07:23:01 +0100, N'Jarl the Libarian wrote:
>    The following code generates the error "font not found". Replacing the
>POV string variable font_to_map
>    with an actual string works.
>
>        #declare font_to_map = "c:\WINDOWS\FONTS\musical.ttf"

And what happens when you specify the backslashes the proper way?

-- 
#macro R(L P)sphere{L F}cylinder{L P F}#end#macro P(V)merge{R(z+a z)R(-z a-z)R(a
-z-z-z a+z)torus{1F clipped_by{plane{a 0}}}translate V}#end#macro Z(a F T)merge{
P(z+a)P(z-a)R(-z-z-x a)pigment{rgbt 1}hollow interior{media{emission T}}finish{
reflection.1}}#end Z(-x-x.2y)Z(-x-x.4x)camera{location z*-10rotate x*90}


Post a reply to this message

From: Adrien Beau
Subject: Re: String handling bug
Date: 7 Sep 2001 04:40:05
Message: <3B9887DD.A4AB7F42@sycomore.fr>
Ron Parker wrote:
> 
> And what happens when you specify the backslashes the proper way?

What do you mean? I don't see an error with his example.
Especially since he adds that the same string works when
put "as-is" in in the text bloc.

Or perhaps it's missing a semicolon at the end of the
string declaration?

-- 
Adrien Beau - adr### [at] freefr - http://adrien.beau.free.fr
 Mes propos n'engagent que moi et en aucun cas mes employeurs


Post a reply to this message

From: ingo
Subject: Re: String handling bug
Date: 7 Sep 2001 04:44:45
Message: <Xns91156D4FF6E77seed7@povray.org>
in news:3B9887DD.A4AB7F42@sycomore.fr Adrien Beau wrote:

>> And what happens when you specify the backslashes the proper way?
> 
> What do you mean? I don't see an error with his example.
> 

See doc 6.1.7.1

Ingo

-- 
Photography: http://members.home.nl/ingoogni/
Pov-Ray    : http://members.home.nl/seed7/


Post a reply to this message

From: N'Jarl the Libarian
Subject: Re: String handling bug
Date: 7 Sep 2001 05:34:32
Message: <3b9894a8@news.povray.org>
"ingo" <ing### [at] homenl> wrote in message
news:Xns### [at] povrayorg...
> in news:3B9887DD.A4AB7F42@sycomore.fr Adrien Beau wrote:
>
> >> And what happens when you specify the backslashes the proper way?
> >
> > What do you mean? I don't see an error with his example.
> >
>
> See doc 6.1.7.1
>
> Ingo
>
OK, my sloppiness...however it has always worked before
and still does if a literal string is used as opposed to a variable
containing a string which could be confusing to the neophyte
as well as to me.

    Nigel


Post a reply to this message

From: Adrien Beau
Subject: Re: String handling bug
Date: 7 Sep 2001 07:42:25
Message: <3B98B29A.AC3C91D3@sycomore.fr>
N'Jarl the Libarian wrote:
> 
> OK, my sloppiness...however it has always worked before
> and still does if a literal string is used as opposed to a variable
> containing a string which could be confusing to the neophyte
> as well as to me.

If you use a string in a text{} bloc at the appropriate place,
POV "knows" it is a filename and doesn't transform the backslahes.
On the other hand, if you define a string, POV has no way to
know what use it will be put to, so it has to parse it and change
the backslashes. Just guessing, of course.

-- 
Adrien Beau - adr### [at] freefr - http://adrien.beau.free.fr
 Mes propos n'engagent que moi et en aucun cas mes employeurs


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: String handling bug
Date: 7 Sep 2001 11:11:14
Message: <3b98e392@news.povray.org>
In article <3B98B29A.AC3C91D3@sycomore.fr> , Adrien Beau 
<adr### [at] sycomorefr>  wrote:

> If you use a string in a text{} bloc at the appropriate place,
> POV "knows" it is a filename and doesn't transform the backslahes.
> On the other hand, if you define a string, POV has no way to
> know what use it will be put to, so it has to parse it and change
> the backslashes. Just guessing, of course.

This is exactly how it works.

BTW, the proper way to solve the problem with the scene would be not to use
the absolute path in the first place.  A library path should be used in the
INI file.  For fonts putting the lib path in the povray.ini file would be
the best solution.  This would also allow others to use the scene without
modification.


    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

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