Re: Problems setting NSTextStorage attributes with symbol fonts
Re: Problems setting NSTextStorage attributes with symbol fonts
- Subject: Re: Problems setting NSTextStorage attributes with symbol fonts
- From: Brock Brandenberg <email@hidden>
- Date: Thu, 05 Sep 2002 13:49:10 -0500
Hi Douglas.
Thanks for the tips. I don't have much experience with different encodings,
but it sounds as though that could be at the heart of the problem.
I've been using TextEdit, Key Caps and the Character Palette to try and
diagnose the issue, but the difference in their behaviors has been throwing
me off. Key Caps appears to show the representable characters that you can
get with standard ascii values like like "A" 65, "B" 66, etc. When
displaying Webdings, it appears that glyphs are available, but when
displaying Zapf Dingbats, there are none. But when trying to use either of
these in TextEdit, neither will produce glyphs which is the behavior my code
is showing. Then, the Character Palette has been a bit confusing (has anyone
written any substantial documentation for these features?) because the
layout makes it difficult to understand exactly what you're looking at. From
your tips, it appears that if I were to use Unicode encoding in my strings,
I could view the Unicode Table in the Character Palette, turn on the option
to "Show only fonts containing selected character", select a low-range
character like "A" and I should see a list of fonts in the popup menu that
would produce viewable glyphs in my code. Any font not shown in that menu
would cause attribute fixing to apply another font that would at least
produce a viewable character.
Sound like I'm on the right track to enlightenment?
Thanks,
Brock Brandenberg
>
On Thursday, September 5, 2002, at 12:31 AM, Brock Brandenberg wrote:
>
>
> Has anyone had any experience applying attributes with symbol fonts to
>
> a
>
> NSTextStorage? I have a bug where attributes containing symbol fonts
>
> do not
>
> take when applied to an NSTextStorage instance, but every other normal
>
> character font I have works fine.
>
>
I suspect that you are applying this font to characters that are not
>
actually representable in it. During attribute fixing, the text
>
storage is modified so that the font attribute for each character is a
>
font that can actually represent that Unicode character.
>
>
There are some special issues that come up when this is applied to
>
symbol fonts like Symbol, Zapf Dingbats, Wingdings, Webdings, and so
>
forth. The Symbol and Zapf Dingbats fonts are both representable in
>
standard Unicode; you can examine the Unicode tables to find the
>
specific code points involved. However, many people use glyph-based
>
encodings for these fonts. You can use CFString/NSString to convert
>
from these encodings to Unicode--the respective CFString encoding
>
numbers are kCFStringEncodingMacSymbol and
>
kCFStringEncodingMacDingbats. Some other fonts--including, I believe,
>
Wingdings and Webdings--are not representable in standard Unicode, and
>
end up being mapped into ranges like U+F000 to U+F0FF.
>
>
Douglas Davidson
----- industrial design @ www.bergdesign.com ------
_______________________________________________
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.