Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
e1a37f3d
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
e1a37f3d
编写于
10月 30, 2017
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add hb_string_t
上级
21ac5678
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
35 addition
and
17 deletion
+35
-17
src/hb-ot-post-table.hh
src/hb-ot-post-table.hh
+8
-17
src/hb-private.hh
src/hb-private.hh
+27
-0
未找到文件。
src/hb-ot-post-table.hh
浏览文件 @
e1a37f3d
...
...
@@ -110,48 +110,39 @@ struct post
index_to_offset
.
finish
();
}
struct
str_t
{
inline
str_t
(
void
)
:
bytes
(
nullptr
),
len
(
0
)
{}
inline
str_t
(
const
char
*
bytes_
,
unsigned
int
len_
)
:
bytes
(
bytes_
),
len
(
len_
)
{}
const
char
*
bytes
;
unsigned
int
len
;
};
inline
str_t
_find_glyph_name
(
hb_codepoint_t
glyph
)
const
inline
hb_string_t
_find_glyph_name
(
hb_codepoint_t
glyph
)
const
{
if
(
version
==
0x00010000
)
{
if
(
glyph
>=
NUM_FORMAT1_NAMES
)
return
str
_t
();
return
hb_string
_t
();
return
str
_t
(
format1_names
(
glyph
),
strlen
(
format1_names
(
glyph
)));
return
hb_string
_t
(
format1_names
(
glyph
),
strlen
(
format1_names
(
glyph
)));
}
if
(
version
!=
0x00020000
||
glyph
>=
glyphNameIndex
->
len
)
return
str
_t
();
return
hb_string
_t
();
unsigned
int
index
=
glyphNameIndex
->
array
[
glyph
];
if
(
index
<
NUM_FORMAT1_NAMES
)
return
str
_t
(
format1_names
(
index
),
strlen
(
format1_names
(
index
)));
return
hb_string
_t
(
format1_names
(
index
),
strlen
(
format1_names
(
index
)));
index
-=
NUM_FORMAT1_NAMES
;
if
(
index
>=
index_to_offset
.
len
)
return
str
_t
();
return
hb_string
_t
();
unsigned
int
offset
=
index_to_offset
.
array
[
index
];
const
uint8_t
*
data
=
pool
+
offset
;
unsigned
int
name_length
=
*
data
;
data
++
;
return
str
_t
((
const
char
*
)
data
,
name_length
);
return
hb_string
_t
((
const
char
*
)
data
,
name_length
);
}
inline
bool
get_glyph_name
(
hb_codepoint_t
glyph
,
char
*
buf
,
unsigned
int
buf_len
)
const
{
str
_t
s
=
_find_glyph_name
(
glyph
);
hb_string
_t
s
=
_find_glyph_name
(
glyph
);
if
(
!
s
.
len
)
return
false
;
if
(
!
buf_len
)
...
...
src/hb-private.hh
浏览文件 @
e1a37f3d
...
...
@@ -1137,4 +1137,31 @@ hb_options (void)
/* Size signifying variable-sized array */
#define VAR 1
/* String type. */
struct
hb_string_t
{
inline
hb_string_t
(
void
)
:
bytes
(
nullptr
),
len
(
0
)
{}
inline
hb_string_t
(
const
char
*
bytes_
,
unsigned
int
len_
)
:
bytes
(
bytes_
),
len
(
len_
)
{}
inline
int
cmp
(
const
hb_string_t
*
a
)
const
{
if
(
len
!=
a
->
len
)
return
(
int
)
a
->
len
-
(
int
)
len
;
return
memcmp
(
a
->
bytes
,
bytes
,
len
);
}
static
inline
int
cmp
(
const
void
*
pa
,
const
void
*
pb
)
{
hb_string_t
*
a
=
(
hb_string_t
*
)
pa
;
hb_string_t
*
b
=
(
hb_string_t
*
)
pb
;
return
b
->
cmp
(
a
);
}
const
char
*
bytes
;
unsigned
int
len
;
};
#endif
/* HB_PRIVATE_HH */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录