From 2e2479ed2d66306ef6906d60809c742ae73eb6cd Mon Sep 17 00:00:00 2001 From: Phil Race Date: Mon, 13 Feb 2017 08:49:54 -0800 Subject: [PATCH] 8170913: Java "1.8.0_112" on Windows 10 displays different characters for EUDCs from ones created in eudcedit.exe Reviewed-by: vadim, psadhukhan --- .../share/classes/sun/font/CompositeFont.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/jdk/src/java.desktop/share/classes/sun/font/CompositeFont.java b/jdk/src/java.desktop/share/classes/sun/font/CompositeFont.java index 622a04d472e..bc136d75cfa 100644 --- a/jdk/src/java.desktop/share/classes/sun/font/CompositeFont.java +++ b/jdk/src/java.desktop/share/classes/sun/font/CompositeFont.java @@ -93,20 +93,25 @@ public final class CompositeFont extends Font2D { * 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