🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.os2.programmer
4 messages
4 total messages Started by David DesRoches Fri, 24 Jul 1992 14:54
OUTLINE FONT METRICS
#452
Author: David DesRoches
Date: Fri, 24 Jul 1992 14:54
20 lines
1417 bytes
OK, so I've chosen this really cool OUTLINE font that I want to scale to say,
32 points.  I compute the necessary character cell dimensions, call
GpiSetCharBox() and GpiSetCharSet() to select my new logical font.

QUESTION: How do I get the metrics for this font AT THE SELECTED POINT SIZE?
Calling GpiQueryFontMetrics() at this point returns the same metrics structure
I got back from my initial font query, with metrics designed around a 12 point
font or so.

My only current idea is to compute the ratio of logical.lMaxBaselineExt to
physical(base).lMaxBaselineExt and multiply the metrics by this ratio to
scale them (ascent, descent, maxwidth) to the point size I'm using.  This
seems bogus and prone to round-off error.

Am I missing something?

Thanks.

Dave DesRoches
ddesroch@oracle.com
Re: OUTLINE FONT METRICS
#487
Author: Dave Briccetti
Date: Sun, 26 Jul 1992 18:12
25 lines
1469 bytes
ddesroch@oracle.uucp (David DesRoches) writes:
: OK, so I've chosen this really cool OUTLINE font that I want to scale to say,
: 32 points.  I compute the necessary character cell dimensions, call
: GpiSetCharBox() and GpiSetCharSet() to select my new logical font.
: 
: QUESTION: How do I get the metrics for this font AT THE SELECTED POINT SIZE?
: Calling GpiQueryFontMetrics() at this point returns the same metrics structure
: I got back from my initial font query, with metrics designed around a 12 point
: font or so.
: 
: My only current idea is to compute the ratio of logical.lMaxBaselineExt to
: physical(base).lMaxBaselineExt and multiply the metrics by this ratio to
: scale them (ascent, descent, maxwidth) to the point size I'm using.  This
: seems bogus and prone to round-off error.
: 
: Am I missing something?

That's the approach I'm using.  If there is a better way, I'd like to 
know about it too.
-- 

Dave Briccetti, Owner, Dave Briccetti & Associates
OS/2 Developer/Consultant
P.O. Box 1713
Lafayette, CA  94549-7013
Re: OUTLINE FONT METRICS
#488
Author: Michael Harris
Date: Sun, 26 Jul 1992 20:16
24 lines
1725 bytes
daveb@netcom.com (Dave Briccetti) writes:

>ddesroch@oracle.uucp (David DesRoches) writes:
>OK, so I've chosen this really cool OUTLINE font that I want to scale to say,
>32 points.  I compute the necessary character cell dimensions, call
>GpiSetCharBox() and GpiSetCharSet() to select my new logical font.
> 
>QUESTION: How do I get the metrics for this font AT THE SELECTED POINT SIZE?
>Calling GpiQueryFontMetrics() at this point returns the same metrics structure
>I got back from my initial font query, with metrics designed around a 12 point
>font or so.
>
>My only current idea is to compute the ratio of logical.lMaxBaselineExt to
>physical(base).lMaxBaselineExt and multiply the metrics by this ratio to
>scale them (ascent, descent, maxwidth) to the point size I'm using.  This
>seems bogus and prone to round-off error.
> 
>Am I missing something?

Alternatively, you could query *some* of the info via GpiQueryTextBox.
______________________________________________________________________________
     Michael Harris - harris@catt.ncsu.edu or harris@carvm3.vnet.ibm.com
 System Administrator, Computer & Technologies Theme Program, NC State Univ.
(My opinions are my own and do not represent those of NCSU or IBM Corporation)
Re: OUTLINE FONT METRICS
#551
Author: David DesRoches
Date: Wed, 29 Jul 1992 04:31
52 lines
2886 bytes
harris@garfield.catt.ncsu.edu (Michael Harris) writes:

>daveb@netcom.com (Dave Briccetti) writes:

>>ddesroch@oracle.uucp (David DesRoches) writes:
>>OK, so I've chosen this really cool OUTLINE font that I want to scale to say,
>>32 points.  I compute the necessary character cell dimensions, call
>>GpiSetCharBox() and GpiSetCharSet() to select my new logical font.
>> 
>>QUESTION: How do I get the metrics for this font AT THE SELECTED POINT SIZE?
>>Calling GpiQueryFontMetrics() at this point returns the same metrics structure
>>I got back from my initial font query, with metrics designed around a 12 point
>>font or so.
>>
>>My only current idea is to compute the ratio of logical.lMaxBaselineExt to
>>physical(base).lMaxBaselineExt and multiply the metrics by this ratio to
>>scale them (ascent, descent, maxwidth) to the point size I'm using.  This
>>seems bogus and prone to round-off error.
>> 
>>Am I missing something?

>Alternatively, you could query *some* of the info via GpiQueryTextBox.
>______________________________________________________________________________
>     Michael Harris - harris@catt.ncsu.edu or harris@carvm3.vnet.ibm.com
> System Administrator, Computer & Technologies Theme Program, NC State Univ.
>(My opinions are my own and do not represent those of NCSU or IBM Corporation)

Well, I must have been on drugs the first time through.  My testing was
not thorough.

Bottom line is, if you do:

GpiQueryFonts()
- select the outline font you want -
GpiCreateLogFont()
GpiSetCharSet()
* GpiSetCharBox() *
and finally
GpiQueryFontMetrics()

you *will* receive the scaled font metrics for the new character cell size.

I guess I was missing the SetCharBox() step before.  My thinking was that
I set lMaxBaselineExt and lAveCharWidth in the FATTRS before I called
GpiCreateLogFont(), so I was creating a logical font OF THE SIZE I WANTED.
Not so.  Looks like creating a logical font from an outline font ignores those
fields in FATTRS.  The outline font takes its size from the current 
character cell dimensions.

(Thanks to Scott from Adobe for pointing me in this direction!)

Dave
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads