Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Use Dingbat and Symbol fonts in Cocoa apps System
Have you noticed the the Symbol and Dingbat fonts don't work in Cocoa applications? Do you want them to work? Do you wonder why they don't work when you select one and start typing?

The following solution is courtesy of Vasantha Crabb, who has written an excellent introduction to multiple language support on OS X. Even though I'm a US-centric OS X user, I found it quite interesting. I've put a PDF version of Vasantha's OS X Multiple Language Support guide on my iDisk; if you have any interest in how non-English languages are handled in OS X, give it a read.

To enable Dingbats and Symbol fonts in Cocoa apps, open your System Preferences panel and click the International icon. On the International preference pane, click on Keyboard Menu. Look for Symbol and Dingbats in the keyboard list and place a checkmark next to each. Click the Options button and make sure that command-option-space for switching layouts is checked.

Open a Cocoa application, hit command-option-space until you see either the Symbol or the Dingbat keybard icon in your menubar, and start typing. You should now see Symbol/Dingbat characters onscreen!

If you'd like a brief explanation as to why you need to do this, read the rest of the article. I've snipped a bit of Vasantha's guide that talks specifically about the Dingbat and Sybmol fonts in Cocoa apps ... for the full story, though, read his guide.

Vasantha writes:
Now on to the specifics of the different flavours of applications. Cocoa applications deal with all text using a system called Unicode. Unicode can represent text from almost any script ever used on the earth. The script the text is supposed to be displayed in is implied. This may not mean much, but it'll be important later. In Cocoa applications the setting of Font and keyboard synchronization has no effect. It only affects Carbon applications. In a Cocoa application, the application will try to select a font to suit the script you type in. For instance, if I am typing in English in Helvetica, then switch to Japanese in TextEdit, the font will switch to Hiragino Kaku Gothic Pro, a hard, angular Japanese font. However, if I was typing English in Times, and switched to Japanese, TextEdit would choose a more cursive Japanese, Hiragino Mincho Pro. So in Cocoa, the font is chosen to suit the script, and an attempt is made to keep the overall "look� of the fonts consistent between scripts. If you select some text and then try to change it to a font that doesn't support it, the most similar font that does support it will be used.

This brings us to those two new keyboard layouts: Symbol and Dingbats. Why are they needed? The answer is this fancy font selection setup. Symbol is obviously not a Roman font, it's purely for mathematical symbols. If you select the Symbol font in a Cocoa application and try typing with a Roman keyboard layout selected (Australian, French, US, whatever), the font will change back to something else pretty soon (try it yourself and see).

So to type mathematical symbols, you select the Symbol layout, and then type as though you had selected the Symbol font and US keyboard layout selected in a previous version of Mac!OS. The same concept applies with the Dingbats layout, for the Zapf Dingbats font.
I continue to be amazed at the number of things in OSX of which I have zero knowledge...
    •    
  • Currently 2.00 / 5
  You rated: 2 / 5 (1 vote cast)
 
[8,087 views]  

Use Dingbat and Symbol fonts in Cocoa apps | 4 comments | Create New Account
Click here to return to the 'Use Dingbat and Symbol fonts in Cocoa apps' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
alternate keyboard layout images?
Authored by: tangaloor on Nov 19, '01 07:21:17PM

the only problem with this is that when i do it, i have to have a US flag on my menubar all the time. not a bad thing in and of itself, but i was thinking a canadian flag (or batz maru!) might be a bit more appropriate given my circumstances (and the canadian-csa layout is definitely not an option). anyway, is there a way to edit those li'l layout pix? (looked through the prefpane package contents but no image files for those flags found; the keymapping files aren't transparent re: images, either...)



[ Reply to This | # ]
alternate keyboard layout images?
Authored by: _merlin on Nov 19, '01 08:29:53PM

The images are stored as kcs#, kcs4 and kcs8 resources in a .rsrc file somewhere in the HIToolbox framework, I think. Happy Hacking!



[ Reply to This | # ]
Keyboard icon help
Authored by: HandyMac on Nov 20, '01 11:46:58AM

A useful ResExcellence page on keyboard icons:
http://www.resexcellence.com//11-16-99.shtml

Some notes from a friend on how the icons are coded (and how to
change them in ASCII rather than using a graphic editor):

Here is the list of flag icon colour codes for the 'kcs4' resource:

0 White
1 Yellow
2 Orange
3 Red
4 Magenta
5 Purple
6 Blue
7 Cyan
8 Green
9 Dark Green
A Dark Brown
B Brown
C Light Grey
D Mid Grey
E Dark Grey
F Black

When you open the resource, you'll see something like:

0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
6666666633333333
6060606600000000
6666666633333333
6606060600000000
6666666633333333
6060606600000000
6666666633333333
0000000000000000
3333333333333333
0000000000000000
3333333333333333

This is for the US flag. Ignore the first five lines of 0s, the rest is the
flag. You can replace any pair of hexadecimal numbers (= one ASCII character)
with any other pair, e.g. replacing 33 with 31 changes 2 red pixels to a red
and a yellow. For example, for my 'US - No CapsLock' keyboard, I added a green
block in the lower left corner:

6666666633333333
6060606600000000
6666666633333333
6606060600000000
6666666633333333
6060606600000000
6666666633333333
0000000000000000
3333333333333333
6666000000000000
6666333333333333

Here's a Confederate flag:

6663333333333666
6066633333366606
6660666336660666
3366606666066633
3333666776663333
3333666776663333
3366606666066633
6660666336660666
6066633333366606
6663333333333666
6333333333333336



[ Reply to This | # ]
alternate keyboard layout images?
Authored by: freeandunmuzzled on Nov 21, '01 03:39:59AM

such a shame it doesn't display the cute dingbats asterisk key icon!



[ Reply to This | # ]