I implemented a multi-line label by extending JTextPane. The constructor sets various properties to make it look like a label, including disabling any border / settings fields to 0 that work well.
Environment:
- using jgoodies-looks-2.6.0
com.jgoodies.looks.windows.WindowsLookAndFeelL & F setup (also verified using javax.swing.plaf.metal.MetalLookAndFeelthe same issue)- Windows 8 x64
- Java SE 1.7
When I increase the font size, the first letter sometimes has an "empty space" / margin ~ 1px of 19pt (probably increasing with the font size) to the left of it. This happens, at least for the letters B, F, and L, but certainly not for A. Here is an example:


On the left, you can clearly see that the layout looks broken with a heading with this strange edge on the left. Note that the first line with the number (1861) is regular JLabel.
Scaling confirms this (pink line for illustration):


So, because of what I see, the layout is incorrect.
Can this be considered a mistake in the swing? Is there any way to solve this? For instance. Is there a simple and understandable way (i.e. not paint) to have fine-grained control over typographic features in a swing in this context?
EDIT:
This is similar to what I expect:


vs before:


source
share