提交 c86911e8 编写于 作者: A anashaty

8023990: Regression: postscript size increase from 6u18

Reviewed-by: prr, bae
上级 1c4518bf
/* /*
* 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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -867,7 +867,7 @@ public abstract class FontConfiguration { ...@@ -867,7 +867,7 @@ public abstract class FontConfiguration {
return descriptors; return descriptors;
} }
private FontDescriptor[] buildFontDescriptors(int fontIndex, int styleIndex) { protected FontDescriptor[] buildFontDescriptors(int fontIndex, int styleIndex) {
String fontName = fontNames[fontIndex]; String fontName = fontNames[fontIndex];
String styleName = styleNames[styleIndex]; String styleName = styleNames[styleIndex];
......
/* /*
* 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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -33,6 +33,7 @@ import java.io.IOException; ...@@ -33,6 +33,7 @@ import java.io.IOException;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files; import java.nio.file.Files;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
...@@ -173,8 +174,16 @@ public class FcFontConfiguration extends FontConfiguration { ...@@ -173,8 +174,16 @@ public class FcFontConfiguration extends FontConfiguration {
} }
@Override @Override
public FontDescriptor[] getFontDescriptors(String fontName, int style) { protected FontDescriptor[] buildFontDescriptors(int fontIndex, int styleIndex) {
return new FontDescriptor[0]; 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 @Override
...@@ -250,10 +259,12 @@ public class FcFontConfiguration extends FontConfiguration { ...@@ -250,10 +259,12 @@ public class FcFontConfiguration extends FontConfiguration {
} }
String[] fileNames = new String[numFonts]; String[] fileNames = new String[numFonts];
String[] faceNames = new String[numFonts];
int index; int index;
for (index = 0; index < fcFonts.length; index++) { for (index = 0; index < fcFonts.length; index++) {
fileNames[index] = fcFonts[index].fontFile; fileNames[index] = fcFonts[index].fontFile;
faceNames[index] = fcFonts[index].familyName;
} }
if (installedFallbackFontFiles != null) { if (installedFallbackFontFiles != null) {
...@@ -266,7 +277,7 @@ public class FcFontConfiguration extends FontConfiguration { ...@@ -266,7 +277,7 @@ public class FcFontConfiguration extends FontConfiguration {
= new CompositeFontDescriptor( = new CompositeFontDescriptor(
faceName, faceName,
1, 1,
null, faceNames,
fileNames, fileNames,
null, null); null, null);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册