-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
None
-
Product: javafx-2.0beta
Platform: macosx-universal
Build-Number: 213
Build-ID: 2011-07-21_13-17-35
This program produces the bold version of the default font using Font.font(defaultFont.getFamily(), FontWeight.BOLD, defaultFont.getSize()). That is the same font as the one you get with a CSS rule such as -fx-font-weight: bold, so we can expect that people will be seeing it often. On both Windows and Mac the spacing is wrong, as you can see in the attached screenshots. I suspect that the font metrics are being scaled to non-integer widths, but whatever the reason it is obviously not right for the spacing of the same letters to be different depending only on what letters precede them.
I do not think that this is a problem with sub-pixel positioning as inRT-14423.
public class DeleteMe extends Application {
public static void main(String[] args) {
launch(args);
}
@Override public void start(Stage stage) throws Exception {
Font defaultFont = Font.getDefault();
Font defaultBold = Font.font(defaultFont.getFamily(), FontWeight.BOLD, defaultFont.getSize());
Label background = LabelBuilder.create().text("Background color").font(defaultBold).build();
Label foreground = LabelBuilder.create().text("Foreground color").font(defaultBold).build();
VBox vbox = VBoxBuilder.create().children(background, foreground).build();
StageBuilder.create().scene(new Scene(vbox)).visible(true).applyTo(stage);
}
}
I do not think that this is a problem with sub-pixel positioning as in
public class DeleteMe extends Application {
public static void main(String[] args) {
launch(args);
}
@Override public void start(Stage stage) throws Exception {
Font defaultFont = Font.getDefault();
Font defaultBold = Font.font(defaultFont.getFamily(), FontWeight.BOLD, defaultFont.getSize());
Label background = LabelBuilder.create().text("Background color").font(defaultBold).build();
Label foreground = LabelBuilder.create().text("Foreground color").font(defaultBold).build();
VBox vbox = VBoxBuilder.create().children(background, foreground).build();
StageBuilder.create().scene(new Scene(vbox)).visible(true).applyTo(stage);
}
}
- duplicates
-
JDK-8098116 Support glyph rasterisation to sub-pixel precision
-
- Closed
-