ADDITIONAL SYSTEM INFORMATION :
Windows 11, D3D
A DESCRIPTION OF THE PROBLEM :
Rendering text with an outline stroke produces unexpected stroke artifacts.
In the example code, the following issues can be observed:
- At the top end of the digit 4, a sharp tip appears. If you look zoom in (with a screenshot tool for example), it looks as if two stroke renderings overlap. I have observed the same for the letter 'M', but that was in another application.
- The lowercase 'o' loses the inner stroke as the stroke width increases.
- The dots on 'i' and 'j' are not properly outlined, showing gaps inside.
- The glyphs themselves sometimes appear slightly unclear or blurry, which may be related to subpixel rendering.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
See demo code
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Clean looking text, no space with increasing stroke with, no tips/spikes
ACTUAL -
Artifacts described above
---------- BEGIN SOURCE ----------
public class TextOutsideStrokeDemo extends Application {
private static final String DEMO_TEXT = "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9";
private static final Font SYSTEM_FONT = Font.font("System", 12);
@Override
public void start(Stage stage) {
final VBox root = new VBox(20);
root.setPadding(new Insets(50));
for (double strokeWidth = 1; strokeWidth <= 5; strokeWidth += 0.5) {
final var text = new Text(DEMO_TEXT);
text.setFont(SYSTEM_FONT);
text.setFill(Color.BLACK);
text.setStroke(Color.MAGENTA);
text.setStrokeWidth(strokeWidth);
text.setStrokeType(StrokeType.OUTSIDE);
root.getChildren().add(text);
}
final Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
---------- END SOURCE ----------
Windows 11, D3D
A DESCRIPTION OF THE PROBLEM :
Rendering text with an outline stroke produces unexpected stroke artifacts.
In the example code, the following issues can be observed:
- At the top end of the digit 4, a sharp tip appears. If you look zoom in (with a screenshot tool for example), it looks as if two stroke renderings overlap. I have observed the same for the letter 'M', but that was in another application.
- The lowercase 'o' loses the inner stroke as the stroke width increases.
- The dots on 'i' and 'j' are not properly outlined, showing gaps inside.
- The glyphs themselves sometimes appear slightly unclear or blurry, which may be related to subpixel rendering.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
See demo code
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Clean looking text, no space with increasing stroke with, no tips/spikes
ACTUAL -
Artifacts described above
---------- BEGIN SOURCE ----------
public class TextOutsideStrokeDemo extends Application {
private static final String DEMO_TEXT = "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9";
private static final Font SYSTEM_FONT = Font.font("System", 12);
@Override
public void start(Stage stage) {
final VBox root = new VBox(20);
root.setPadding(new Insets(50));
for (double strokeWidth = 1; strokeWidth <= 5; strokeWidth += 0.5) {
final var text = new Text(DEMO_TEXT);
text.setFont(SYSTEM_FONT);
text.setFill(Color.BLACK);
text.setStroke(Color.MAGENTA);
text.setStrokeWidth(strokeWidth);
text.setStrokeType(StrokeType.OUTSIDE);
root.getChildren().add(text);
}
final Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
---------- END SOURCE ----------