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: JLabel Clipping



Sam Berlin <email@hidden> wrote:

>Has anyone else noticed problems with JLabel's clipping text for no reason?

Yes. And not just on 10.3 w/ Java 1.4.2_03-117.1.

In my experience, the reason is that FontMetrics are frequently incorrect,
especially for certain fonts. Some fonts are so badly measured that they
are unusable. And that's just the fonts that come with Mac OS X, not
anything funky I've added afterwards.

The problems I've seen are not confined to FontMetrics.stringWidth().
Similar problems crop up in related areas, such as GlyphVectors and other
means of text measurement.

In JLabels, I've used EmptyBorder to add extra padding as a work-around.
I've also had to avoid some fonts, usually the fancy scripty swashy ones.

And no, turning anti-aliasing off doesn't fix anything, in my experience.
That just makes it break in different ways, in addition to making the text
look like crap.

-- GG
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Do not post admin requests to the list. They will be ignored.




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.