Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
c03f0ca7
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看板
提交
c03f0ca7
编写于
1月 27, 2020
作者:
D
dbatrak
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8236996: Incorrect Roboto font rendering on Windows with subpixel antialiasing
Reviewed-by: prr, serb
上级
d2ad3716
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
35 addition
and
3 deletion
+35
-3
src/share/classes/sun/font/FileFontStrike.java
src/share/classes/sun/font/FileFontStrike.java
+10
-2
src/share/classes/sun/font/TrueTypeFont.java
src/share/classes/sun/font/TrueTypeFont.java
+11
-0
src/windows/native/sun/font/lcdglyph.c
src/windows/native/sun/font/lcdglyph.c
+14
-1
未找到文件。
src/share/classes/sun/font/FileFontStrike.java
浏览文件 @
c03f0ca7
...
@@ -328,7 +328,8 @@ public class FileFontStrike extends PhysicalStrike {
...
@@ -328,7 +328,8 @@ public class FileFontStrike extends PhysicalStrike {
int
style
,
int
style
,
int
size
,
int
size
,
int
glyphCode
,
int
glyphCode
,
boolean
fracMetrics
);
boolean
fracMetrics
,
int
fontDataSize
);
long
getGlyphImageFromWindows
(
int
glyphCode
)
{
long
getGlyphImageFromWindows
(
int
glyphCode
)
{
String
family
=
fileFont
.
getFamilyName
(
null
);
String
family
=
fileFont
.
getFamilyName
(
null
);
...
@@ -337,7 +338,8 @@ public class FileFontStrike extends PhysicalStrike {
...
@@ -337,7 +338,8 @@ public class FileFontStrike extends PhysicalStrike {
int
size
=
intPtSize
;
int
size
=
intPtSize
;
long
ptr
=
_getGlyphImageFromWindows
long
ptr
=
_getGlyphImageFromWindows
(
family
,
style
,
size
,
glyphCode
,
(
family
,
style
,
size
,
glyphCode
,
desc
.
fmHint
==
INTVAL_FRACTIONALMETRICS_ON
);
desc
.
fmHint
==
INTVAL_FRACTIONALMETRICS_ON
,
((
TrueTypeFont
)
fileFont
).
fontDataSize
);
if
(
ptr
!=
0
)
{
if
(
ptr
!=
0
)
{
/* Get the advance from the JDK rasterizer. This is mostly
/* Get the advance from the JDK rasterizer. This is mostly
* necessary for the fractional metrics case, but there are
* necessary for the fractional metrics case, but there are
...
@@ -351,6 +353,12 @@ public class FileFontStrike extends PhysicalStrike {
...
@@ -351,6 +353,12 @@ public class FileFontStrike extends PhysicalStrike {
advance
);
advance
);
return
ptr
;
return
ptr
;
}
else
{
}
else
{
if
(
FontUtilities
.
isLogging
())
{
FontUtilities
.
getLogger
().
warning
(
"Failed to render glyph using GDI: code="
+
glyphCode
+
", fontFamily="
+
family
+
", style="
+
style
+
", size="
+
size
);
}
return
fileFont
.
getGlyphImage
(
pScalerContext
,
glyphCode
);
return
fileFont
.
getGlyphImage
(
pScalerContext
,
glyphCode
);
}
}
}
}
...
...
src/share/classes/sun/font/TrueTypeFont.java
浏览文件 @
c03f0ca7
...
@@ -172,6 +172,15 @@ public class TrueTypeFont extends FileFont {
...
@@ -172,6 +172,15 @@ public class TrueTypeFont extends FileFont {
private
String
localeFamilyName
;
private
String
localeFamilyName
;
private
String
localeFullName
;
private
String
localeFullName
;
/*
* Used on Windows to validate the font selected by GDI for (sub-pixel
* antialiased) rendering. For 'standalone' fonts it's equal to the font
* file size, for collection (TTC, OTC) members it's the number of bytes in
* the collection file from the start of this font's offset table till the
* end of the file.
*/
int
fontDataSize
;
public
TrueTypeFont
(
String
platname
,
Object
nativeNames
,
int
fIndex
,
public
TrueTypeFont
(
String
platname
,
Object
nativeNames
,
int
fIndex
,
boolean
javaRasterizer
)
boolean
javaRasterizer
)
throws
FontFormatException
throws
FontFormatException
...
@@ -529,11 +538,13 @@ public class TrueTypeFont extends FileFont {
...
@@ -529,11 +538,13 @@ public class TrueTypeFont extends FileFont {
fontIndex
=
fIndex
;
fontIndex
=
fIndex
;
buffer
=
readBlock
(
TTCHEADERSIZE
+
4
*
fIndex
,
4
);
buffer
=
readBlock
(
TTCHEADERSIZE
+
4
*
fIndex
,
4
);
headerOffset
=
buffer
.
getInt
();
headerOffset
=
buffer
.
getInt
();
fontDataSize
=
Math
.
max
(
0
,
fileSize
-
headerOffset
);
break
;
break
;
case
v1ttTag:
case
v1ttTag:
case
trueTag:
case
trueTag:
case
ottoTag:
case
ottoTag:
fontDataSize
=
fileSize
;
break
;
break
;
default
:
default
:
...
...
src/windows/native/sun/font/lcdglyph.c
浏览文件 @
c03f0ca7
...
@@ -172,7 +172,8 @@ JNIEXPORT jboolean JNICALL
...
@@ -172,7 +172,8 @@ JNIEXPORT jboolean JNICALL
JNIEXPORT
jlong
JNICALL
JNIEXPORT
jlong
JNICALL
Java_sun_font_FileFontStrike__1getGlyphImageFromWindows
Java_sun_font_FileFontStrike__1getGlyphImageFromWindows
(
JNIEnv
*
env
,
jobject
unused
,
(
JNIEnv
*
env
,
jobject
unused
,
jstring
fontFamily
,
jint
style
,
jint
size
,
jint
glyphCode
,
jboolean
fm
)
{
jstring
fontFamily
,
jint
style
,
jint
size
,
jint
glyphCode
,
jboolean
fm
,
jint
fontDataSize
)
{
GLYPHMETRICS
glyphMetrics
;
GLYPHMETRICS
glyphMetrics
;
LOGFONTW
lf
;
LOGFONTW
lf
;
...
@@ -188,6 +189,7 @@ Java_sun_font_FileFontStrike__1getGlyphImageFromWindows
...
@@ -188,6 +189,7 @@ Java_sun_font_FileFontStrike__1getGlyphImageFromWindows
LPWSTR
name
;
LPWSTR
name
;
HFONT
oldFont
,
hFont
;
HFONT
oldFont
,
hFont
;
MAT2
mat2
;
MAT2
mat2
;
DWORD
actualFontDataSize
;
unsigned
short
width
;
unsigned
short
width
;
unsigned
short
height
;
unsigned
short
height
;
...
@@ -254,6 +256,17 @@ Java_sun_font_FileFontStrike__1getGlyphImageFromWindows
...
@@ -254,6 +256,17 @@ Java_sun_font_FileFontStrike__1getGlyphImageFromWindows
}
}
oldFont
=
SelectObject
(
hMemoryDC
,
hFont
);
oldFont
=
SelectObject
(
hMemoryDC
,
hFont
);
if
(
fontDataSize
>
0
)
{
// GDI doesn't allow to select a specific font file for drawing, we can
// only check that it picks the file we need by validating font size.
// If it doesn't match, we cannot proceed, as the same glyph code can
// correspond to a completely different glyph in the selected font.
actualFontDataSize
=
GetFontData
(
hMemoryDC
,
0
,
0
,
NULL
,
0
);
if
(
actualFontDataSize
!=
fontDataSize
)
{
FREE_AND_RETURN
;
}
}
tmpBitmap
=
CreateCompatibleBitmap
(
hDesktopDC
,
1
,
1
);
tmpBitmap
=
CreateCompatibleBitmap
(
hDesktopDC
,
1
,
1
);
if
(
tmpBitmap
==
NULL
)
{
if
(
tmpBitmap
==
NULL
)
{
FREE_AND_RETURN
;
FREE_AND_RETURN
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录