# HG changeset patch # User anashaty # Date 1391774449 -14400 # Node ID 46636540eff25e3f2f14ba0123fdf2b322a3aa8e # Parent 1bacdebef58f5250340abefb2976afcf4a8d5db5 8023990: Regression: postscript size increase from 6u18 Reviewed-by: prr, bae diff -r 1bacdebef58f -r 46636540eff2 src/share/classes/sun/awt/FontConfiguration.java --- a/src/share/classes/sun/awt/FontConfiguration.java Thu Apr 03 17:09:54 2014 +0400 +++ b/src/share/classes/sun/awt/FontConfiguration.java Fri Feb 07 16:00:49 2014 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -867,7 +867,7 @@ return descriptors; } - private FontDescriptor[] buildFontDescriptors(int fontIndex, int styleIndex) { + protected FontDescriptor[] buildFontDescriptors(int fontIndex, int styleIndex) { String fontName = fontNames[fontIndex]; String styleName = styleNames[styleIndex]; diff -r 1bacdebef58f -r 46636540eff2 src/solaris/classes/sun/font/FcFontConfiguration.java --- a/src/solaris/classes/sun/font/FcFontConfiguration.java Thu Apr 03 17:09:54 2014 +0400 +++ b/src/solaris/classes/sun/font/FcFontConfiguration.java Fri Feb 07 16:00:49 2014 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,7 @@ import java.net.InetAddress; import java.net.UnknownHostException; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.util.HashMap; import java.util.HashSet; @@ -173,8 +174,16 @@ } @Override - public FontDescriptor[] getFontDescriptors(String fontName, int style) { - return new FontDescriptor[0]; + protected FontDescriptor[] buildFontDescriptors(int fontIndex, int styleIndex) { + CompositeFontDescriptor[] cfi = get2DCompositeFontInfo(); + int idx = fontIndex * NUM_STYLES + styleIndex; + String[] componentFaceNames = cfi[idx].getComponentFaceNames(); + FontDescriptor[] ret = new FontDescriptor[componentFaceNames.length]; + for (int i = 0; i < componentFaceNames.length; i++) { + ret[i] = new FontDescriptor(componentFaceNames[i], StandardCharsets.UTF_8.newEncoder(), new int[0]); + } + + return ret; } @Override @@ -250,10 +259,12 @@ } String[] fileNames = new String[numFonts]; + String[] faceNames = new String[numFonts]; int index; for (index = 0; index < fcFonts.length; index++) { fileNames[index] = fcFonts[index].fontFile; + faceNames[index] = fcFonts[index].familyName; } if (installedFallbackFontFiles != null) { @@ -266,7 +277,7 @@ = new CompositeFontDescriptor( faceName, 1, - null, + faceNames, fileNames, null, null); }