Mailing Lists: Apple Mailing Lists

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

Unable to get Symbol font in java apps on Mac OS X



I have tended to use the original 1.1 recommendations with fonts of specifying, generic families (serif, sanserif, monospaced etc) for example:

myFont = new Font("sanserif", Font.PLAIN,10);
setFont(myFont);
g.drawString("wibble", 5, 5);

but currently I need to display the Greek phi and psi characters. I therefore used the names of the Symbol font:

myFont = new Font("Symbol", Font.PLAIN,10); etc

which works ok going back to Mac OS 9, but not on Mac OS X (where I was working), where it reverts to some default sans font, although specifying the names of other fonts, eg 'Times' works ok.

I did a number of tests, checking for available fonts using the appropriate java code on the command line lists a set of fonts including Symbol. Symbol is also available to desktop apps like Word, Appleworks etc. However on viewing fonts with Apple's Keyboard Viewer, Symbol displays in a Roman face rather than in Greek characters. This happens on two machines, both running 10.4.7 PPC, one of which is a relatively new PowerBook G4 onto which I have not done any font installs.

Interestingly the tutorial font applet on Sun's website behaves similarly to Keyboard Viewer - ie the font is listed but displays in Roman face.

I've copied model code until I'm blue in the face, tried it in Graphics 2D, all to no avail. Anyone know what I'm doing wrong?

And while I'm on the subject, how would I specify a special character like an en-dash (alt-hyphen) to get a proper minus sign?

David
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden


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.