controlsfx / controlsfx/controlsfx
Glyph CSS Styling Limitations
- Dominant language
- Java
- Stars
- 1.7k
- Forks
- 300
- Avg merge
- 16d 17h
- Merged PRs (30d)
- 1
Description
Glyph CSS styling does not seem to work.
In particular:
1. -fx-text-fill: red; // works
2. -fx-stroke:blue; // is ignored
3. -fx-font-size: 48; // corrupts icon

SSCCE
---
```
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.HBox;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
import org.controlsfx.glyphfont.FontAwesome;
import org.controlsfx.glyphfont.Glyph;
public class GlyphCSSTest extends Application {
@Override
public void start(Stage primaryStage) {
Glyph glyph1 = new Glyph("FontAwesome", FontAwesome.Glyph.BEER);
glyph1.setFontSize(48); // programatically set font size works
glyph1.setColor(Color.RED); // programatically set color works
Glyph glyph2 = new Glyph("FontAwesome", FontAwesome.Glyph.BEER);
glyph2.setStyle("-fx-text-fill: red; -fx-background-color: green;"); // Works as expected
Glyph glyph3 = new Glyph("FontAwesome", FontAwesome.Glyph.BEER);
glyph3.setStyle("-fx-text-fill: red; -fx-stroke:blue;"); // -fx-stroke ignored
Glyph glyph4 = new Glyph("FontAwesome", FontAwesome.Glyph.BEER);
glyph4.setStyle("-fx-text-fill: red; -fx-font-size: 48;"); // -fx-font-size: 48 corrupts icon
HBox root = new HBox();
root.setSpacing(10);
root.getChildren().addAll(glyph1, glyph2, glyph3, glyph4);
primaryStage.setTitle("Glyph CSS Test");
primaryStage.setScene(new Scene(root, 160, 70));
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by running the provided GlyphCSSTest SSCCE and inspect the Glyph styling and font-size handling, along with the FontAwesome glyph setup. Compare the CSS cases with the programmatic setters; done means the reported stroke and font-size behaviors are understood and corrected without corrupting the icon.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100