Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
5668189c
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
接近 2 年 前同步成功
通知
1
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看板
提交
5668189c
编写于
4月 20, 2011
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[API] font: move user_data before destroy()
This is the common convention for language binding tools.
上级
e5847f75
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
27 addition
and
27 deletion
+27
-27
src/hb-font-private.h
src/hb-font-private.h
+2
-2
src/hb-font.cc
src/hb-font.cc
+15
-15
src/hb-font.h
src/hb-font.h
+6
-6
src/hb-ft.c
src/hb-ft.c
+4
-4
未找到文件。
src/hb-font-private.h
浏览文件 @
5668189c
...
...
@@ -63,8 +63,8 @@ struct _hb_face_t {
hb_reference_count_t
ref_count
;
hb_get_table_func_t
get_table
;
hb_destroy_func_t
destroy
;
void
*
user_data
;
hb_destroy_func_t
destroy
;
hb_blob_t
*
head_blob
;
const
struct
head
*
head_table
;
...
...
@@ -87,8 +87,8 @@ struct _hb_font_t {
unsigned
int
y_ppem
;
hb_font_funcs_t
*
klass
;
hb_destroy_func_t
destroy
;
void
*
user_data
;
hb_destroy_func_t
destroy
;
};
...
...
src/hb-font.cc
浏览文件 @
5668189c
...
...
@@ -296,8 +296,8 @@ static hb_face_t _hb_face_nil = {
HB_REFERENCE_COUNT_INVALID
,
/* ref_count */
NULL
,
/* get_table */
NULL
,
/* destroy */
NULL
,
/* user_data */
NULL
,
/* destroy */
NULL
,
/* head_blob */
NULL
,
/* head_table */
...
...
@@ -308,8 +308,8 @@ static hb_face_t _hb_face_nil = {
hb_face_t
*
hb_face_create_for_tables
(
hb_get_table_func_t
get_table
,
hb_destroy_func_t
destroy
,
void
*
user_data
)
void
*
user_data
,
hb_destroy_func_t
destroy
)
{
hb_face_t
*
face
;
...
...
@@ -320,8 +320,8 @@ hb_face_create_for_tables (hb_get_table_func_t get_table,
}
face
->
get_table
=
get_table
;
face
->
destroy
=
destroy
;
face
->
user_data
=
user_data
;
face
->
destroy
=
destroy
;
face
->
ot_layout
=
_hb_ot_layout_new
(
face
);
...
...
@@ -386,8 +386,8 @@ hb_face_create_for_data (hb_blob_t *blob,
return
&
_hb_face_nil
;
return
hb_face_create_for_tables
(
_hb_face_for_data_get_table
,
(
hb_destroy_func_t
)
_hb_face_for_data_closure_destroy
,
closure
);
closure
,
(
hb_destroy_func_t
)
_hb_face_for_data_closure_destroy
);
}
...
...
@@ -454,8 +454,8 @@ static hb_font_t _hb_font_nil = {
0
,
/* y_ppem */
NULL
,
/* klass */
NULL
,
/*
destroy
*/
NULL
/*
user_data
*/
NULL
,
/*
user_data
*/
NULL
/*
destroy
*/
};
hb_font_t
*
...
...
@@ -498,8 +498,8 @@ hb_font_destroy (hb_font_t *font)
void
hb_font_set_funcs
(
hb_font_t
*
font
,
hb_font_funcs_t
*
klass
,
hb_destroy_func_t
destroy
,
void
*
user_data
)
void
*
user_data
,
hb_destroy_func_t
destroy
)
{
if
(
HB_OBJECT_IS_INERT
(
font
))
return
;
...
...
@@ -513,28 +513,28 @@ hb_font_set_funcs (hb_font_t *font,
hb_font_funcs_reference
(
klass
);
hb_font_funcs_destroy
(
font
->
klass
);
font
->
klass
=
klass
;
font
->
destroy
=
destroy
;
font
->
user_data
=
user_data
;
font
->
destroy
=
destroy
;
}
void
hb_font_unset_funcs
(
hb_font_t
*
font
,
hb_font_funcs_t
**
klass
,
hb_destroy_func_t
*
destroy
,
void
**
user_data
)
void
**
user_data
,
hb_destroy_func_t
*
destroy
)
{
/* None of the input arguments can be NULL. */
*
klass
=
font
->
klass
;
*
destroy
=
font
->
destroy
;
*
user_data
=
font
->
user_data
;
*
destroy
=
font
->
destroy
;
if
(
HB_OBJECT_IS_INERT
(
font
))
return
;
font
->
klass
=
NULL
;
font
->
destroy
=
NULL
;
font
->
user_data
=
NULL
;
font
->
destroy
=
NULL
;
}
void
...
...
src/hb-font.h
浏览文件 @
5668189c
...
...
@@ -49,8 +49,8 @@ typedef hb_blob_t * (*hb_get_table_func_t) (hb_tag_t tag, void *user_data);
/* calls destroy() when not needing user_data anymore */
hb_face_t
*
hb_face_create_for_tables
(
hb_get_table_func_t
get_table
,
hb_destroy_func_t
destroy
,
void
*
user_data
);
void
*
user_data
,
hb_destroy_func_t
destroy
);
hb_face_t
*
hb_face_reference
(
hb_face_t
*
face
);
...
...
@@ -218,8 +218,8 @@ hb_font_destroy (hb_font_t *font);
void
hb_font_set_funcs
(
hb_font_t
*
font
,
hb_font_funcs_t
*
klass
,
hb_destroy_func_t
destroy
,
void
*
user_data
);
void
*
user_data
,
hb_destroy_func_t
destroy
);
/* Returns what was set and unsets it, but doesn't destroy(user_data).
* This is useful for wrapping / chaining font_funcs_t's.
...
...
@@ -234,8 +234,8 @@ hb_font_set_funcs (hb_font_t *font,
void
hb_font_unset_funcs
(
hb_font_t
*
font
,
hb_font_funcs_t
**
klass
,
hb_destroy_func_t
*
destroy
,
void
**
user_data
);
void
**
user_data
,
hb_destroy_func_t
*
destroy
);
/*
...
...
src/hb-ft.c
浏览文件 @
5668189c
...
...
@@ -189,7 +189,7 @@ get_table (hb_tag_t tag, void *user_data)
return
hb_blob_create
((
const
char
*
)
buffer
,
length
,
HB_MEMORY_MODE_WRITABLE
,
free
,
buffer
);
buffer
,
free
);
}
...
...
@@ -206,11 +206,11 @@ hb_ft_face_create (FT_Face ft_face,
(
unsigned
int
)
ft_face
->
stream
->
size
,
/* TODO: Check FT_FACE_FLAG_EXTERNAL_STREAM? */
HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE
,
destroy
,
ft_face
);
ft_face
,
destroy
);
face
=
hb_face_create_for_data
(
blob
,
ft_face
->
face_index
);
hb_blob_destroy
(
blob
);
}
else
{
face
=
hb_face_create_for_tables
(
get_table
,
destroy
,
ft_face
);
face
=
hb_face_create_for_tables
(
get_table
,
ft_face
,
destroy
);
}
return
face
;
...
...
@@ -247,7 +247,7 @@ hb_ft_font_create (FT_Face ft_face,
font
=
hb_font_create
();
hb_font_set_funcs
(
font
,
hb_ft_get_font_funcs
(),
destroy
,
ft_face
);
ft_face
,
destroy
);
hb_font_set_scale
(
font
,
((
uint64_t
)
ft_face
->
size
->
metrics
.
x_scale
*
(
uint64_t
)
ft_face
->
units_per_EM
)
>>
16
,
((
uint64_t
)
ft_face
->
size
->
metrics
.
y_scale
*
(
uint64_t
)
ft_face
->
units_per_EM
)
>>
16
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录