atlantafx icon indicating copy to clipboard operation
atlantafx copied to clipboard

Resize ikons with font

Open parszab opened this issue 1 year ago • 2 comments

In the Sampler app resizing the fonts works beautifully when zooming in/out. However ikons don't. Found the corresponding code but it doesn't work.

parszab avatar Mar 13 '23 19:03 parszab

Ikonli doesn't support em. I see you're already found the issue. There's not much I can do. I will add icon scaling and size support when/if it's fixed.

mkpaz avatar Mar 14 '23 05:03 mkpaz

Actually I was able to scale icons with your solution from the Sampler:

String cssString = String.format(".ikonli-font-icon {-fx-icon-size: %d;}", size.intValue() + 3);
scene.getRoot().getStylesheets().removeIf(uri -> uri.startsWith("data:text/css"));
scene.getRoot().getStylesheets().add(
    "data:text/css;base64," + Base64.getEncoder().encodeToString(cssString.toString().getBytes(UTF_8))
);

But em sizing would be nice indeed!

parszab avatar Mar 15 '23 09:03 parszab