controlsfx / controlsfx/controlsfx

Glyph CSS Styling Limitations

Open
#1,147 1 comment 2 reactions 0 assignees View on GitHub
bug help wanted
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

![GlyphCSSTest](https://user-images.githubusercontent.com/4647671/56812525-fafc4100-6832-11e9-9c15-dc49a3c12789.jpg)

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.