home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / os2 / programm / 3862 < prev    next >
Encoding:
Internet Message Format  |  1992-07-29  |  2.8 KB

  1. Path: sparky!uunet!oracle!unrepliable!bounce
  2. Newsgroups: comp.os.os2.programmer
  3. From: ddesroch@oracle.uucp (David DesRoches)
  4. Subject: Re: OUTLINE FONT METRICS
  5. Message-ID: <ddesroch.712384265@mailseq>
  6. Sender: usenet@oracle.us.oracle.com (Oracle News Poster)
  7. Nntp-Posting-Host: mailseq.us.oracle.com
  8. Organization: Oracle Corp., Redwood Shores CA
  9. References: <ddesroch.711989648@mailseq> <t2km8fn.daveb@netcom.com> <harris.712181819@garfield.catt.ncsu.edu>
  10. Date: Wed, 29 Jul 1992 04:31:05 GMT
  11. X-Disclaimer: This message was written by an unauthenticated user
  12.               at Oracle Corporation.  The opinions expressed are those
  13.               of the user and not necessarily those of Oracle.
  14. Lines: 53
  15.  
  16. harris@garfield.catt.ncsu.edu (Michael Harris) writes:
  17.  
  18. >daveb@netcom.com (Dave Briccetti) writes:
  19.  
  20. >>ddesroch@oracle.uucp (David DesRoches) writes:
  21. >>OK, so I've chosen this really cool OUTLINE font that I want to scale to say,
  22. >>32 points.  I compute the necessary character cell dimensions, call
  23. >>GpiSetCharBox() and GpiSetCharSet() to select my new logical font.
  24. >> 
  25. >>QUESTION: How do I get the metrics for this font AT THE SELECTED POINT SIZE?
  26. >>Calling GpiQueryFontMetrics() at this point returns the same metrics structure
  27. >>I got back from my initial font query, with metrics designed around a 12 point
  28. >>font or so.
  29. >>
  30. >>My only current idea is to compute the ratio of logical.lMaxBaselineExt to
  31. >>physical(base).lMaxBaselineExt and multiply the metrics by this ratio to
  32. >>scale them (ascent, descent, maxwidth) to the point size I'm using.  This
  33. >>seems bogus and prone to round-off error.
  34. >> 
  35. >>Am I missing something?
  36.  
  37. >Alternatively, you could query *some* of the info via GpiQueryTextBox.
  38. >______________________________________________________________________________
  39. >     Michael Harris - harris@catt.ncsu.edu or harris@carvm3.vnet.ibm.com
  40. > System Administrator, Computer & Technologies Theme Program, NC State Univ.
  41. >(My opinions are my own and do not represent those of NCSU or IBM Corporation)
  42.  
  43. Well, I must have been on drugs the first time through.  My testing was
  44. not thorough.
  45.  
  46. Bottom line is, if you do:
  47.  
  48. GpiQueryFonts()
  49. - select the outline font you want -
  50. GpiCreateLogFont()
  51. GpiSetCharSet()
  52. * GpiSetCharBox() *
  53. and finally
  54. GpiQueryFontMetrics()
  55.  
  56. you *will* receive the scaled font metrics for the new character cell size.
  57.  
  58. I guess I was missing the SetCharBox() step before.  My thinking was that
  59. I set lMaxBaselineExt and lAveCharWidth in the FATTRS before I called
  60. GpiCreateLogFont(), so I was creating a logical font OF THE SIZE I WANTED.
  61. Not so.  Looks like creating a logical font from an outline font ignores those
  62. fields in FATTRS.  The outline font takes its size from the current 
  63. character cell dimensions.
  64.  
  65. (Thanks to Scott from Adobe for pointing me in this direction!)
  66.  
  67. Dave
  68.  
  69.