提交 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.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -867,7 +867,7 @@ public abstract class FontConfiguration {
return descriptors;
}
private FontDescriptor[] buildFontDescriptors(int fontIndex, int styleIndex) {
protected FontDescriptor[] buildFontDescriptors(int fontIndex, int styleIndex) {
String fontName = fontNames[fontIndex];
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.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -33,6 +33,7 @@ import java.io.IOException;
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 @@ public class FcFontConfiguration extends FontConfiguration {
}
@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 @@ public class FcFontConfiguration extends FontConfiguration {
}
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 @@ public class FcFontConfiguration extends FontConfiguration {
= new CompositeFontDescriptor(
faceName,
1,
null,
faceNames,
fileNames,
null, null);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册