> > Playing around with POV for the first time in a while, and I'm coming
> > back to something I keep having a program with. Is there any way that,
> > given the dimensions of TrueType fonts, is there a way to *accurately*
> > determine the height and width of a text object, without having to do
> > guesstimate, move, guesstimate, etc.?
> Use POV.
> Write code that provides you with a set of axes with
> hashmarks - add your object{text{...}}.
> Then, by inspection, you have your metrics.
Suggestion appreciated, but that's not quite what I'm looking for (and
it's not that different from what I'm doing already).
Consider:
Each character has a definite height and width in font units (from
reading, it looks like TTF has its own internal scale). Seems to me, it
would be possible to write a program which, for each character:
1.) checks each character's dimensions, stores upper-bound and
lower-bound sizes for determining over-all height,
2.) gets the left-most and right-most coordinates to determine width,
then adds that to a running total, then
3.) adds space and accounts for kerning if another letter follows.
With that, the actual string length could be determined, then scaled
into POV-world coordinates. I've tried reading the TrueType
specification as published by Microsoft, and it's giving me headaches
trying to get any practical information out of it. I'm also looking
into the Windows API for calls to write a Windows program, but it's only
slightly less cryptic to me -- and even after I do that, I'm still not
sure how to scale the font coordinates to POV coordinates.
Ideas, anyone? Possibly anyone on the POV Team who worked on the text
object code who could give some pointers? Or maybe I'm getting into
something better directed at a programming newsgroup?
Again, thanks!
Quote:> des
--
Scott Earnest | We now return you to our regularly |