kirill-grouchnikov / radiance

Building modern, elegant and fast Swing applications
BSD 3-Clause "New" or "Revised" License
790 stars 89 forks source link

[Substance] The font size in title of frames and internalframes is fixed #363

Closed goodwilling closed 3 years ago

goodwilling commented 3 years ago

Version of Radiance (current development is 4.5-SNAPSHOT)

4.5-SNAPSHOT

Sub-project (Neon, Trident, Substance, Flamingo, ...)

Substance

Version of Java (current minimum is 9)

11

Version of OS

Windows 10 Pro, CentOS

The issue you're experiencing (expected vs actual, screenshot, stack trace etc)

The font size in the titles of internal frames (JInternalFrame) is fixed in Substance Look and Feel, but not in other LFs (metal, Windows). It is desired that the font size can be adjusted also for the title of internal frames. font-size-in-title-of-internal-frame

kirill-grouchnikov commented 3 years ago

Can you provide full-size (not cropped) screenshots of the same internal frame under Substance, Metal and Windows LAFs?

This one doesn't look to be Substance - it's using different fonts for the "Select Font" vs the other three texts.

goodwilling commented 3 years ago

Please see the attached one for an internal frame under Substance, Metal and Windows LFs. The previous one is a font chooser example. Thanks. font-size-in-title-of-internal-frame

kirill-grouchnikov commented 3 years ago

Looks like you're increasing the height of the title pane, and also setting "InternalFrame.titleFont"?

Metal is broken with smaller buttons in there. And Windows is broken with larger font but a fixed title pane height that clips the descenders.

In Substance you can use SubstanceCortex.GlobalScope.setFontPolicy with a FontPolicy that has a larger size for the font returned from its getWindowTitleFont method. Note that this is a global setting for all decorated title panes, and will apply not only on internal frames, but also on regular frames, dialogs, option panes etc.

https://github.com/kirill-grouchnikov/radiance/blob/sunshine/demos/substance-demo/src/main/java/org/pushingpixels/demo/substance/main/samples/substance/api/SetFontPolicy.java is a small demo that shows an example of constructing a custom font policy.

goodwilling commented 3 years ago

We just increase the size of the internal frame using the setSize method. Substance LF shows the best appearance when the font size is adjusted. Also, we have tried the native Mac Look and Feel in MacOS: The title pane and font size of title do not change. We will try to use setFontPolicy in Substance. Thank you very much.