<AWT Dev> RFR: 8265761: Font with missed font family name is not properly printed on Windows

Alexander Scherbatiy alexsch at openjdk.java.net
Mon Apr 26 20:02:44 UTC 2021


On Sun, 25 Apr 2021 20:53:11 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> Would it be better to use isBlank() instead of isEmpty() to check a font family name is blank?
>> 
>>         if (family.isBlank()) {
>>             return false;
>>         }
>
> I think so.

I changed the test SampleBow font family name to one space [SampleBowOneSpaceFamilyName.ttf](https://bugs.openjdk.java.net/secure/attachment/94402/SampleBowOneSpaceFamilyName.ttf) and to two spaces [SampleBowTwoSpacesFamilyName.ttf](https://bugs.openjdk.java.net/secure/attachment/94403/SampleBowTwoSpacesFamilyName.ttf)

The  PrintFontSample sample program properly prints text drawn by Graphics2D.drawString() and  Graphics2D.drawGlyphVector() on Windows with jdk 16 with these two fonts.
It looks like the problem is only with selecting a font in GDI with empty font family name.

-------------

PR: https://git.openjdk.java.net/jdk/pull/3631


More information about the awt-dev mailing list