Details
-
Type:
Bug
-
Status: Closed
-
Priority:
P3
-
Resolution: Not an Issue
-
Affects Version/s: 8, 9, 12, 13
-
Fix Version/s: tbd
-
Component/s: client-libs
-
Labels:
-
Subcomponent:
-
CPU:x86
-
OS:os_x
Description
ADDITIONAL SYSTEM INFORMATION :
Mac OS 10.14.4
A DESCRIPTION OF THE PROBLEM :
Font.canDisplayUpTo method always returns -1 on Mac OS X even if the font doesn't contain necessary glyphs to display the string.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Mac OS includes Herculanum system font which doesn't support cyrillic characters. Execute the following function:
System.out.println(new Font("Herculanum", Font.PLAIN, 12).canDisplayUpTo("ÑеÑÑ"));
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The code prints "0" since "Herculanum" font doesn't support Cyrillic characters
ACTUAL -
The method returns -1 as if all characters are supported
---------- BEGIN SOURCE ----------
System.out.println(new Font("Herculanum", Font.PLAIN, 12).canDisplayUpTo("ÑеÑÑ"));
---------- END SOURCE ----------
FREQUENCY : always
Mac OS 10.14.4
A DESCRIPTION OF THE PROBLEM :
Font.canDisplayUpTo method always returns -1 on Mac OS X even if the font doesn't contain necessary glyphs to display the string.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Mac OS includes Herculanum system font which doesn't support cyrillic characters. Execute the following function:
System.out.println(new Font("Herculanum", Font.PLAIN, 12).canDisplayUpTo("ÑеÑÑ"));
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The code prints "0" since "Herculanum" font doesn't support Cyrillic characters
ACTUAL -
The method returns -1 as if all characters are supported
---------- BEGIN SOURCE ----------
System.out.println(new Font("Herculanum", Font.PLAIN, 12).canDisplayUpTo("ÑеÑÑ"));
---------- END SOURCE ----------
FREQUENCY : always
Attachments
Issue Links
- duplicates
-
JDK-8252965 [macos] Font.canDisplayUpTo returns wrong index for Indic text which causes crash later | OpenJDK Corretto 8.265.01.2
-
- Closed
-