home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / mac / programm / 19671 < prev    next >
Encoding:
Internet Message Format  |  1992-12-11  |  1.9 KB

  1. Path: sparky!uunet!hayes!bcoleman
  2. From: bcoleman@hayes.com (Bill Coleman)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: Alg. for Detection of Monspaced Fonts
  5. Message-ID: <6534.2b28a410@hayes.com>
  6. Date: 11 Dec 92 14:22:08 EDT
  7. References: <scott.724029618@phylo>
  8. Organization: Hayes Microcomputer Products, Norcross, GA
  9. Lines: 35
  10.  
  11. In article <scott.724029618@phylo>, scott@phylo.life.uiuc.edu (Scott Howard) writes:
  12. > My Application requires that all fonts it uses are monospaced
  13. > and will allow the user to choose display fonts that meet that requirement.
  14.  
  15. Perhaps your application needs to be rewritten to allow proportional fonts
  16.  
  17. > The application chooses two non-equal chars of a font at random,
  18. > and compare their charwidth at an equal pt size. If they are 
  19. > equivalent, well, you get the point.
  20.  
  21. Why just two characters? You really must scan the entire (legal) character
  22. set. Because if you just happen to choose two that match, you could become
  23. very unlucky with other characters.
  24.  
  25. Comparing 256 characters for the same width shouldn't take much longer than
  26. comparing two characters.
  27.  
  28. > Would someone tell me if I'm reinventing the (Toolbox) wheel here?
  29.  
  30. Alas, the Toolbox has provisions for monospaced fonts. See IM-I p I-231 and 2.
  31. The Font manager defines fontType constants for fixed-width fonts. 
  32.  
  33. Unfortunately, there have never been any fonts with this font type.
  34.  
  35. I ran into this in 1984. Our solution was to create our own fonts. Today the
  36. better solution is to support proportional fonts.
  37.  
  38. -- 
  39. Bill Coleman, AA4LR                ! CIS: 76067,2327    AppleLink: D1958
  40. Principal Software Engineer        ! Packet Radio: AA4LR @ W4QO
  41. Hayes Microcomputer Products, Inc. ! UUCP: uunet!hayes!bcoleman
  42. POB 105203 Atlanta, GA 30348 USA   ! Internet: bcoleman%hayes@uunet.uu.net
  43. Disclaimer: "My employer doesn't pay me to have opinions."
  44. Quote: "The same light shines on vineyards that makes deserts." -Steve Hackett.
  45.  
  46.