Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
9533364c
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
1 年多 前同步成功
通知
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看板
提交
9533364c
编写于
8月 01, 2018
作者:
K
Koji Ishii
提交者:
Behdad Esfahbod
8月 06, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
batchwidth
上级
b912fbea
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
67 addition
and
2 deletion
+67
-2
src/hb-font-private.hh
src/hb-font-private.hh
+13
-0
src/hb-font.cc
src/hb-font.cc
+37
-0
src/hb-font.h
src/hb-font.h
+15
-0
src/hb-ot-shape.cc
src/hb-ot-shape.cc
+2
-2
未找到文件。
src/hb-font-private.hh
浏览文件 @
9533364c
...
...
@@ -54,6 +54,7 @@
HB_FONT_FUNC_IMPLEMENT (glyph_contour_point) \
HB_FONT_FUNC_IMPLEMENT (glyph_name) \
HB_FONT_FUNC_IMPLEMENT (glyph_from_name) \
HB_FONT_FUNC_IMPLEMENT (glyph_h_advances) \
/* ^--- Add new callbacks here */
struct
hb_font_funcs_t
...
...
@@ -227,6 +228,18 @@ struct hb_font_t
klass
->
user_data
.
glyph_h_advance
);
}
inline
void
get_glyph_h_advances
(
unsigned
count
,
hb_codepoint_t
*
glyphs
,
unsigned
glyph_struct_size
,
hb_position_t
*
advances
,
unsigned
advance_struct_size
)
{
return
klass
->
get
.
f
.
glyph_h_advances
(
this
,
user_data
,
count
,
glyphs
,
glyph_struct_size
,
advances
,
advance_struct_size
,
klass
->
user_data
.
glyph_h_advances
);
}
inline
hb_position_t
get_glyph_v_advance
(
hb_codepoint_t
glyph
)
{
return
klass
->
get
.
f
.
glyph_v_advance
(
this
,
user_data
,
...
...
src/hb-font.cc
浏览文件 @
9533364c
...
...
@@ -143,6 +143,43 @@ hb_font_get_glyph_h_advance_parent (hb_font_t *font,
return
font
->
parent_scale_x_distance
(
font
->
parent
->
get_glyph_h_advance
(
glyph
));
}
template
<
class
T
>
T
*
advance_by_byte_size
(
T
*
p
,
unsigned
byte_size
)
{
return
reinterpret_cast
<
T
*>
(
reinterpret_cast
<
uint8_t
*>
(
p
)
+
byte_size
);
}
static
void
hb_font_get_glyph_h_advances_nil
(
hb_font_t
*
font
,
void
*
font_data
HB_UNUSED
,
unsigned
count
,
hb_codepoint_t
*
glyphs
,
unsigned
glyph_struct_size
,
hb_position_t
*
advances
,
unsigned
advance_struct_size
,
void
*
user_data
HB_UNUSED
)
{
for
(;
count
--
;
glyphs
=
advance_by_byte_size
(
glyphs
,
glyph_struct_size
),
advances
=
advance_by_byte_size
(
advances
,
advance_struct_size
))
{
*
advances
=
hb_font_get_glyph_h_advance_nil
(
font
,
font_data
,
*
glyphs
,
user_data
);
}
}
static
void
hb_font_get_glyph_h_advances_parent
(
hb_font_t
*
font
,
void
*
font_data
HB_UNUSED
,
unsigned
count
,
hb_codepoint_t
*
glyphs
,
unsigned
glyph_struct_size
,
hb_position_t
*
advances
,
unsigned
advance_struct_size
,
void
*
user_data
HB_UNUSED
)
{
for
(;
count
--
;
glyphs
=
advance_by_byte_size
(
glyphs
,
glyph_struct_size
),
advances
=
advance_by_byte_size
(
advances
,
advance_struct_size
))
{
*
advances
=
hb_font_get_glyph_h_advance_parent
(
font
,
font_data
,
*
glyphs
,
user_data
);
}
}
static
hb_position_t
hb_font_get_glyph_v_advance_nil
(
hb_font_t
*
font
,
void
*
font_data
HB_UNUSED
,
...
...
src/hb-font.h
浏览文件 @
9533364c
...
...
@@ -132,6 +132,16 @@ typedef hb_position_t (*hb_font_get_glyph_advance_func_t) (hb_font_t *font, void
typedef
hb_font_get_glyph_advance_func_t
hb_font_get_glyph_h_advance_func_t
;
typedef
hb_font_get_glyph_advance_func_t
hb_font_get_glyph_v_advance_func_t
;
typedef
void
(
*
hb_font_get_glyph_h_advances_func_t
)(
hb_font_t
*
font
,
void
*
font_data
,
unsigned
count
,
hb_codepoint_t
*
glyphs
,
unsigned
glyph_struct_size
,
hb_position_t
*
advances
,
unsigned
advance_struct_size
,
void
*
user_data
);
typedef
hb_bool_t
(
*
hb_font_get_glyph_origin_func_t
)
(
hb_font_t
*
font
,
void
*
font_data
,
hb_codepoint_t
glyph
,
hb_position_t
*
x
,
hb_position_t
*
y
,
...
...
@@ -248,6 +258,11 @@ hb_font_funcs_set_glyph_h_advance_func (hb_font_funcs_t *ffuncs,
hb_font_get_glyph_h_advance_func_t
func
,
void
*
user_data
,
hb_destroy_func_t
destroy
);
HB_EXTERN
void
hb_font_funcs_set_glyph_h_advances_func
(
hb_font_funcs_t
*
ffuncs
,
hb_font_get_glyph_h_advances_func_t
func
,
void
*
user_data
,
hb_destroy_func_t
destroy
);
/**
* hb_font_funcs_set_glyph_v_advance_func:
* @ffuncs: font functions.
...
...
src/hb-ot-shape.cc
浏览文件 @
9533364c
...
...
@@ -680,8 +680,8 @@ hb_ot_position_default (hb_ot_shape_context_t *c)
if
(
HB_DIRECTION_IS_HORIZONTAL
(
direction
))
{
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
pos
[
i
].
x_advance
=
c
->
font
->
get_glyph_h_advance
(
info
[
i
].
codepoint
);
c
->
font
->
get_glyph_h_advances
(
count
,
&
info
[
0
].
codepoint
,
sizeof
(
info
[
0
]),
&
pos
[
0
].
x_advance
,
sizeof
(
pos
[
0
])
);
/* The nil glyph_h_origin() func returns 0, so no need to apply it. */
if
(
c
->
font
->
has_glyph_h_origin_func
())
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录