Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
1e6412b1
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
3
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看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
1e6412b1
编写于
8月 04, 2008
作者:
I
igor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
4356282: RFE: T2K should be used to rasterize CID/CFF fonts
Reviewed-by: bae, prr
上级
6c7a0295
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
42 addition
and
50 deletion
+42
-50
src/share/classes/sun/font/FontManager.java
src/share/classes/sun/font/FontManager.java
+1
-1
src/share/classes/sun/font/TrueTypeFont.java
src/share/classes/sun/font/TrueTypeFont.java
+2
-0
src/share/classes/sun/java2d/SunGraphicsEnvironment.java
src/share/classes/sun/java2d/SunGraphicsEnvironment.java
+8
-26
src/windows/native/sun/font/fontpath.c
src/windows/native/sun/font/fontpath.c
+31
-23
未找到文件。
src/share/classes/sun/font/FontManager.java
浏览文件 @
1e6412b1
...
...
@@ -3344,7 +3344,7 @@ public final class FontManager {
int
fontFormat
=
FONTFORMAT_NONE
;
int
fontRank
=
Font2D
.
UNKNOWN_RANK
;
if
(
ext
.
equals
(
".ttf"
)
||
isTTC
)
{
if
(
ext
.
equals
(
".ttf"
)
||
ext
.
equals
(
".otf"
)
||
isTTC
)
{
fontFormat
=
FONTFORMAT_TRUETYPE
;
fontRank
=
Font2D
.
TTF_RANK
;
}
else
if
(
ext
.
equals
(
".pfa"
)
||
ext
.
equals
(
".pfb"
))
{
...
...
src/share/classes/sun/font/TrueTypeFont.java
浏览文件 @
1e6412b1
...
...
@@ -90,6 +90,7 @@ public class TrueTypeFont extends FileFont {
public
static
final
int
ttcfTag
=
0x74746366
;
// 'ttcf' - TTC file
public
static
final
int
v1ttTag
=
0x00010000
;
// 'v1tt' - Version 1 TT font
public
static
final
int
trueTag
=
0x74727565
;
// 'true' - Version 2 TT font
public
static
final
int
ottoTag
=
0x4f54544f
;
// 'otto' - OpenType font
/* -- ID's used in the 'name' table */
public
static
final
int
MS_PLATFORM_ID
=
3
;
...
...
@@ -490,6 +491,7 @@ public class TrueTypeFont extends FileFont {
case
v1ttTag:
case
trueTag:
case
ottoTag:
break
;
default
:
...
...
src/share/classes/sun/java2d/SunGraphicsEnvironment.java
浏览文件 @
1e6412b1
...
...
@@ -812,7 +812,9 @@ public abstract class SunGraphicsEnvironment extends GraphicsEnvironment
return
(
name
.
startsWith
(
".ttf"
,
offset
)
||
name
.
startsWith
(
".TTF"
,
offset
)
||
name
.
startsWith
(
".ttc"
,
offset
)
||
name
.
startsWith
(
".TTC"
,
offset
));
name
.
startsWith
(
".TTC"
,
offset
)
||
name
.
startsWith
(
".otf"
,
offset
)
||
name
.
startsWith
(
".OTF"
,
offset
));
}
}
}
...
...
@@ -835,31 +837,11 @@ public abstract class SunGraphicsEnvironment extends GraphicsEnvironment
}
}
public
static
class
TTorT1Filter
implements
FilenameFilter
{
public
boolean
accept
(
File
dir
,
String
name
)
{
/* all conveniently have the same suffix length */
int
offset
=
name
.
length
()-
4
;
if
(
offset
<=
0
)
{
/* must be at least A.ttf or A.pfa */
return
false
;
}
else
{
boolean
isTT
=
name
.
startsWith
(
".ttf"
,
offset
)
||
name
.
startsWith
(
".TTF"
,
offset
)
||
name
.
startsWith
(
".ttc"
,
offset
)
||
name
.
startsWith
(
".TTC"
,
offset
);
if
(
isTT
)
{
return
true
;
}
else
if
(
noType1Font
)
{
return
false
;
}
else
{
return
(
name
.
startsWith
(
".pfa"
,
offset
)
||
name
.
startsWith
(
".pfb"
,
offset
)
||
name
.
startsWith
(
".PFA"
,
offset
)
||
name
.
startsWith
(
".PFB"
,
offset
));
}
}
}
public
static
class
TTorT1Filter
implements
FilenameFilter
{
public
boolean
accept
(
File
dir
,
String
name
)
{
return
SunGraphicsEnvironment
.
ttFilter
.
accept
(
dir
,
name
)
||
SunGraphicsEnvironment
.
t1Filter
.
accept
(
dir
,
name
);
}
}
/* No need to keep consing up new instances - reuse a singleton.
...
...
src/windows/native/sun/font/fontpath.c
浏览文件 @
1e6412b1
...
...
@@ -153,7 +153,8 @@ static int CALLBACK EnumFontFacesInFamilyProcA(
JNIEnv
*
env
=
fmi
->
env
;
jstring
fullname
,
fullnameLC
;
if
(
FontType
!=
TRUETYPE_FONTTYPE
)
{
/* Both Vista and XP return DEVICE_FONTTYPE for OTF fonts */
if
(
FontType
!=
TRUETYPE_FONTTYPE
&&
FontType
!=
DEVICE_FONTTYPE
)
{
return
1
;
}
...
...
@@ -227,7 +228,8 @@ static int CALLBACK EnumFontFacesInFamilyProcW(
JNIEnv
*
env
=
fmi
->
env
;
jstring
fullname
,
fullnameLC
;
if
(
FontType
!=
TRUETYPE_FONTTYPE
)
{
/* Both Vista and XP return DEVICE_FONTTYPE for OTF fonts */
if
(
FontType
!=
TRUETYPE_FONTTYPE
&&
FontType
!=
DEVICE_FONTTYPE
)
{
return
1
;
}
...
...
@@ -274,7 +276,8 @@ static int CALLBACK EnumFamilyNamesA(
jstring
familyLC
;
LOGFONTA
lfa
;
if
(
FontType
!=
TRUETYPE_FONTTYPE
)
{
/* Both Vista and XP return DEVICE_FONTTYPE for OTF fonts */
if
(
FontType
!=
TRUETYPE_FONTTYPE
&&
FontType
!=
DEVICE_FONTTYPE
)
{
return
1
;
}
...
...
@@ -323,7 +326,8 @@ static int CALLBACK EnumFamilyNamesW(
int
slen
;
LOGFONTW
lfw
;
if
(
FontType
!=
TRUETYPE_FONTTYPE
)
{
/* Both Vista and XP return DEVICE_FONTTYPE for OTF fonts */
if
(
FontType
!=
TRUETYPE_FONTTYPE
&&
FontType
!=
DEVICE_FONTTYPE
)
{
return
1
;
}
/* wprintf(L"FAMILY=%s charset=%d FULL=%s\n", */
...
...
@@ -383,15 +387,16 @@ static int CALLBACK EnumFamilyNamesW(
* Also if a Font has a name for this locale that name also
* exists in the registry using the appropriate platform encoding.
* What do we do then?
*
* Note: OpenType fonts seems to have " (TrueType)" suffix on Vista
* but " (OpenType)" on XP.
*/
/* static const wchar_t W_TTSUFFIX[] = L" (TrueType)"; */
/* static const char C_TTSUFFIX[] = " (TrueType)"; */
/* static int TTSLEN = 11; hard-coded - be careful */
static
BOOL
RegistryToBaseTTNameA
(
LPCSTR
name
)
{
static
BOOL
RegistryToBaseTTNameA
(
LPSTR
name
)
{
static
const
char
TTSUFFIX
[]
=
" (TrueType)"
;
static
const
char
OTSUFFIX
[]
=
" (OpenType)"
;
int
TTSLEN
=
strlen
(
TTSUFFIX
);
char
*
match
;
char
*
suffix
;
int
len
=
strlen
(
name
);
if
(
len
==
0
)
{
...
...
@@ -403,19 +408,21 @@ static BOOL RegistryToBaseTTNameA(LPCSTR name) {
if
(
len
<=
TTSLEN
)
{
return
FALSE
;
}
match
=
strstr
(
name
,
TTSUFFIX
);
if
((
match
!=
NULL
)
&&
(
match
==
name
+
(
len
-
TTSLEN
)))
{
match
[
0
]
=
'\0'
;
/* truncate name */
/* suffix length is the same for truetype and opentype fonts */
suffix
=
name
+
len
-
TTSLEN
;
if
(
strcmp
(
suffix
,
TTSUFFIX
)
==
0
||
strcmp
(
suffix
,
OTSUFFIX
)
==
0
)
{
suffix
[
0
]
=
'\0'
;
/* truncate name */
return
TRUE
;
}
else
{
return
FALSE
;
}
return
FALSE
;
}
static
BOOL
RegistryToBaseTTNameW
(
LPWSTR
name
)
{
static
const
wchar_t
TTSUFFIX
[]
=
L" (TrueType)"
;
static
const
wchar_t
OTSUFFIX
[]
=
L" (OpenType)"
;
int
TTSLEN
=
wcslen
(
TTSUFFIX
);
wchar_t
*
match
;
wchar_t
*
suffix
;
int
len
=
wcslen
(
name
);
if
(
len
==
0
)
{
...
...
@@ -427,13 +434,13 @@ static BOOL RegistryToBaseTTNameW(LPWSTR name) {
if
(
len
<=
TTSLEN
)
{
return
FALSE
;
}
match
=
wcsstr
(
name
,
TTSUFFIX
);
if
((
match
!=
NULL
)
&&
(
match
==
name
+
(
len
-
TTSLEN
)))
{
match
[
0
]
=
L'\0'
;
/* truncate name */
/* suffix length is the same for truetype and opentype fonts */
suffix
=
name
+
(
len
-
TTSLEN
);
if
(
wcscmp
(
suffix
,
TTSUFFIX
)
==
0
||
wcscmp
(
suffix
,
OTSUFFIX
)
==
0
)
{
suffix
[
0
]
=
L'\0'
;
/* truncate name */
return
TRUE
;
}
else
{
return
FALSE
;
}
return
FALSE
;
}
static
void
registerFontA
(
GdiFontMapInfo
*
fmi
,
jobject
fontToFileMap
,
...
...
@@ -675,18 +682,19 @@ Java_sun_font_FontManager_populateFontFileNameMap
}
if
(
IS_NT
)
{
if
(
!
RegistryToBaseTTNameW
((
LPWSTR
)
wname
)
)
{
/* If the filename ends with ".ttf" also accept it.
/* If the filename ends with ".ttf"
or ".otf"
also accept it.
* Not expecting to need to do this for .ttc files.
* Also note this code is not mirrored in the "A" (win9x) path.
*/
LPWSTR
dot
=
wcsrchr
((
LPWSTR
)
data
,
L'.'
);
if
(
dot
==
NULL
||
(
wcsicmp
(
dot
,
L".ttf"
)
!=
0
))
{
if
(
dot
==
NULL
||
((
wcsicmp
(
dot
,
L".ttf"
)
!=
0
)
&&
(
wcsicmp
(
dot
,
L".otf"
)
!=
0
)))
{
continue
;
/* not a TT font... */
}
}
registerFontW
(
&
fmi
,
fontToFileMap
,
(
LPWSTR
)
wname
,
(
LPWSTR
)
data
);
}
else
{
if
(
!
RegistryToBaseTTNameA
(
cname
)
)
{
if
(
!
RegistryToBaseTTNameA
(
(
LPSTR
)
cname
)
)
{
continue
;
/* not a TT font... */
}
registerFontA
(
&
fmi
,
fontToFileMap
,
cname
,
(
LPCSTR
)
data
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录