8170913: Java "1.8.0_112" on Windows 10 displays different characters for EUDCs from ones created in eudcedit.exe.
Reviewed-by: vadim, psadhukhan
--- a/jdk/src/java.desktop/share/classes/sun/font/CompositeFont.java Mon Feb 13 16:26:11 2017 +0530
+++ b/jdk/src/java.desktop/share/classes/sun/font/CompositeFont.java Mon Feb 13 08:49:54 2017 -0800
@@ -93,20 +93,25 @@
* better that it is handled internally to the CompositeFont class.
*/
if (fm.getEUDCFont() != null) {
+ int msCnt = numMetricsSlots;
+ int fbCnt = numSlots - msCnt;
numSlots++;
if (componentNames != null) {
componentNames = new String[numSlots];
- System.arraycopy(compNames, 0, componentNames, 0, numSlots-1);
- componentNames[numSlots-1] =
- fm.getEUDCFont().getFontName(null);
+ System.arraycopy(compNames, 0, componentNames, 0, msCnt);
+ componentNames[msCnt] = fm.getEUDCFont().getFontName(null);
+ System.arraycopy(compNames, msCnt,
+ componentNames, msCnt+1, fbCnt);
}
if (componentFileNames != null) {
componentFileNames = new String[numSlots];
System.arraycopy(compFileNames, 0,
- componentFileNames, 0, numSlots-1);
+ componentFileNames, 0, msCnt);
+ System.arraycopy(compFileNames, msCnt,
+ componentFileNames, msCnt+1, fbCnt);
}
components = new PhysicalFont[numSlots];
- components[numSlots-1] = fm.getEUDCFont();
+ components[msCnt] = fm.getEUDCFont();
deferredInitialisation = new boolean[numSlots];
if (defer) {
for (int i=0; i<numSlots-1; i++) {