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




You should find the correct unicode encoding for the symbol you want to draw... e.g. intersect = \ u22C2



import javax.swing.JFrame; import javax.swing.JLabel;

public class TestGlyphs extends JFrame {

    TestGlyphs(String s) {
        super(s);
    }

    public static void main(String[] args) {
        TestGlyphs tg = new TestGlyphs("Glyphs");
        JLabel label = new JLabel("\u22C2");
        label.setFont(label.getFont().deriveFont(Font.BOLD, 20f));
        tg.add(label);
        tg.pack();
        tg.setVisible(true);
    }
}


On Apr 20, 2008, at 9:56 AM, 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. From one source they seem fairly simple themselves, U for union, that upside down for intersection and \ for disjoint? But the upside down is just a little tricky, if there's still easier I'd use that?
(Symbol and Zapf Dingbat do show as available fonts but selected for a JTextArea you seem to get some standard set of glyphs).


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

------------------------- Peter Powers Dept. of Earth Sciences (ZHS 117) University of Southern California 3651 Trousdale Pkwy. Los Angeles, CA 90089-0740 -------------------------

_______________________________________________
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: 
 >Symbol font (From: Michael Hall <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.