There is a workaround for this problem. Font display issues are caused by an error with the implementation of Graphics.drawString ().
Two approaches to avoid this:
You can replace your calls with Graphics.drawString (...) with a call like this
- Graphics.drawGlyphVector (Graphics.getFont (). CreateGlyphVector (Graphics.getFontRenderingContext (), String.toCharArray ()))
You can provide your own implementation of Graphics2D, which overrides the drawString () methods and performs the above conversion and delegates drawGlyphVector ()
Using drawGlyphVector () will cause the text to be displayed with Java AWT code, rather than rendering its own OS, so there may be some visual artifacts and performance degradation. But this is much better than the current situation.
user456837
source share