textwidth/textheight macros

textwidth/textheight macros

Post by Phil Bende » Sat, 08 Jan 2000 04:00:00



Hi all,

I think most of you who need to add text to a scene would manually
adjust the
text scaling until it eventually fitted.

I've tried writing macros to get the width and height of a text string
with
the parameters being the string and current unit scale (with minimal
success),
and this is with trying  just one font!

I'm guessing that the only real way would be to add to the POV source
and
get the width/height of the individual TTF characters, but this all
seems a
bit of overkill.

Has anyone had any success with this?

 
 
 

textwidth/textheight macros

Post by Brad Mett » Sat, 08 Jan 2000 04:00:00


I know you can use the Windows (3.1/95/98/NT) API to get that info about a
given string in specific Font, but don't know about other platforms.

This would make a nice added feature to text object handling.


Quote:

>Hi all,

>I think most of you who need to add text to a scene would manually
>adjust the
>text scaling until it eventually fitted.

>I've tried writing macros to get the width and height of a text string
>with
>the parameters being the string and current unit scale (with minimal
>success),
>and this is with trying  just one font!

>I'm guessing that the only real way would be to add to the POV source
>and
>get the width/height of the individual TTF characters, but this all
>seems a
>bit of overkill.

>Has anyone had any success with this?

--
Brad Mettee
PC HotShots, Inc.
Baltimore, MD

--> Let us bring out the *Power* of your PCs <--


 
 
 

textwidth/textheight macros

Post by Nieminen Juh » Sat, 08 Jan 2000 04:00:00


  This is easy to do with megapov.

http://nathan.kopp.com/patched.htm

--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/

 
 
 

textwidth/textheight macros

Post by Phil Bende » Sat, 08 Jan 2000 04:00:00


Nieminen Juha said:  This is easy to do with megapov.

Thank you Nieminen, (and also Brad Mettee).

To Brad:
I downloaded the source code, made the necessary changes
to return the last TTF's length/height/thickness, and went to recompile.
Unfortunately my compiler was out of date and after hours of trying, gave up.

I noticed that a reply from Steve Martin (love his movies <g>), recommended
font3D, and I will check this out.

Nieminen,
This looks like something I've always wanted to do with POV,
the ability to return an object's dimensions.

Ultimately, it would be great to return all of an object's attributes
(location, scale, texture etc.),
but I guess this would mean a major change to the source code.

Have not yet had a chance to try min_extent/max_extent, but will do so soon.

Best regards, and thanks to you and all fellow POV aficionados.

 
 
 

textwidth/textheight macros

Post by Brad Mett » Sat, 08 Jan 2000 04:00:00


To Everyone:

Font3d is a great program. The DOS version (and the Unix Source) have a
couple of minor flaws when compiling a font to POV3 style.

It seems that the Side and BackBevel triangle output were missing the Texture
style and failed to show up when raytraced.

The ";" was also missing from all of the #declares. (this may be 3.1 specific, but
if you don't want this feature, use the prev ver of Font3d)

The "/-\| characters were not always being removed.

I've recompiled the program for Win32S (using Visual C++ 5). And it's available
to anyone who wants the changes. (I also had to change a few minor function
names to match their VC equivalents, but it's working fine and I'll turn it into and
#ifdef before zipping it all back up)


Quote:

>Nieminen Juha said:  This is easy to do with megapov.

>Thank you Nieminen, (and also Brad Mettee).

>To Brad:
>I downloaded the source code, made the necessary changes
>to return the last TTF's length/height/thickness, and went to recompile.
>Unfortunately my compiler was out of date and after hours of trying, gave up.

>I noticed that a reply from Steve Martin (love his movies <g>), recommended
>font3D, and I will check this out.

>Nieminen,
>This looks like something I've always wanted to do with POV,
>the ability to return an object's dimensions.

>Ultimately, it would be great to return all of an object's attributes
>(location, scale, texture etc.),
>but I guess this would mean a major change to the source code.

>Have not yet had a chance to try min_extent/max_extent, but will do so soon.

--
Brad Mettee
PC HotShots, Inc.
Baltimore, MD

--> Let us bring out the *Power* of your PCs <--

 
 
 

textwidth/textheight macros

Post by Mike William » Sat, 08 Jan 2000 04:00:00



Quote:>Hi all,

>I think most of you who need to add text to a scene would manually
>adjust the
>text scaling until it eventually fitted.

>I've tried writing macros to get the width and height of a text string
>with
>the parameters being the string and current unit scale (with minimal
>success),
>and this is with trying  just one font!

>I'm guessing that the only real way would be to add to the POV source
>and
>get the width/height of the individual TTF characters, but this all
>seems a
>bit of overkill.

>Has anyone had any success with this?

There's a nice public domain include file by Michael D. Johnson that
handles text widths for the timrom.ttf font, which you might like to
take a look at. He does it by coding a table of character widths into
his font.inc file.

It's at http://quark.vpplus.com/~redbeard/raytrace/POVRay-Util.html

--
Mike Williams + #
Gentleman of Leisure

 
 
 

1. POV-Ray macro - accurate sun position macro

Hello folks

I'm fairly new to this ray-tracing lark, but I had a whim to include
accurately aligned sunlight.

So I came up with a macro that returns a vector pointing at the current
position of the sun for a given date, time, latitude, and longitude.
It's probably overkill, but it was a fun learning experience in
celestial mechanics.

If anyone's interested, it's available on my web page at
http://www.ndirect.co.uk/~chris.dennis, along with a sun dial and
assorted other images.

Future plans are for accurate sky colours, the moon, and maybe some
constellations.  Any comments are welcome.

cheers

Chris
--
Chris Dennis                          chris dennis at ndirect co uk
Bristol, England

2. mother board performance question(Dual vs. Quad)

3. Canvas TextHeight

4. Help with service pricing!

5. TextHeight problem with Canvas font

6. RIB parsers

7. Textheight

8. FS: 3DSTUDIO4.0 & ANIMATOR PRO

9. TextHeight 2

10. TextHeight

11. Get TextWidth

12. Compare textwidth with cellwidth in Excel?

13. TextWidth API equivalent for metafiles?