JDK-8088943 : [Font] Bitmapped font should not be sub-pixel rendered.
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: 8u5
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2014-04-23
  • Updated: 2018-09-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Blocks :  
Relates :  
Description
Especially in Japanese environment, bitmapped font is widely used as System Font.

In Windows JDK, "MS UI Gothic" is the system font for javafx.

MS UI Gothic includes the bitmap fonts and it is used when the size is under 22px.

When bitmapped font is rendered, it should not be sub-pixel rendered.

Comments
Fixing this bug is a bit too dangerous to go in for 8u20. I am re-targeting it to 8u40.
20-05-2014

More information: Mac/CoreText and T2K will ignored the embedded bitmap and produce a LCD bitmap (no bug) Windows/GDI and Windows/DirectWrite will both ignore the request to LCD and return the embedded bitmap, since our renders expect a LCD mask the rendering it bad (as seen in the example). Linux/Freetype, ignore the request to LCD and return the embedded bitmap, FT_Bitmap.pixel_mode==FT_PIXEL_MODE_MONO (1 bit per pixel). Our rendering in only prepared to handle FT_PIXEL_MODE_GRAY and FT_PIXEL_MODE_LCD, both 8 bits per pixel. This actually causes Aioobe in GTGlyph.
19-05-2014

The fix above is not good enough, mainly it doesn't handle CompositeFonts properly (when the bitmap font is the primary font it is fine, but if it happens as a fallback the rendering fails entirely). BaseShaderGraphics/GlyphCache are not prepared to handle text content that mixes LCD and Grayscale in the same rendering operation. In my machine, here is the list of fonts that contain bitmap glyphs: MS Gothic 7-22 , MS UI Gothic 7-22, MS PGothic 7-22, Batang 11-25, BatangChe 11-25, Gungsuh 11-25, GungsuhChe 11-25, Calibri 12-19, Calibri Bold 12-19, Calibri Bold Italic 12-19, Calibri Italic 12-19, Cambria 12-19, Cambria Math 12-19, Cambria Bold 12-19, Courier New 4-21, Courier New 21, Gulim 11-25, GulimChe 11-25, Dotum 11-25, DotumChe 11-25, Lucida Console 5-8, MS Mincho 7-22, MS PMincho 7-22, MingLiU 11-20, PMingLiU 11-20, MingLiU_HKSCS 11-20, SimSun 12-17, NSimSun 12-17 The list of fallback fonts: [Tahoma, MS UI Gothic, PMingLiU, SimSun, Gulim, Lucida Sans Regular, MingLiU-ExtB, Segoe UI Symbol] As we can see, the fallback fonts have bitmap glyphs.
16-05-2014

http://cr.openjdk.java.net/~fheidric/RT-36794/webrev/
06-05-2014

You can see the problem by the code I posted.
24-04-2014

<code> package fxtest; import javafx.application.Application; import javafx.collections.ObservableList; import javafx.scene.Node; import javafx.scene.Scene; import javafx.scene.layout.Background; import javafx.scene.layout.BackgroundFill; import javafx.scene.layout.GridPane; import javafx.scene.layout.VBox; import javafx.scene.paint.Color; import javafx.scene.text.Font; import javafx.scene.text.FontSmoothingType; import javafx.scene.text.Text; import javafx.stage.Stage; public class HelloWorld extends Application { public static void main(String[] args) { launch(args); } @Override public void start(Stage primaryStage) { primaryStage.setTitle("Hello World!"); GridPane root = new GridPane(); root.setBackground(new Background(new BackgroundFill(Color.WHITE, null, null))); ObservableList<Node> children = root.getChildren(); VBox box = new VBox(); children.add(box); { Font font = Font.font("MS UI Gothic", 14); Text text = new Text("MS UI Gothic (Looks VERY UGLY): \u8b41\uff70\u7e3a\u52b1\uff1e\u8b5b\u6634\u2032\u8b5a\uff65\u7e3a\u6eb7\uff78\u68a7\u608d\u7e3a\uff6e\u8b5b\u6634\u25a1\u875f\u61ca\ufffd\uff73\u7e3a\uff6b\u95ad\uff78\u7e67\u5e1d\u5e55\u7e3a\u5927\uff64\uff67\u9068\uff7a\u7e3a\u3085\u2640\u7e3a\ufffd"); text.setFill(Color.BLACK); text.setFontSmoothingType(FontSmoothingType.LCD); text.setFont(font); box.getChildren().add(text); } { Font font = Font.font("Meiryo UI", 14); Text text = new Text("Meiryo UI (Looks OK): \u8b41\uff70\u7e3a\u52b1\uff1e\u8b5b\u6634\u2032\u8b5a\uff65\u7e3a\u6eb7\uff78\u68a7\u608d\u7e3a\uff6e\u8b5b\u6634\u25a1\u875f\u61ca\ufffd\uff73\u7e3a\uff6b\u95ad\uff78\u7e67\u5e1d\u5e55\u7e3a\u5927\uff64\uff67\u9068\uff7a\u7e3a\u3085\u2640\u7e3a\ufffd"); text.setFill(Color.BLACK); text.setFontSmoothingType(FontSmoothingType.LCD); text.setFont(font); box.getChildren().add(text); } primaryStage.setScene(new Scene(root, 600, 250)); primaryStage.show(); } } </code>
24-04-2014

Can you provide some sample code and steps that show the problem? Please paste the source code into a comment in this JIRA and reopen this bug reports when ready. Thanks. https://wiki.openjdk.java.net/display/OpenJFX/Submitting+a+Bug+Report
23-04-2014