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