CSS -glyph-size broken

Issue #44 resolved
Алексей Сазонов created an issue

Hello.

#8d6bd39 broke css -glyph-size property.

This line setStyle(String.format("-fx-font-family: %s;", icon.getFontFamily())); causes reset to default font size issue.

Peek 2017-01-28 13-29.gif

JavaFX log:

Init:

Jan 28, 2017 2:40:50 PM javafx.scene.CssStyleHelper transitionToState
FINER: -fx-fill, call applyStyle: ObjectProperty [bean: Text[text="", x=0.0, y=0.0, alignment=LEFT, origin=BASELINE, boundsType=LOGICAL, font=Font[name=FontAwesome, family=FontAwesome, style=Regular, size=12.0], fontSmoothingType=GRAY, fill=0x000000ff], name: fill, value: 0x000000ff], value =0x9acd32ff, originOfCalculatedValue=AUTHOR
Jan 28, 2017 2:40:50 PM javafx.scene.CssStyleHelper transitionToState
FINER: -fx-font, call applyStyle: ObjectProperty [bean: Text[text="", x=0.0, y=0.0, alignment=LEFT, origin=BASELINE, boundsType=LOGICAL, font=Font[name=FontAwesome, family=FontAwesome, style=Regular, size=12.0], fontSmoothingType=GRAY, fill=0x9acd32ff], name: font, value: Font[name=FontAwesome, family=FontAwesome, style=Regular, size=12.0]], value =Font[name=FontAwesome, family=FontAwesome, style=Regular, size=12.0], originOfCalculatedValue=INLINE
Jan 28, 2017 2:40:50 PM javafx.scene.CssStyleHelper transitionToState
FINER: -glyph-name, call applyStyle: ObjectProperty [bean: Text[text="", x=0.0, y=0.0, alignment=LEFT, origin=BASELINE, boundsType=LOGICAL, font=Font[name=FontAwesome, family=FontAwesome, style=Regular, size=12.0], fontSmoothingType=GRAY, fill=0x9acd32ff], name: glyphName, value: ANCHOR], value =THUMBS_UP, originOfCalculatedValue=AUTHOR
Jan 28, 2017 2:40:50 PM javafx.scene.CssStyleHelper transitionToState
FINER: -glyph-size, call applyStyle: ObjectProperty [bean: Text[text="", x=0.0, y=0.0, alignment=LEFT, origin=BASELINE, boundsType=LOGICAL, font=Font[name=FontAwesome, family=FontAwesome, style=Regular, size=12.0], fontSmoothingType=GRAY, fill=0x9acd32ff], name: glyphSize, value: 12.0], value =48.0, originOfCalculatedValue=AUTHOR

Hover:

Jan 28, 2017 2:42:05 PM javafx.scene.CssStyleHelper transitionToState
FINER: -fx-effect, call applyStyle: ObjectProperty [bean: Text[text="", x=0.0, y=0.0, alignment=LEFT, origin=BASELINE, boundsType=LOGICAL, font=Font[name=FontAwesome, family=FontAwesome, style=Regular, size=48.0], fontSmoothingType=GRAY, fill=0x9acd32ff], name: effect, value: null], value =javafx.scene.effect.DropShadow@4e29f526, originOfCalculatedValue=AUTHOR
Jan 28, 2017 2:42:05 PM javafx.scene.CssStyleHelper transitionToState
FINER: -fx-font, call applyStyle: ObjectProperty [bean: Text[text="", x=0.0, y=0.0, alignment=LEFT, origin=BASELINE, boundsType=LOGICAL, font=Font[name=FontAwesome, family=FontAwesome, style=Regular, size=48.0], fontSmoothingType=GRAY, fill=0x9acd32ff], name: font, value: Font[name=FontAwesome, family=FontAwesome, style=Regular, size=48.0]], value =Font[name=FontAwesome, family=FontAwesome, style=Regular, size=48.0], originOfCalculatedValue=INLINE

Unhover:

Jan 28, 2017 2:42:09 PM javafx.scene.CssStyleHelper transitionToState
FINER: -fx-font, call applyStyle: ObjectProperty [bean: Text[text="", x=0.0, y=0.0, alignment=LEFT, origin=BASELINE, boundsType=LOGICAL, font=Font[name=FontAwesome, family=FontAwesome, style=Regular, size=48.0], fontSmoothingType=GRAY, fill=0x9acd32ff], name: font, value: Font[name=FontAwesome, family=FontAwesome, style=Regular, size=48.0]], value =Font[name=FontAwesome, family=FontAwesome, style=Regular, size=12.0], originOfCalculatedValue=INLINE

Comments (2)

  1. Adam Carroll

    I'm also experiencing this problem. FontAwesomeFX v4.7.0 works fine but if I upgrade to 4.7.0-2 I see the same problem reported by Aleksei.

    If you'd like to reproduce it with the VocabHunter code, clone the codebase and checkout version 1.0.19. Change the following line in the Gradle build to update the FontAwesomeFX version:

    https://github.com/VocabHunter/VocabHunter/blob/1.0.19/gui/build.gradle#L47

    You can launch VocabHunter as follows:

    ./gradlew :gui:run
    

    If you roll the mouse over the buttons with Font Awesome icons, you'll see the problem. I've tested this on MacOS 10.11.6 with Oracle JDK 1.8.0_102.

    Keep up the great work with FontAwesomeFX!

  2. Log in to comment