Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
e6aa8195
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e6aa8195
编写于
8月 25, 2015
作者:
R
robm
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
3cec7b5c
ae55f8be
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
126 addition
and
60 deletion
+126
-60
make/mapfiles/libawt/mapfile-mawt-vers
make/mapfiles/libawt/mapfile-mawt-vers
+1
-1
make/mapfiles/libawt/mapfile-vers-linux
make/mapfiles/libawt/mapfile-vers-linux
+1
-1
make/mapfiles/libawt_headless/mapfile-vers
make/mapfiles/libawt_headless/mapfile-vers
+1
-1
make/mapfiles/libawt_xawt/mapfile-vers
make/mapfiles/libawt_xawt/mapfile-vers
+1
-1
src/solaris/classes/sun/awt/FcFontManager.java
src/solaris/classes/sun/awt/FcFontManager.java
+108
-0
src/solaris/classes/sun/awt/X11FontManager.java
src/solaris/classes/sun/awt/X11FontManager.java
+2
-46
src/solaris/classes/sun/font/FcFontConfiguration.java
src/solaris/classes/sun/font/FcFontConfiguration.java
+6
-6
src/solaris/native/sun/awt/fontpath.c
src/solaris/native/sun/awt/fontpath.c
+6
-4
未找到文件。
make/mapfiles/libawt/mapfile-mawt-vers
浏览文件 @
e6aa8195
...
@@ -242,7 +242,7 @@ SUNWprivate_1.1 {
...
@@ -242,7 +242,7 @@ SUNWprivate_1.1 {
getDefaultConfig;
getDefaultConfig;
Java_sun_font_FontConfigManager_getFontConfig;
Java_sun_font_FontConfigManager_getFontConfig;
Java_sun_font_FontConfigManager_getFontConfigAASettings;
Java_sun_font_FontConfigManager_getFontConfigAASettings;
Java_sun_awt_
X11
FontManager_getFontPathNative;
Java_sun_awt_
Fc
FontManager_getFontPathNative;
Java_sun_font_SunFontManager_populateFontFileNameMap;
Java_sun_font_SunFontManager_populateFontFileNameMap;
# CDE private entry point
# CDE private entry point
...
...
make/mapfiles/libawt/mapfile-vers-linux
浏览文件 @
e6aa8195
...
@@ -270,7 +270,7 @@ SUNWprivate_1.1 {
...
@@ -270,7 +270,7 @@ SUNWprivate_1.1 {
getDefaultConfig;
getDefaultConfig;
Java_sun_font_FontConfigManager_getFontConfig;
Java_sun_font_FontConfigManager_getFontConfig;
Java_sun_font_FontConfigManager_getFontConfigAASettings;
Java_sun_font_FontConfigManager_getFontConfigAASettings;
Java_sun_awt_
X11
FontManager_getFontPathNative;
Java_sun_awt_
Fc
FontManager_getFontPathNative;
Java_sun_font_SunFontManager_populateFontFileNameMap;
Java_sun_font_SunFontManager_populateFontFileNameMap;
# CDE private entry point
# CDE private entry point
...
...
make/mapfiles/libawt_headless/mapfile-vers
浏览文件 @
e6aa8195
...
@@ -65,7 +65,7 @@ SUNWprivate_1.1 {
...
@@ -65,7 +65,7 @@ SUNWprivate_1.1 {
Java_sun_font_FontConfigManager_getFontConfig;
Java_sun_font_FontConfigManager_getFontConfig;
Java_sun_font_FontConfigManager_getFontConfigAASettings;
Java_sun_font_FontConfigManager_getFontConfigAASettings;
Java_sun_font_FontConfigManager_getFontConfigVersion;
Java_sun_font_FontConfigManager_getFontConfigVersion;
Java_sun_awt_
X11
FontManager_getFontPathNative;
Java_sun_awt_
Fc
FontManager_getFontPathNative;
Java_sun_awt_FontDescriptor_initIDs;
Java_sun_awt_FontDescriptor_initIDs;
Java_sun_awt_PlatformFont_initIDs;
Java_sun_awt_PlatformFont_initIDs;
...
...
make/mapfiles/libawt_xawt/mapfile-vers
浏览文件 @
e6aa8195
...
@@ -188,7 +188,7 @@ SUNWprivate_1.1 {
...
@@ -188,7 +188,7 @@ SUNWprivate_1.1 {
Java_sun_font_FontConfigManager_getFontConfig;
Java_sun_font_FontConfigManager_getFontConfig;
Java_sun_font_FontConfigManager_getFontConfigAASettings;
Java_sun_font_FontConfigManager_getFontConfigAASettings;
Java_sun_font_FontConfigManager_getFontConfigVersion;
Java_sun_font_FontConfigManager_getFontConfigVersion;
Java_sun_awt_
X11
FontManager_getFontPathNative;
Java_sun_awt_
Fc
FontManager_getFontPathNative;
Java_sun_awt_X11GraphicsEnvironment_initDisplay;
Java_sun_awt_X11GraphicsEnvironment_initDisplay;
Java_sun_awt_X11GraphicsEnvironment_initGLX;
Java_sun_awt_X11GraphicsEnvironment_initGLX;
Java_sun_awt_X11GraphicsEnvironment_initXRender;
Java_sun_awt_X11GraphicsEnvironment_initXRender;
...
...
src/solaris/classes/sun/awt/FcFontManager.java
0 → 100644
浏览文件 @
e6aa8195
/*
* Copyright (c) 2009, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package
sun.awt
;
import
sun.font.FcFontConfiguration
;
import
sun.font.FontConfigManager
;
import
sun.font.SunFontManager
;
/**
* A {@link sun.font.FontManager} that uses fontconfig to find system fonts.
*/
public
class
FcFontManager
extends
SunFontManager
{
private
FontConfigManager
fcManager
=
null
;
public
synchronized
FontConfigManager
getFontConfigManager
()
{
if
(
fcManager
==
null
)
{
fcManager
=
new
FontConfigManager
();
}
return
fcManager
;
}
@Override
protected
FontConfiguration
createFontConfiguration
()
{
FcFontConfiguration
fcFontConfig
=
new
FcFontConfiguration
(
this
);
if
(
fcFontConfig
.
init
())
{
return
fcFontConfig
;
}
else
{
throw
new
InternalError
(
"failed to initialize fontconfig"
);
}
}
@Override
public
FontConfiguration
createFontConfiguration
(
boolean
preferLocaleFonts
,
boolean
preferPropFonts
)
{
FcFontConfiguration
fcFontConfig
=
new
FcFontConfiguration
(
this
,
preferLocaleFonts
,
preferPropFonts
);
if
(
fcFontConfig
.
init
())
{
return
fcFontConfig
;
}
else
{
throw
new
InternalError
(
"failed to initialize fontconfig"
);
}
}
@Override
protected
String
[]
getDefaultPlatformFont
()
{
final
String
[]
info
=
new
String
[
2
];
getFontConfigManager
().
initFontConfigFonts
(
false
);
FontConfigManager
.
FcCompFont
[]
fontConfigFonts
=
getFontConfigManager
().
getFontConfigFonts
();
for
(
int
i
=
0
;
i
<
fontConfigFonts
.
length
;
i
++)
{
if
(
"sans"
.
equals
(
fontConfigFonts
[
i
].
fcFamily
)
&&
0
==
fontConfigFonts
[
i
].
style
)
{
info
[
0
]
=
fontConfigFonts
[
i
].
firstFont
.
familyName
;
info
[
1
]
=
fontConfigFonts
[
i
].
firstFont
.
fontFile
;
break
;
}
}
/* Absolute last ditch attempt in the face of fontconfig problems.
* If we didn't match, pick the first, or just make something
* up so we don't NPE.
*/
if
(
info
[
0
]
==
null
)
{
if
(
fontConfigFonts
.
length
>
0
&&
fontConfigFonts
[
0
].
firstFont
.
fontFile
!=
null
)
{
info
[
0
]
=
fontConfigFonts
[
0
].
firstFont
.
familyName
;
info
[
1
]
=
fontConfigFonts
[
0
].
firstFont
.
fontFile
;
}
else
{
info
[
0
]
=
"Dialog"
;
info
[
1
]
=
"/dialog.ttf"
;
}
}
return
info
;
}
protected
native
String
getFontPathNative
(
boolean
noType1Fonts
,
boolean
isX11GE
);
protected
synchronized
String
getFontPath
(
boolean
noType1Fonts
)
{
return
getFontPathNative
(
noType1Fonts
,
false
);
}
}
src/solaris/classes/sun/awt/X11FontManager.java
浏览文件 @
e6aa8195
...
@@ -54,7 +54,7 @@ import sun.util.logging.PlatformLogger;
...
@@ -54,7 +54,7 @@ import sun.util.logging.PlatformLogger;
/**
/**
* The X11 implementation of {@link FontManager}.
* The X11 implementation of {@link FontManager}.
*/
*/
public
final
class
X11FontManager
extends
Sun
FontManager
{
public
final
class
X11FontManager
extends
Fc
FontManager
{
// constants identifying XLFD and font ID fields
// constants identifying XLFD and font ID fields
private
static
final
int
FOUNDRY_FIELD
=
1
;
private
static
final
int
FOUNDRY_FIELD
=
1
;
...
@@ -154,8 +154,6 @@ public final class X11FontManager extends SunFontManager {
...
@@ -154,8 +154,6 @@ public final class X11FontManager extends SunFontManager {
*/
*/
private
static
String
[]
fontdirs
=
null
;
private
static
String
[]
fontdirs
=
null
;
private
FontConfigManager
fcManager
=
null
;
public
static
X11FontManager
getInstance
()
{
public
static
X11FontManager
getInstance
()
{
return
(
X11FontManager
)
SunFontManager
.
getInstance
();
return
(
X11FontManager
)
SunFontManager
.
getInstance
();
}
}
...
@@ -784,51 +782,9 @@ public final class X11FontManager extends SunFontManager {
...
@@ -784,51 +782,9 @@ public final class X11FontManager extends SunFontManager {
preferLocaleFonts
,
preferPropFonts
);
preferLocaleFonts
,
preferPropFonts
);
}
}
public
synchronized
native
String
getFontPathNative
(
boolean
noType1Fonts
);
protected
synchronized
String
getFontPath
(
boolean
noType1Fonts
)
{
protected
synchronized
String
getFontPath
(
boolean
noType1Fonts
)
{
isHeadless
();
// make sure GE is inited, as its the X11 lock.
isHeadless
();
// make sure GE is inited, as its the X11 lock.
return
getFontPathNative
(
noType1Fonts
);
return
getFontPathNative
(
noType1Fonts
,
true
);
}
@Override
protected
String
[]
getDefaultPlatformFont
()
{
final
String
[]
info
=
new
String
[
2
];
getFontConfigManager
().
initFontConfigFonts
(
false
);
FontConfigManager
.
FcCompFont
[]
fontConfigFonts
=
getFontConfigManager
().
getFontConfigFonts
();
for
(
int
i
=
0
;
i
<
fontConfigFonts
.
length
;
i
++)
{
if
(
"sans"
.
equals
(
fontConfigFonts
[
i
].
fcFamily
)
&&
0
==
fontConfigFonts
[
i
].
style
)
{
info
[
0
]
=
fontConfigFonts
[
i
].
firstFont
.
familyName
;
info
[
1
]
=
fontConfigFonts
[
i
].
firstFont
.
fontFile
;
break
;
}
}
/* Absolute last ditch attempt in the face of fontconfig problems.
* If we didn't match, pick the first, or just make something
* up so we don't NPE.
*/
if
(
info
[
0
]
==
null
)
{
if
(
fontConfigFonts
.
length
>
0
&&
fontConfigFonts
[
0
].
firstFont
.
fontFile
!=
null
)
{
info
[
0
]
=
fontConfigFonts
[
0
].
firstFont
.
familyName
;
info
[
1
]
=
fontConfigFonts
[
0
].
firstFont
.
fontFile
;
}
else
{
info
[
0
]
=
"Dialog"
;
info
[
1
]
=
"/dialog.ttf"
;
}
}
return
info
;
}
public
synchronized
FontConfigManager
getFontConfigManager
()
{
if
(
fcManager
==
null
)
{
fcManager
=
new
FontConfigManager
();
}
return
fcManager
;
}
}
@Override
@Override
...
...
src/solaris/classes/sun/font/FcFontConfiguration.java
浏览文件 @
e6aa8195
...
@@ -39,10 +39,10 @@ import java.util.HashMap;
...
@@ -39,10 +39,10 @@ import java.util.HashMap;
import
java.util.HashSet
;
import
java.util.HashSet
;
import
java.util.Properties
;
import
java.util.Properties
;
import
java.util.Scanner
;
import
java.util.Scanner
;
import
sun.awt.FcFontManager
;
import
sun.awt.FontConfiguration
;
import
sun.awt.FontConfiguration
;
import
sun.awt.FontDescriptor
;
import
sun.awt.FontDescriptor
;
import
sun.awt.SunToolkit
;
import
sun.awt.SunToolkit
;
import
sun.awt.X11FontManager
;
import
sun.font.CompositeFontDescriptor
;
import
sun.font.CompositeFontDescriptor
;
import
sun.font.FontManager
;
import
sun.font.FontManager
;
import
sun.font.FontConfigManager.FontConfigInfo
;
import
sun.font.FontConfigManager.FontConfigInfo
;
...
@@ -92,7 +92,7 @@ public class FcFontConfiguration extends FontConfiguration {
...
@@ -92,7 +92,7 @@ public class FcFontConfiguration extends FontConfiguration {
setFontConfiguration
();
setFontConfiguration
();
readFcInfo
();
readFcInfo
();
X11FontManager
fm
=
(
X11
FontManager
)
fontManager
;
FcFontManager
fm
=
(
Fc
FontManager
)
fontManager
;
FontConfigManager
fcm
=
fm
.
getFontConfigManager
();
FontConfigManager
fcm
=
fm
.
getFontConfigManager
();
if
(
fcCompFonts
==
null
)
{
if
(
fcCompFonts
==
null
)
{
fcCompFonts
=
fcm
.
loadFontConfig
();
fcCompFonts
=
fcm
.
loadFontConfig
();
...
@@ -194,7 +194,7 @@ public class FcFontConfiguration extends FontConfiguration {
...
@@ -194,7 +194,7 @@ public class FcFontConfiguration extends FontConfiguration {
@Override
@Override
public
String
[]
getPlatformFontNames
()
{
public
String
[]
getPlatformFontNames
()
{
HashSet
<
String
>
nameSet
=
new
HashSet
<
String
>();
HashSet
<
String
>
nameSet
=
new
HashSet
<
String
>();
X11FontManager
fm
=
(
X11
FontManager
)
fontManager
;
FcFontManager
fm
=
(
Fc
FontManager
)
fontManager
;
FontConfigManager
fcm
=
fm
.
getFontConfigManager
();
FontConfigManager
fcm
=
fm
.
getFontConfigManager
();
FcCompFont
[]
fcCompFonts
=
fcm
.
loadFontConfig
();
FcCompFont
[]
fcCompFonts
=
fcm
.
loadFontConfig
();
for
(
int
i
=
0
;
i
<
fcCompFonts
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
fcCompFonts
.
length
;
i
++)
{
...
@@ -235,7 +235,7 @@ public class FcFontConfiguration extends FontConfiguration {
...
@@ -235,7 +235,7 @@ public class FcFontConfiguration extends FontConfiguration {
@Override
@Override
public
CompositeFontDescriptor
[]
get2DCompositeFontInfo
()
{
public
CompositeFontDescriptor
[]
get2DCompositeFontInfo
()
{
X11FontManager
fm
=
(
X11
FontManager
)
fontManager
;
FcFontManager
fm
=
(
Fc
FontManager
)
fontManager
;
FontConfigManager
fcm
=
fm
.
getFontConfigManager
();
FontConfigManager
fcm
=
fm
.
getFontConfigManager
();
FcCompFont
[]
fcCompFonts
=
fcm
.
loadFontConfig
();
FcCompFont
[]
fcCompFonts
=
fcm
.
loadFontConfig
();
...
@@ -368,7 +368,7 @@ public class FcFontConfiguration extends FontConfiguration {
...
@@ -368,7 +368,7 @@ public class FcFontConfiguration extends FontConfiguration {
private
void
writeFcInfo
()
{
private
void
writeFcInfo
()
{
Properties
props
=
new
Properties
();
Properties
props
=
new
Properties
();
props
.
setProperty
(
"version"
,
fileVersion
);
props
.
setProperty
(
"version"
,
fileVersion
);
X11FontManager
fm
=
(
X11
FontManager
)
fontManager
;
FcFontManager
fm
=
(
Fc
FontManager
)
fontManager
;
FontConfigManager
fcm
=
fm
.
getFontConfigManager
();
FontConfigManager
fcm
=
fm
.
getFontConfigManager
();
FontConfigInfo
fcInfo
=
fcm
.
getFontConfigInfo
();
FontConfigInfo
fcInfo
=
fcm
.
getFontConfigInfo
();
props
.
setProperty
(
"fcversion"
,
Integer
.
toString
(
fcInfo
.
fcVersion
));
props
.
setProperty
(
"fcversion"
,
Integer
.
toString
(
fcInfo
.
fcVersion
));
...
@@ -427,7 +427,7 @@ public class FcFontConfiguration extends FontConfiguration {
...
@@ -427,7 +427,7 @@ public class FcFontConfiguration extends FontConfiguration {
return
;
return
;
}
}
Properties
props
=
new
Properties
();
Properties
props
=
new
Properties
();
X11FontManager
fm
=
(
X11
FontManager
)
fontManager
;
FcFontManager
fm
=
(
Fc
FontManager
)
fontManager
;
FontConfigManager
fcm
=
fm
.
getFontConfigManager
();
FontConfigManager
fcm
=
fm
.
getFontConfigManager
();
try
{
try
{
FileInputStream
fis
=
new
FileInputStream
(
fcFile
);
FileInputStream
fis
=
new
FileInputStream
(
fcFile
);
...
...
src/solaris/native/sun/awt/fontpath.c
浏览文件 @
e6aa8195
...
@@ -497,7 +497,7 @@ static char* mergePaths(char **p1, char **p2, char **p3, jboolean noType1) {
...
@@ -497,7 +497,7 @@ static char* mergePaths(char **p1, char **p2, char **p3, jboolean noType1) {
* This also frees us from X11 APIs as JRE is required to function in
* This also frees us from X11 APIs as JRE is required to function in
* a "headless" mode where there is no Xserver.
* a "headless" mode where there is no Xserver.
*/
*/
static
char
*
getPlatformFontPathChars
(
JNIEnv
*
env
,
jboolean
noType1
)
{
static
char
*
getPlatformFontPathChars
(
JNIEnv
*
env
,
jboolean
noType1
,
jboolean
isX11
)
{
char
**
fcdirs
=
NULL
,
**
x11dirs
=
NULL
,
**
knowndirs
=
NULL
,
*
path
=
NULL
;
char
**
fcdirs
=
NULL
,
**
x11dirs
=
NULL
,
**
knowndirs
=
NULL
,
*
path
=
NULL
;
...
@@ -519,6 +519,7 @@ static char *getPlatformFontPathChars(JNIEnv *env, jboolean noType1) {
...
@@ -519,6 +519,7 @@ static char *getPlatformFontPathChars(JNIEnv *env, jboolean noType1) {
* be initialised.
* be initialised.
*/
*/
#ifndef HEADLESS
#ifndef HEADLESS
if
(
isX11
)
{
// The following only works in an x11 environment.
#if defined(__linux__)
#if defined(__linux__)
/* There's no headless build on linux ... */
/* There's no headless build on linux ... */
if
(
!
AWTIsHeadless
())
{
/* .. so need to call a function to check */
if
(
!
AWTIsHeadless
())
{
/* .. so need to call a function to check */
...
@@ -538,6 +539,7 @@ static char *getPlatformFontPathChars(JNIEnv *env, jboolean noType1) {
...
@@ -538,6 +539,7 @@ static char *getPlatformFontPathChars(JNIEnv *env, jboolean noType1) {
#if defined(__linux__)
#if defined(__linux__)
}
}
#endif
#endif
}
#endif
/* !HEADLESS */
#endif
/* !HEADLESS */
path
=
mergePaths
(
fcdirs
,
x11dirs
,
knowndirs
,
noType1
);
path
=
mergePaths
(
fcdirs
,
x11dirs
,
knowndirs
,
noType1
);
if
(
fcdirs
!=
NULL
)
{
if
(
fcdirs
!=
NULL
)
{
...
@@ -555,13 +557,13 @@ static char *getPlatformFontPathChars(JNIEnv *env, jboolean noType1) {
...
@@ -555,13 +557,13 @@ static char *getPlatformFontPathChars(JNIEnv *env, jboolean noType1) {
return
path
;
return
path
;
}
}
JNIEXPORT
jstring
JNICALL
Java_sun_awt_
X11
FontManager_getFontPathNative
JNIEXPORT
jstring
JNICALL
Java_sun_awt_
Fc
FontManager_getFontPathNative
(
JNIEnv
*
env
,
jobject
thiz
,
jboolean
noType1
)
{
(
JNIEnv
*
env
,
jobject
thiz
,
jboolean
noType1
,
jboolean
isX11
)
{
jstring
ret
;
jstring
ret
;
static
char
*
ptr
=
NULL
;
/* retain result across calls */
static
char
*
ptr
=
NULL
;
/* retain result across calls */
if
(
ptr
==
NULL
)
{
if
(
ptr
==
NULL
)
{
ptr
=
getPlatformFontPathChars
(
env
,
noType1
);
ptr
=
getPlatformFontPathChars
(
env
,
noType1
,
isX11
);
}
}
ret
=
(
*
env
)
->
NewStringUTF
(
env
,
ptr
);
ret
=
(
*
env
)
->
NewStringUTF
(
env
,
ptr
);
return
ret
;
return
ret
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录