Mercurial > hg > shenandoah-preopenjdk-archive > openjdk8 > jdk
changeset 9809:726370d73bae jdk8u11-b05
8023990: Regression: postscript size increase from 6u18
Reviewed-by: prr, bae
author | anashaty |
---|---|
date | Thu, 06 Feb 2014 13:07:55 +0400 |
parents | 0d030a0426f3 |
children | c716909c2024 |
files | src/share/classes/sun/awt/FontConfiguration.java src/solaris/classes/sun/font/FcFontConfiguration.java |
diffstat | 2 files changed, 17 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/share/classes/sun/awt/FontConfiguration.java Thu Apr 03 16:40:58 2014 +0400 +++ b/src/share/classes/sun/awt/FontConfiguration.java Thu Feb 06 13:07:55 2014 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2013, 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];
--- a/src/solaris/classes/sun/font/FcFontConfiguration.java Thu Apr 03 16:40:58 2014 +0400 +++ b/src/solaris/classes/sun/font/FcFontConfiguration.java Thu Feb 06 13:07:55 2014 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2012, 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); }