Milchreis / UiBooster

πŸš€ Creates fast and easy dialogs for utility tools
GNU General Public License v3.0
117 stars 12 forks source link

Font size #50

Closed sgjava closed 3 years ago

sgjava commented 3 years ago

Can you control the font size programmaticly? And in a global way?

Milchreis commented 3 years ago

hi @sgjava

you are very active on writing issues and feature requests. thank you very much 😊 Currently UiBooster doesn't provide any methods for changing the font or font size. But you can use the Java Swing UIManager to change the settings globally.

final FontUIResource exampleFontSettings = new FontUIResource(new Font("MS Mincho", Font.PLAIN, 24));

java.util.Enumeration<Object> keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
    Object key = keys.nextElement();
    Object value = UIManager.get(key);
    if (value instanceof javax.swing.plaf.FontUIResource) {
        UIManager.put(key, exampleFontSettings);
    }
}

source from stackoverflow

sgjava commented 3 years ago

Where would I add this code?

sgjava commented 3 years ago

This works before initializing booster.

Milchreis commented 3 years ago
UiBooster booster = new UiBooster(new Font("Comic Sans MS", Font.BOLD, 24));
booster.showInfoDialog("Some fancy information with crazy font");

grafik

This feature will be released with version 1.14.0. Thank you for the idea πŸ‘

sgjava commented 3 years ago

Nice work, I will change my code.

Milchreis commented 3 years ago

Be patient. The next release will still need a little time😊

sgjava commented 3 years ago

OK

On Wed, Sep 15, 2021 at 12:36 PM Nick @.***> wrote:

Be patient. The next release will still need a little time😊

β€” You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/Milchreis/UiBooster/issues/50#issuecomment-920181660, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4RCZ77ZGMDQDHVVQB76FDUCDDSVANCNFSM5DYB7SDA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- Steven P. Goldsmith