Mailing Lists: Apple Mailing Lists

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

Re: Symbol font




On Apr 20, 2008, at 12:45 PM, Greg Guerin wrote:

Michael Hall wrote:

One post from Google seems to indicate that this, the Symbol font as well
as Dingbats fonts, can't be used from java. Is this correct? Is there some
other easy alternative? I'm interested in the set theory symbols for union,
intersection and I guess disjoint sets.

In Unicode, union is \u222A, intersection is \u2229. There's a block of
codes starting at \u2200 that contain an extensive range of mathematical
symbols. You can look up these and many more at the Unicode site. Google
keywords:
unicode mathematical union

Output to my testing applications JTextArea with or without the Symbol font
System.out.println("\u2229");
seems to show - ? , just question mark


I was going to throw together a quick test case to show it doesn't work. But the quick test does work just fine.
So, thanks.


import javax.swing.*;

public class SymbolTester extends JFrame {
	JTextArea display = new JTextArea();
	
	public static void main(String[] args) {
		SymbolTester tester = new SymbolTester();
		tester.pack();
		tester.setVisible(true);
	}
	
	SymbolTester() {
		super("Symbol Tester");
		display.setSize(250,25);
		display.setPreferredSize(new java.awt.Dimension(250,25));
		display.setMinimumSize(new java.awt.Dimension(250,25));
		getContentPane().add(display);
		display.setText("intersection = \u2229 union = \u222A");
	}
}

The quick test that works. Something must not pipe through the original app quite right.

Mike Hall        hallmike at att dot net
http://www.geocities.com/mik3hall
http://sourceforge.net/projects/macnative



_______________________________________________
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
References: 
 >Re: Symbol font (From: Greg Guerin <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.