-
Bug
-
Resolution: Fixed
-
P3
-
jfx11, jfx20, 8, jfx17, jfx21
-
b05
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8325586 | jfx22.0.1 | Kevin Rushforth | P3 | Resolved | Fixed | b05 |
JDK-8325744 | 8u421 | Kevin Rushforth | P3 | Resolved | Fixed | b01 |
JDK-8328945 | 8u411 | Ambarish Rapte | P3 | Resolved | Fixed | b31 |
JDK-8326352 | 8u401 | Kevin Rushforth | P3 | Closed | Fixed | b33 |
Tested on Linux and Windows, with Java version 8u361 and with Java 20.1 and JavaFX 20.1
A DESCRIPTION OF THE PROBLEM :
When a colour with transparency is used, FontSmoothingType.LCD produces the wrong colour
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the attached code and compare the colour of the Text nodes with the colour of the border
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The colour of the Text nodes should be the same as the colour of the border, independently of which FontSmoothingType is selected
ACTUAL -
When FontSmoothingType.LCD is selected, the color of the Text nodes is wrong
---------- BEGIN SOURCE ----------
public class Transparency extends Application {
public static void main( String[] args ) {
launch( args );
}
@Override
public void start( Stage primaryStage ) throws Exception {
primaryStage.setTitle( "prism.lcdtext = " + System.getProperty( "prism.lcdtext" ) );
Text txt = new Text( "TEST" );
TextField tf = new TextField( "TEST" );
ChoiceBox<FontSmoothingType> cb = new ChoiceBox<>( FXCollections.observableArrayList( FontSmoothingType.values() ) );
cb.getSelectionModel().selectedItemProperty().addListener( ( obs, ol, ne ) -> {
( (Text) tf.lookup( ".text" ) ).setFontSmoothingType( ne );
txt.setFontSmoothingType( ne );
} );
Platform.runLater( () -> cb.getSelectionModel().select( FontSmoothingType.LCD ) );
TextArea ta = new TextArea( "-fx-border-width: 5px;\n"
+ "-fx-font-size: 24px;\n"
+ "-fx-font-family: \"Open Sans\";\n"
+ "-fx-font-weight: bold;\n"
+ "\n"
+ "-fx-background-color: transparent;\n"
+ "-fx-border-color: rgba(0, 44, 111, 0.4);\n"
+ "-fx-text-fill: rgba(0, 44, 111, 0.4);\n"
+ "-fx-fill: rgba(0, 44, 111, 0.4);\n"
+ "\n"
+ "" );
tf.styleProperty().bind( ta.textProperty() );
txt.styleProperty().bind( ta.textProperty() );
HBox root = new HBox( 20 );
root.setPadding( new Insets( 20 ) );
final VBox controlBox = new VBox( cb, ta );
controlBox.setSpacing( 20 );
final VBox renderBox = new VBox( txt, tf );
renderBox.setSpacing( 20 );
root.getChildren().addAll( controlBox, renderBox );
Scene scene = new Scene( root, 700, 200 );
primaryStage.setScene( scene );
primaryStage.show();
}
}
---------- END SOURCE ----------
FREQUENCY : always
- backported by
-
JDK-8325586 FontSmoothingType LCD produces wrong color when transparency is used
- Resolved
-
JDK-8325744 FontSmoothingType LCD produces wrong color when transparency is used
- Resolved
-
JDK-8328945 FontSmoothingType LCD produces wrong color when transparency is used
- Resolved
-
JDK-8326352 FontSmoothingType LCD produces wrong color when transparency is used
- Closed
- links to
-
Commit openjdk/jfx22u/d4328d96
-
Commit openjdk/jfx/a39732a3
-
Review openjdk/jfx22u/10
-
Review openjdk/jfx/1361