Re: Detecting Asian fonts?
Re: Detecting Asian fonts?
- Subject: Re: Detecting Asian fonts?
- From: Aki Inoue <email@hidden>
- Date: Sun, 13 Jan 2002 22:07:00 -0800
Andy,
The encoding stuff in NSString is not deprecated.
In fact, you don't need to use any CFString API in order to display the
encoding name.
[[fontEncoding cell] setTitle:[NSString
localizedNameOfStringEncoding:[m_currentFont
mostCompatibleStringEncoding]]];
Aki
On 2002.01.13, at 12:39, Andy wrote:
Charles Jolley wrote:
Hi,
Does anyone know how to determine if a font is made to handle Asian
(Japanese, Korean, etc) characters?
This will tell you the font encoding, putting the description in a
label onscreen.
Look at the classes mentioned, plus NSFont and NSFontManager and you
will soon see how to classify fonts. The only tricky thing is you need
to use the Core Foundation APIs as well as AppKit:
//decoding string encodings requires use of Core Foundation CFString
functions,
//the NSString stuff is deprecated
cfsEncoding =
CFStringGetNameOfEncoding(CFStringConvertNSStringEncodingToEncoding
([m_currentFont mostCompatibleStringEncoding]));
[[fontEncoding cell] setTitle: [FontWindowMediator
CFStringToNSString: cfsEncoding]];
--
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
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.