![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Hello all,
Non unix folk beware.... if you've never heard of bash, leave now.
I got mad with rendering scenes again and again to get the text
alignment right. This got more maddening when I tried to set up scripts
to generate pov scenes involving text, right aligning text is a real
arse. I saw a patch for the 'ol 3.02 windoze version. So I stopped
getting mad and got even.
I wrote a bash script which uses Povray, ImageMagick, sed & tr to render
a string, in a specified font, at a specified kerning offset, find the
edges, and the offsets from origin. The output can be sieved for
relevant info.
Example session:
$ ./povttfsize "Howdy" arial.ttf
totalsize=2.970,.930
positive from origin=2.410,.720
negative from origin=.560,.210
this admittedly takes ages to run, but if you're gonna use a load of
font stuff in a scene it could be scripted for all the strings and run
overnight!
If anyone wants a copy, please mail me qua### [at] netcomuk co uk, if there's
sufficient interest I'll post it to the group. It does what I wanted
(vaguely) and if you want to improve on it you'll be making my life
easier.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Oops!, I used an older (failed) test version for the example.
try this:
$ ./povttfsize "Howdy" arial.ttf
totalsize=2.9700,.9300
positive from origin=2.9700,.7200
negative from origin=0,.2100
DOH!
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Nieminen Juha
Subject: Re: Announce:Text justification assistant script
Date: 28 Oct 1999 04:23:19
Message: <381807f7@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In povray.unix blo### [at] the place wrote:
: this admittedly takes ages to run
Perhaps a C-version would be faster and more portable?
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
I quite agree about portability, however, I'm using povray to actually render
the text using an orthographic camera, then using image magick a couple of
times to determine the relevant info. Writing this in 'c' would either mean
including Image magick and povray or calling them as externals. Either way
the speed would hardly change at all. The best fix would be to write the
relevant commands straight into povray itself, which is a bit beyond the
scope of a quick fix.
Nieminen Juha wrote:
> In povray.unix blo### [at] the place wrote:
> : this admittedly takes ages to run
>
> Perhaps a C-version would be faster and more portable?
>
> --
> main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
> ):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
>The best fix would be to write the relevant commands straight into
povray itself, which is a bit beyond the scope of a quick fix.<
It wouldn't be too hard though...just put a place in the code that
translates the object based on the justification settings and the
bounding box.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Nieminen Juha
Subject: Re: Announce:Text justification assistant script
Date: 28 Oct 1999 09:08:06
Message: <38184ab6@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
It shouldn't be hard to get any information you want from a raw tga file
by reading and analyzing it. It's a very simple format.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> It shouldn't be hard to get any information you want from a raw tga file
> by reading and analyzing it. It's a very simple format.
I'll have a look for some tga docs, this eliminate the need for
ImageMagick.
If theres a quick way to get aquainted with the algorythms used in ttf
and the way povray handles ttf (or Xfonts for that matter), then that
would be the quickest one, because it could just prod the font file,
instead of running a render. I just need to know (without extensive
knowledge of povray internals) the rules povray uses to space and align
text. The font info should be trivial?
It would be good to keep this as a seperate tool for now so that people
can avoid rebuilds, for instance I use macs, nt boxes, 95boxes, Amigas
and linux boxes for rendering, but I only have worthwhile compilers on
Linux as this is my working environment. I figure povray will probably
have to 'grow' commands to do this in a future release anyway. This way
I can generate scenes for any version of povray.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
blo### [at] the place wrote:
> If theres a quick way to get aquainted with the algorythms used in ttf
> and the way povray handles ttf (or Xfonts for that matter), then that
> would be the quickest one, because it could just prod the font file,
> instead of running a render. I just need to know (without extensive
> knowledge of povray internals) the rules povray uses to space and align
> text. The font info should be trivial?
>
> It would be good to keep this as a seperate tool for now so that people
> can avoid rebuilds, for instance I use macs, nt boxes, 95boxes, Amigas
> and linux boxes for rendering, but I only have worthwhile compilers on
> Linux as this is my working environment. I figure povray will probably
> have to 'grow' commands to do this in a future release anyway. This way
> I can generate scenes for any version of povray.
Well, if that is some of what you are looking at...
You should consider doing something in Java. Can run on most those boxes you
mentioned without even a recompile (although the Amiga is a little of a
squeeze).
I recently coded up a quick Java/Swing tool to view the chunks of a .TTF file
and to display info on the encoding tables. About 2 days to get that done.
It's not too hard to follow the algorithms in the POV-Ray sources.
--
"My new computer's got the clocks, it rocks
But it was obsolete before I opened the box" - W.A.Y.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Jon A. Cruz" wrote:
> You should consider doing something in Java.
For some reason many of your replies remind me of the Willie Nelson song-
...java's always on my mind !
:)
--
Ken Tyler - 1100+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Ken wrote:
> "Jon A. Cruz" wrote:
>
> > You should consider doing something in Java.
>
> For some reason many of your replies remind me of the Willie Nelson song-
>
> ...java's always on my mind !
>
> :)
>
> --
> Ken Tyler - 1100+ Povray, Graphics, 3D Rendering, and Raytracing Links:
> http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/
As a Georgia and a Coffee drinker I resent and resemble that remark!
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |