Re: Unicode Problem
Re: Unicode Problem
- Subject: Re: Unicode Problem
- From: Chris Ridd <email@hidden>
- Date: Wed, 28 May 2003 16:26:46 +0100
On 28/5/03 3:58 pm, Carl Norum <email@hidden> wrote:
>
On Wednesday, May 28, 2003, at 01:50 AM, Aki Inoue wrote:
>
> Since ZapfDingbatsITC is the only bundled font that covers the
>
> character, it is more efficient to explicitly specify the font in the
>
> attribute than relying on the system.
>
>
OK, but that's what I tried in the first place, and I just get the
>
regular "o", instead of ZapfDingbats' box character. Here's the code I
>
used:
>
>
NSDictionary *dingbats = [NSDictionary dictionaryWithObject:
>
[NSFont fontWithName:@"ZapfDingbatsITC" size:10]
>
forKey:NSFontAttributeName];
>
>
[s2 setString:@"o"];
>
[s2 drawInRect:r2 withAttributes:dingbats];
>
>
So instead of the box I want, I get a lowercase "o", in what looks like
>
the system font (which I am using elsewhere, so maybe it is a problem
>
with the font getting set properly?).
>
>
What's missing here? I choose the correct character ("o", I only
>
checked in MS Word though - it appears that TextEdit doesn't handle
>
dingbats properly?) and set the font. "ZapfDingbatsITC" appears to be
>
the correct font name according to [[NSFontManager sharedFontManager]
>
availableFonts].
There probably isn't an "o" in Zapf Dingbats, so the AppKit's using some
other font which does have it in. Unlike in OS 9, dingbat/symbol etc fonts
aren't mapped onto the normal alphabet - they simply occupy a different
subset of the Unicode space. This is a lot cleaner.
So instead of asking for an "o", you need to ask for the appropriate Unicode
character that you know is in the font. The character palette in Jaguar is a
good way to find what Unicode code a particular character has - choose the
Unicode Blocks tab, and scroll down to "Dingbats". Alternatively look at
<
http://www.unicode.org/>.
>
Thanks for any further insight!
Cheers,
Chris
_______________________________________________
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.