Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
63d646fb
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
11 个月 前同步成功
通知
0
Star
18
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Harfbuzz
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
63d646fb
编写于
5月 11, 2011
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[font] Do user-space conversion when chaining up to parent font
上级
b6f902a1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
45 addition
and
6 deletion
+45
-6
src/hb-font-private.hh
src/hb-font-private.hh
+28
-0
src/hb-font.cc
src/hb-font.cc
+17
-6
未找到文件。
src/hb-font-private.hh
浏览文件 @
63d646fb
...
...
@@ -118,6 +118,34 @@ struct _hb_font_t {
inline
hb_position_t
em_scale_x
(
int16_t
v
)
{
return
em_scale
(
v
,
this
->
x_scale
);
}
inline
hb_position_t
em_scale_y
(
int16_t
v
)
{
return
em_scale
(
v
,
this
->
y_scale
);
}
/* Convert from parent-font user-space to our user-space */
inline
hb_position_t
parent_scale_x_distance
(
hb_position_t
v
)
{
if
(
unlikely
(
parent
&&
parent
->
x_scale
!=
x_scale
))
return
v
*
(
int64_t
)
this
->
x_scale
/
this
->
parent
->
x_scale
;
return
v
;
}
inline
hb_position_t
parent_scale_y_distance
(
hb_position_t
v
)
{
if
(
unlikely
(
parent
&&
parent
->
y_scale
!=
y_scale
))
return
v
*
(
int64_t
)
this
->
y_scale
/
this
->
parent
->
y_scale
;
return
v
;
}
inline
hb_position_t
parent_scale_x_position
(
hb_position_t
v
)
{
return
parent_scale_x_distance
(
v
);
/* We don't have translation right now */
}
inline
hb_position_t
parent_scale_y_position
(
hb_position_t
v
)
{
return
parent_scale_y_distance
(
v
);
/* We don't have translation right now */
}
inline
void
parent_scale_distance
(
hb_position_t
*
x
,
hb_position_t
*
y
)
{
*
x
=
parent_scale_x_distance
(
*
x
);
*
y
=
parent_scale_y_distance
(
*
y
);
}
inline
void
parent_scale_position
(
hb_position_t
*
x
,
hb_position_t
*
y
)
{
*
x
=
parent_scale_x_position
(
*
x
);
*
y
=
parent_scale_y_position
(
*
y
);
}
private:
inline
hb_position_t
em_scale
(
int16_t
v
,
int
scale
)
{
return
v
*
(
int64_t
)
scale
/
this
->
face
->
upem
;
}
};
...
...
src/hb-font.cc
浏览文件 @
63d646fb
...
...
@@ -50,10 +50,14 @@ hb_font_get_contour_point_nil (hb_font_t *font HB_UNUSED,
hb_position_t
*
y
HB_UNUSED
,
const
void
*
user_data
HB_UNUSED
)
{
if
(
font
->
parent
)
return
hb_font_get_contour_point
(
font
->
parent
,
point_index
,
glyph
,
x
,
y
);
if
(
font
->
parent
)
{
hb_bool_t
ret
;
ret
=
hb_font_get_contour_point
(
font
->
parent
,
point_index
,
glyph
,
x
,
y
);
font
->
parent_scale_position
(
x
,
y
);
return
ret
;
}
*
x
=
*
y
=
0
;
...
...
@@ -70,6 +74,7 @@ hb_font_get_glyph_advance_nil (hb_font_t *font HB_UNUSED,
{
if
(
font
->
parent
)
{
hb_font_get_glyph_advance
(
font
->
parent
,
glyph
,
x_advance
,
y_advance
);
font
->
parent_scale_distance
(
x_advance
,
y_advance
);
return
;
}
...
...
@@ -85,6 +90,8 @@ hb_font_get_glyph_extents_nil (hb_font_t *font HB_UNUSED,
{
if
(
font
->
parent
)
{
hb_font_get_glyph_extents
(
font
->
parent
,
glyph
,
extents
);
font
->
parent_scale_position
(
&
extents
->
x_bearing
,
&
extents
->
y_bearing
);
font
->
parent_scale_distance
(
&
extents
->
width
,
&
extents
->
height
);
return
;
}
...
...
@@ -112,8 +119,12 @@ hb_font_get_kerning_nil (hb_font_t *font HB_UNUSED,
hb_codepoint_t
second_glyph
HB_UNUSED
,
const
void
*
user_data
HB_UNUSED
)
{
if
(
font
->
parent
)
return
hb_font_get_kerning
(
font
->
parent
,
first_glyph
,
second_glyph
);
if
(
font
->
parent
)
{
hb_position_t
ret
;
ret
=
hb_font_get_kerning
(
font
->
parent
,
first_glyph
,
second_glyph
);
ret
=
font
->
parent_scale_x_distance
(
ret
);
return
ret
;
}
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录