Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
32d71dc1
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看板
提交
32d71dc1
编写于
8月 07, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Graphite] Minor
上级
030ac502
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
28 addition
and
32 deletion
+28
-32
src/hb-graphite2.cc
src/hb-graphite2.cc
+28
-32
未找到文件。
src/hb-graphite2.cc
浏览文件 @
32d71dc1
...
...
@@ -47,8 +47,8 @@ HB_SHAPER_DATA_ENSURE_DECLARE(graphite2, font)
*/
typedef
struct
hb_graphite2_tablelist_t
{
hb_blob_t
*
blob
;
struct
hb_graphite2_tablelist_t
*
next
;
hb_blob_t
*
blob
;
unsigned
int
tag
;
}
hb_graphite2_tablelist_t
;
...
...
@@ -58,40 +58,36 @@ struct hb_graphite2_shaper_face_data_t {
hb_graphite2_tablelist_t
*
tlist
;
};
static
const
void
*
hb_gr_get_table
(
const
void
*
data
,
unsigned
int
tag
,
size_t
*
len
)
static
const
void
*
hb_gr
aphite2
_get_table
(
const
void
*
data
,
unsigned
int
tag
,
size_t
*
len
)
{
hb_graphite2_tablelist_t
*
pl
=
NULL
,
*
p
;
hb_graphite2_shaper_face_data_t
*
face
=
(
hb_graphite2_shaper_face_data_t
*
)
data
;
hb_graphite2_tablelist_t
*
tlist
=
face
->
tlist
;
for
(
p
=
tlist
;
p
;
p
=
p
->
next
)
if
(
p
->
tag
==
tag
)
{
unsigned
int
tlen
;
const
char
*
d
=
hb_blob_get_data
(
p
->
blob
,
&
tlen
);
*
len
=
tlen
;
return
d
;
}
else
pl
=
p
;
hb_blob_t
*
blob
=
hb_face_reference_table
(
face
->
face
,
tag
);
/* TODO Not thread-safe. */
if
(
!
pl
||
pl
->
blob
)
hb_graphite2_shaper_face_data_t
*
face_data
=
(
hb_graphite2_shaper_face_data_t
*
)
data
;
hb_graphite2_tablelist_t
*
tlist
=
face_data
->
tlist
;
hb_blob_t
*
blob
=
NULL
;
for
(
hb_graphite2_tablelist_t
*
p
=
tlist
;
p
;
p
=
p
->
next
)
if
(
p
->
tag
==
tag
)
{
blob
=
p
->
blob
;
break
;
}
if
(
unlikely
(
!
blob
))
{
p
=
(
hb_graphite2_tablelist_t
*
)
calloc
(
1
,
sizeof
(
hb_graphite2_tablelist_t
));
if
(
!
p
)
{
blob
=
hb_face_reference_table
(
face_data
->
face
,
tag
);
hb_graphite2_tablelist_t
*
p
=
(
hb_graphite2_tablelist_t
*
)
calloc
(
1
,
sizeof
(
hb_graphite2_tablelist_t
));
if
(
unlikely
(
!
p
))
{
hb_blob_destroy
(
blob
);
return
NULL
;
}
p
->
next
=
NULL
;
if
(
pl
)
pl
->
next
=
p
;
else
face
->
tlist
=
p
;
pl
=
p
;
p
->
blob
=
blob
;
p
->
tag
=
tag
;
/* TODO Not thread-safe, but fairly harmless.
* We can do the double-chcked pointer cmpexch thing here. */
p
->
next
=
face_data
->
tlist
;
face_data
->
tlist
=
p
;
}
pl
->
blob
=
blob
;
pl
->
tag
=
tag
;
unsigned
int
tlen
;
const
char
*
d
=
hb_blob_get_data
(
blob
,
&
tlen
);
...
...
@@ -117,7 +113,7 @@ _hb_graphite2_shaper_face_data_create (hb_face_t *face)
hb_blob_destroy
(
silf_blob
);
data
->
face
=
face
;
data
->
grface
=
gr_make_face
(
data
,
&
hb_gr_get_table
,
gr_face_default
);
data
->
grface
=
gr_make_face
(
data
,
&
hb_gr
aphite2
_get_table
,
gr_face_default
);
if
(
unlikely
(
!
data
->
grface
))
{
free
(
data
);
...
...
@@ -150,7 +146,7 @@ _hb_graphite2_shaper_face_data_destroy (hb_graphite2_shaper_face_data_t *data)
* shaper font data
*/
static
float
hb_gr_get_advance
(
const
void
*
hb_font
,
unsigned
short
gid
)
static
float
hb_gr
aphite2
_get_advance
(
const
void
*
hb_font
,
unsigned
short
gid
)
{
return
((
hb_font_t
*
)
hb_font
)
->
get_glyph_h_advance
(
gid
);
}
...
...
@@ -163,7 +159,7 @@ _hb_graphite2_shaper_font_data_create (hb_font_t *font)
hb_face_t
*
face
=
font
->
face
;
hb_graphite2_shaper_face_data_t
*
face_data
=
HB_SHAPER_DATA_GET
(
face
);
return
gr_make_font_with_advance_fn
(
font
->
x_scale
,
font
,
&
hb_gr_get_advance
,
face_data
->
grface
);
return
gr_make_font_with_advance_fn
(
font
->
x_scale
,
font
,
&
hb_gr
aphite2
_get_advance
,
face_data
->
grface
);
}
void
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录