Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
c164e778
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看板
提交
c164e778
编写于
9月 23, 2014
作者:
Y
ysuenaga
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8017773: OpenJDK7 returns incorrect TrueType font metrics
Reviewed-by: prr, bae
上级
9343a200
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
19 deletion
+13
-19
src/share/native/sun/font/freetypeScaler.c
src/share/native/sun/font/freetypeScaler.c
+13
-19
未找到文件。
src/share/native/sun/font/freetypeScaler.c
浏览文件 @
c164e778
...
...
@@ -411,7 +411,6 @@ Java_sun_font_FreetypeFontScaler_getFontMetricsNative(
jobject
metrics
;
jfloat
ax
,
ay
,
dx
,
dy
,
bx
,
by
,
lx
,
ly
,
mx
,
my
;
jfloat
f0
=
0
.
0
;
FT_Pos
bmodifier
=
0
;
FTScalerContext
*
context
=
(
FTScalerContext
*
)
jlong_to_ptr
(
pScalerContext
);
FTScalerInfo
*
scalerInfo
=
...
...
@@ -444,43 +443,38 @@ Java_sun_font_FreetypeFontScaler_getFontMetricsNative(
So, we have to do adust them explicitly and stay consistent with what
freetype does to outlines. */
/* For bolding glyphs are not just widened. Height is also changed
(see ftsynth.c).
TODO: In vertical direction we could do better job and adjust metrics
proportionally to glyoh shape. */
if
(
context
->
doBold
)
{
bmodifier
=
FT_MulFix
(
scalerInfo
->
face
->
units_per_EM
,
scalerInfo
->
face
->
size
->
metrics
.
y_scale
)
/
24
;
}
/**** Note: only some metrics are affected by styling ***/
/* See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=657854 */
#define FT_MulFixFloatShift6(a, b) (((float) (a)) * ((float) (b)) / 65536.0 / 64.0)
/*
* See FreeType source code: src/base/ftobjs.c ft_recompute_scaled_metrics()
* http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1659
*/
/* ascent */
ax
=
0
;
ay
=
-
(
jfloat
)
FT26Dot6ToFloat
(
FT_MulFix
(
((
jlong
)
scalerInfo
->
face
->
ascender
+
bmodifier
/
2
),
ay
=
-
(
jfloat
)
(
FT_MulFixFloatShift6
(
((
jlong
)
scalerInfo
->
face
->
ascender
),
(
jlong
)
scalerInfo
->
face
->
size
->
metrics
.
y_scale
));
/* descent */
dx
=
0
;
dy
=
-
(
jfloat
)
FT26Dot6ToFloat
(
FT_MulFix
(
((
jlong
)
scalerInfo
->
face
->
descender
+
bmodifier
/
2
),
dy
=
-
(
jfloat
)
(
FT_MulFixFloatShift6
(
((
jlong
)
scalerInfo
->
face
->
descender
),
(
jlong
)
scalerInfo
->
face
->
size
->
metrics
.
y_scale
));
/* baseline */
bx
=
by
=
0
;
/* leading */
lx
=
0
;
ly
=
(
jfloat
)
FT26Dot6ToFloat
(
FT_MulFix
(
(
jlong
)
scalerInfo
->
face
->
height
+
bmodifier
,
ly
=
(
jfloat
)
(
FT_MulFixFloatShift6
(
(
jlong
)
scalerInfo
->
face
->
height
,
(
jlong
)
scalerInfo
->
face
->
size
->
metrics
.
y_scale
))
+
ay
-
dy
;
/* max advance */
mx
=
(
jfloat
)
FT26Dot6ToFloat
(
scalerInfo
->
face
->
size
->
metrics
.
max_advance
+
2
*
bmodifier
+
OBLIQUE_MODIFIER
(
scalerInfo
->
face
->
size
->
metrics
.
height
));
my
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录