Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to work out if a font supports a character?



I'm making good progress with my font inspection app - still haven't
solved any of the problems I wrote about the other day, so I'm just
displaying "Unknown" for the cases where I can't get Carbon to talk to Cocoa.

I also filed bugs on the NSFont methods which return garbage or useless values.


Speaking of which, I'm trying to work out how I can know which
characters in a font are valid.

eg, this code:

m_illegal = [[NSCharacterSet illegalCharacterSet] retain];

followed by the test:

[m_illegal characterIsMember: currentChar[0]]

Allows me to determine if the contents of currentChar[0] is just plain
"out of range" for Unicode (2.0, according to the docs).

*but* that doesn't tell me if a particular font supports the glyph at a
given index. ie, the index is a valid unichar, so it passes the
illegalCharacterSet test above, but the font is missing that glyph.

I assumed

[m_currentFont glyphIsEncoded: currentChar[0]]

would answer that question, but it appears to *always* return YES for
everything I've thrown at it so far (that passes the illegalCharacterSet
test) :(

Again, am I missing something or does this stuff have really serious bugs?

--
AndyT (lordpixel - the cat who walks through walls)
A little bigger on the inside

I think we finally found the killer app for Flash: animated stick men




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.