Unicode labels, fonts for components?
- From: "Peter Duniho" <NpOeStPeAdM@xxxxxxxxxxxxxxxx>
- Date: Sun, 20 Jan 2008 23:56:27 -0800
The main problem I'm having is that the "←" (left arrow) and "→" (right arrow) characters are not displaying property under Windows (Java 6). They are displayed correctly on the Mac (Java 5). (I mentioned the JRE version in case it's relevant, but I'd hope it wouldn't be).
I wondering if this is a consequence of me not setting some property or setting or otherwise not configuring my application or Java correctly. If so, how do I get it to work? If not, what might be wrong? Is it a known limitation of the Windows Java implementation?
I had expected that Java would be fully Unicode-enabled. Eclipse seems to support it just fine, under Windows and on the Mac. And the Java runtime on the Mac supports it fine. (In fact, even on the Eclipse version of Windows the arrows show up fine in the source, and since Eclipse is practically all Java (right?) I expect that demonstrates that there is _some_ way to get Unicode characters to work right in a Java application).
Related to this is that Component.getFont() doesn't appear to behave as documented. The docs imply that _some_ font will be returned; if the Component doesn't have one set, the parent's font will be returned. Now, I suppose read literally this means that if the parent doesn't have a font, you get null. But I would have thought that "font will be returned" really means "the result of Component.getFont() on the parent will be returned", implying that it will work its way up the containment hierarchy until a font is found and returned.
I ran into this because I wondered if the arrows weren't displaying properly because of a font issue. The font being displayed _looks_ like Arial, but my installed Arial font has those characters so I figured I'd double-check to see what font was being used. But calling getFont() on the Component (it's a Button...not sure if that matters) returns null, which is not at all what I expected.
Is there any way programmatically to reliably get the actual font that's current being used to display text in a Component?
But mostly I just want to know how to get my arrow characters to display properly. :)
Thanks!
Pete
.
- Follow-Ups:
- Re: Unicode labels, fonts for components?
- From: Roedy Green
- Re: Unicode labels, fonts for components?
- From: RedGrittyBrick
- Re: Unicode labels, fonts for components?
- Prev by Date: Re: Is this program right?
- Next by Date: Re: Prepare Statements VS Statements
- Previous by thread: Standard Sounds
- Next by thread: Re: Unicode labels, fonts for components?
- Index(es):