Substance 5.2 – extended support for very large fonts
April 21st, 2009 | 4 Comments »Supporting wide variety of font sizes in modern UI toolkits is a necessity, and previous entry provided a little background on the topic. The keen-eyed readers might have noticed the gaps in the curved corners of the combobox arrow button:

What happened here? The border painter in Substance gets two contours – the outer and the inner. For buttons, these contours are computed by matching the button shaper, ClassicButtonShaper in case of combobox arrow buttons. The problem in the computation was that it used the same curvature radius for both outer and inner contours, which resulted in the visible visual gaps under large font sizes.
The correct solution is to subtract the border stroke weight from the outer radius, and use the resulting value for the inner radius. Unfortunately, the API signature of the SubstanceButtonShaper interface had to be changed in order to accommodate this functionality – so if you have a custom button shaper, you will need to implement a new method added to this interface.
The following screenshot shows a large checkmark icon under Substance 5.2dev (on left) and Substance 5.1 (on right):

The next screenshot shows a combobox under Substance 5.2dev (on top) and Substance 5.1 (on bottom):

As you can see in both screenshots, the inner contour is now aligned with the outer contour in the corners.
This work will continue in the next releases to make sure that all core Swing controls look correctly under different font sizes, including very large values such as shown in this entry. In the meantime, you’re welcome to take the latest 5.2dev drop of core Substance (code-named Quebec) for a spin. Release candidate for Substance 5.2 is scheduled for May 11 and the final release is scheduled for May 25.
Related posts:
- Substance 5.1 – extended support for very large fonts Supporting wide variety of font sizes in modern UI toolkits is a necessity. Toolkits such...
- Control alignment under different fonts in Substance 6.0 After taking a deep dive into the intricacies of aligning text components, comboboxes, spinners and...
- Extended support for native video codecs in JMC There’s nothing like the right link at the right time. Remy Rakic (Twitter alias lqd)...
- Improving decoration area support for lists, trees and tables in Substance The decoration areas in Substance look-and-feel are, in my view, one of the more powerful...
Man, you realy dont leave any pixel behind!
Awesome work, Substance is really awsome :)
As always, I’m amazed over your thoroughness. Great work!
[...] ran into the bulging-concentric-rounded-rectangle problem, which you can see below (coincidently, Kirill posted about this very topic yesterday): Notice that both rounded rectangles (outer and inner) have [...]
[...] on May 25th, so it’s less than a month to wait now. One of the new features in 5.2 is improved support for very large font sizes . Finally, if you’re interested in knowing more about Substance internals, check out this [...]