![](/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) |
I recently found myself needing a bunch of tiny text objects. And, they
needed to look kind of soft. And, they needed to be legible. The text{}
font-based objects were just too grainy. But, I did get the results I was
looking for by making my own CSG letters.
I had looked at the standard-issue char() objects. And, I noticed all those
separate #declare names. I thought, wouldn't it be nice to put a string
into a macro and have it give me a CSG word?
Well, now that's exactly what I do!
What I would like to know is if there is anyone else interested in making
CSG Fonts and/or CSG-Font formatting tools?
This attachment contains:
1) csg_font.history.txt What I just typed, only more words.
2) csg_font.standards.txt My own current CSG-Font standards.
3) srs.torlipse.sphere_sweep.inc Include needed by next file.
4) srs.wire.csg_font.inc Where the font-making macros live.
5) srs.csg_font.utility.inc Where the font-formatting macro lives.
6) csg_font.preview.pov Run this to see what you've got.
I've done my best to annotate all of the files.
Have fun!
-Randall
Post a reply to this message
Attachments:
Download 'csgfonts.zip' (9 KB)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Randall Sawyer" <sra### [at] yahoo com> wrote:
> But, I did get the results I was
> looking for by making my own CSG letters.
CSG fonts are a long time povray tradition. :) see the recent warp's yes/no
thread...
I've played with it a bit. It says: "Generates a CSG font out of spheres,
cylinders, tori and sphere_sweeps.". I wonder if it would be easier to
just use the sphere sweeps and specify spline points for the letters
shapes?
I've also changed the csg_text as follows, and it works just fine, even for
empty strings -- returns an empty union -- or single letters... the #if
looked kinda redundant...
#macro csg_text( csg_font, font_widths, string )
#local len = strlen( string );
#local tr = 0;
#local i = 0;
union {
#while ( i < strlen(string) )
#local next = asc(substr(string,i+1,1))-32;
object {
csg_font[ next ]
translate tr*x
}
#local tr = tr + font_widths[ next ];
#local i = i + 1;
#end//while
}
#end//macro
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) |
"nemesis" <nam### [at] gmail com> wrote:
> CSG fonts are a long time povray tradition. :) see the recent warp's yes/no
> thread...
> ...
> I've also changed the csg_text as follows, and it works just fine, even for
> empty strings -- returns an empty union -- or single letters... the #if
> looked kinda redundant...
>
Thanks again, nemesis.
To others reading this thread: go ahead and make the same change nemesis
made.
The next time I release the same file, the change will already be made by
me.
Since folks have already been making CSG fonts, then what I would really
like to address is the adoption of a standard for the fonts and for the
formatting tools. That way the fonts and the tools would be easily
interchangeable.
1) I feel that each standardized font should be complete (ascii 32 - 126 for
U.S. fonts). If your native language is something other than USA English, I
would like to know what your definition of a complete CSG font would be.
2) Have the default CSG font format emulate the font-based 'text{}' objects
as much as possible. I feel that that will facilitate conceptual
ease-of-use. For example, if someone writes a text-intensive scene using
'text{}' and then decides to switch to CSG font, then s/he wouldn't have to
do a lot of reformatting of their scene.
-Randall
BTW, nemesis:
I appreciate your feedback. I have been a povver-in-isolation for quite a
while. I only got DSL at home in October. I am eager to exchange ideas
and work with others in the POVRay community. So far, I don't know any
others except through this site. Thanks again. -Randall
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) |
"nemesis" <nam### [at] gmail com> wrote:
> I've also changed the csg_text as follows, and it works just fine, even for
> empty strings -- returns an empty union -- or single letters... the #if
> looked kinda redundant...
Oh yeah, now I remember!
I remember why I wrote those extra #if...#end lines.
I get 'warning' messages when I use unions with fewer than 2 objects in
them. So, I started writing all macros in a style in which no empty- or
single-item- unions are called. I know a 'warning' is only a 'warning'.
But still, they annoy me. Is there a way to selectively turn off specific
warning messages?
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) |
"Randall Sawyer" <sra### [at] yahoo com> wrote:
> I get 'warning' messages when I use unions with fewer than 2 objects in
> them. So, I started writing all macros in a style in which no empty- or
> single-item- unions are called.
yes, that's ok. It was just a minor nitpick. :)
> I know a 'warning' is only a 'warning'.
> But still, they annoy me. Is there a way to selectively turn off specific
> warning messages?
I don't know, but you can always safely ignore the ones you know povray
deals gracefully with. I mean, like "scale x*2" which gives you a warning
that you're likely commiting a mistake by scaling z and y by 0 and
correctly understands you actually meant "scale width by 2 and keep the
others the same". After all, I like syntatic sugar and less typing as much
as anyone else... :)
I believe the same is true regarding empty unions...
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've decided to re-release the same 'CSGFont' package. This time, I've
tightened up quite a few things:
First, I dropped "csg_font.history.txt".
Second, I cleaned up my file-naming system.
For a top folder: [AUTHOR].[descriptor]
For includes: [author].[descriptor].[catagory].inc
For render files: [author].[descriptor].pov
For text files: [author].[descriptor].txt
The file that was named "csg_font.standards.txt"
is now named "srs.csg_font_standards.txt".
The file that was named "srs.csg_font.utility.inc"
is now named "srs.csg_text.csg_fontformat.inc".
The file that was named "csg_font.preview.pov"
is now named "srs.csg_font_preview.pov".
Third, I reformatted my commented notes for easier reading. I also cleared
up my definitions in the 'standards' file.
Fourth, I tidied up my code. Empty unions are okay now. (Check out how I
handled the geometry for the <space> character.) Just use the option '+W0'
on the command line when you render if you don't want all those unpleasant
warnings.
Fifth, I smoothed out the quality/render_time factor of the sphere_sweep
arcs by estimating arclength.
From now on, every file I upload onto this site will have the prefix "srs"
and every folder I upload will have the prefix "SRS". This way it will be
easier for you to find anything on your system that I've written that you
might want to replace or delete. Please let me know if this prefix
conflicts with anything else you have.
-Randall
Post a reply to this message
Attachments:
Download 'srs.csgfonts.zip' (8 KB)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |