changeset 16697:2855498ee7c6

8170913: Java "1.8.0_112" on Windows 10 displays different characters for EUDCs from ones created in eudcedit.exe. Reviewed-by: vadim, psadhukhan
author prr
date Mon, 13 Feb 2017 08:49:54 -0800
parents 1b9926205a97
children 079b407272a9
files src/java.desktop/share/classes/sun/font/CompositeFont.java
diffstat 1 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/share/classes/sun/font/CompositeFont.java	Mon Feb 13 16:26:11 2017 +0530
+++ b/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++) {