home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / mswindo / programm / misc / 4766 < prev    next >
Encoding:
Text File  |  1993-01-08  |  1.6 KB  |  46 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. From: chris@chrism.demon.co.uk (Chris Marriott)
  3. Path: sparky!uunet!pipex!demon!chrism.demon.co.uk!chris
  4. Subject: Re: Printing. How to make 11 pt come out... 
  5. Distribution: world
  6. References: <1993Jan8.144922.3697@cis.ohio-state.edu>
  7. Organization: None
  8. Reply-To: chris@chrism.demon.co.uk
  9. X-Mailer: Simple NEWS 1.90 (ka9q DIS 1.19)
  10. Lines: 31
  11. Date: Fri, 8 Jan 1993 19:38:36 +0000
  12. Message-ID: <726521916snz@chrism.demon.co.uk>
  13. Sender: usenet@demon.co.uk
  14.  
  15. In article <1993Jan8.144922.3697@cis.ohio-state.edu> guzman@python.cis.ohio-state.edu writes:
  16.  
  17. >....looking like 11 pt regardless of the device onto which you are rendering
  18. > the
  19. >text?? I have a program that uses TT fonts for output (due to their scalabi-
  20. >lity), but I am having to *manually* adjust the font size -when I CreateFont
  21. >for the DC- depending on the output device (screen, printer).
  22. >
  23. >I am obviously missing something here. What??
  24. >
  25. >Thanks all
  26. >        Jon -- guzman@cis.ohio-state.edu
  27. >
  28.  
  29. If you have a device context handle, hDC, you can get 11-point text by
  30. saying:
  31.  
  32.     nHeight = 11*GetDeviceCaps( hDC, LOGPIXELSY )/72;
  33.  
  34. then creating a font that's "nHeight" pixels high.  That's the standard
  35. method.
  36.  
  37. Chris
  38. -- 
  39. --------------------------------------------------------------------------
  40. | Chris Marriott                           | chris@chrism.demon.co.uk    |
  41. | Warrington, UK                           | BIX: cmarriott              |
  42. | (Still awaiting inspiration              | CIX: cmarriott              |
  43. |  for a witty .sig .... )                 | CompuServe: 100113,1140     |
  44. --------------------------------------------------------------------------
  45.  
  46.