Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
1725c35d
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看板
提交
1725c35d
编写于
2月 14, 2018
作者:
R
Rod Sheeter
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[subset] cmap space bracket
上级
e158739b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
36 addition
and
36 deletion
+36
-36
src/hb-ot-cmap-table.hh
src/hb-ot-cmap-table.hh
+36
-36
未找到文件。
src/hb-ot-cmap-table.hh
浏览文件 @
1725c35d
...
...
@@ -271,13 +271,13 @@ struct CmapSubtableLongSegmented
return_trace
(
c
->
check_struct
(
this
)
&&
groups
.
sanitize
(
c
));
}
inline
bool
serialize
(
hb_serialize_context_t
*
context
,
hb_prealloced_array_t
<
CmapSubtableLongGroup
>
&
group_data
)
inline
bool
serialize
(
hb_serialize_context_t
*
context
,
hb_prealloced_array_t
<
CmapSubtableLongGroup
>
&
group_data
)
{
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
context
->
extend_min
(
*
this
)))
return_trace
(
false
);
Supplier
<
CmapSubtableLongGroup
>
supplier
(
group_data
.
array
,
group_data
.
len
);
if
(
unlikely
(
!
groups
.
serialize
(
context
,
supplier
,
group_data
.
len
)))
return_trace
(
false
);
if
(
unlikely
(
!
context
->
extend_min
(
*
this
)))
return_trace
(
false
);
Supplier
<
CmapSubtableLongGroup
>
supplier
(
group_data
.
array
,
group_data
.
len
);
if
(
unlikely
(
!
groups
.
serialize
(
context
,
supplier
,
group_data
.
len
)))
return_trace
(
false
);
return
true
;
}
...
...
@@ -435,12 +435,12 @@ struct CmapSubtable
hb_codepoint_t
*
glyph
)
const
{
switch
(
u
.
format
)
{
case
0
:
return
u
.
format0
.
get_glyph
(
codepoint
,
glyph
);
case
4
:
return
u
.
format4
.
get_glyph
(
codepoint
,
glyph
);
case
6
:
return
u
.
format6
.
get_glyph
(
codepoint
,
glyph
);
case
10
:
return
u
.
format10
.
get_glyph
(
codepoint
,
glyph
);
case
12
:
return
u
.
format12
.
get_glyph
(
codepoint
,
glyph
);
case
13
:
return
u
.
format13
.
get_glyph
(
codepoint
,
glyph
);
case
0
:
return
u
.
format0
.
get_glyph
(
codepoint
,
glyph
);
case
4
:
return
u
.
format4
.
get_glyph
(
codepoint
,
glyph
);
case
6
:
return
u
.
format6
.
get_glyph
(
codepoint
,
glyph
);
case
10
:
return
u
.
format10
.
get_glyph
(
codepoint
,
glyph
);
case
12
:
return
u
.
format12
.
get_glyph
(
codepoint
,
glyph
);
case
13
:
return
u
.
format13
.
get_glyph
(
codepoint
,
glyph
);
case
14
:
default:
return
false
;
}
...
...
@@ -517,8 +517,8 @@ struct cmap
encodingRecord
.
sanitize
(
c
,
this
));
}
inline
bool
populate_groups
(
hb_subset_plan_t
*
plan
,
hb_prealloced_array_t
<
CmapSubtableLongGroup
>
*
groups
)
const
inline
bool
populate_groups
(
hb_subset_plan_t
*
plan
,
hb_prealloced_array_t
<
CmapSubtableLongGroup
>
*
groups
)
const
{
CmapSubtableLongGroup
*
group
=
nullptr
;
for
(
unsigned
int
i
=
0
;
i
<
plan
->
codepoints
.
len
;
i
++
)
{
...
...
@@ -526,19 +526,19 @@ struct cmap
hb_codepoint_t
cp
=
plan
->
codepoints
[
i
];
if
(
!
group
||
cp
-
1
!=
group
->
endCharCode
)
{
group
=
groups
->
push
();
group
->
startCharCode
.
set
(
cp
);
group
->
endCharCode
.
set
(
cp
);
group
=
groups
->
push
();
group
->
startCharCode
.
set
(
cp
);
group
->
endCharCode
.
set
(
cp
);
hb_codepoint_t
new_gid
;
if
(
unlikely
(
!
hb_subset_plan_new_gid_for_codepoint
(
plan
,
cp
,
&
new_gid
)))
if
(
unlikely
(
!
hb_subset_plan_new_gid_for_codepoint
(
plan
,
cp
,
&
new_gid
)))
{
DEBUG_MSG
(
SUBSET
,
nullptr
,
"Unable to find new gid for %04x"
,
cp
);
return
false
;
}
group
->
glyphID
.
set
(
new_gid
);
group
->
glyphID
.
set
(
new_gid
);
}
else
{
group
->
endCharCode
.
set
(
cp
);
group
->
endCharCode
.
set
(
cp
);
}
}
...
...
@@ -555,35 +555,35 @@ struct cmap
size_t
dest_sz
,
void
*
dest
)
const
{
hb_serialize_context_t
context
(
dest
,
dest_sz
);
hb_serialize_context_t
context
(
dest
,
dest_sz
);
OT
::
cmap
*
cmap
=
context
.
start_serialize
<
OT
::
cmap
>
();
if
(
unlikely
(
!
context
.
extend_min
(
*
cmap
)))
if
(
unlikely
(
!
context
.
extend_min
(
*
cmap
)))
{
return
false
;
}
cmap
->
version
.
set
(
0
);
cmap
->
version
.
set
(
0
);
if
(
unlikely
(
!
cmap
->
encodingRecord
.
serialize
(
&
context
,
/* numTables */
1
)))
return
false
;
if
(
unlikely
(
!
cmap
->
encodingRecord
.
serialize
(
&
context
,
/* numTables */
1
)))
return
false
;
EncodingRecord
&
rec
=
cmap
->
encodingRecord
[
0
];
rec
.
platformID
.
set
(
3
);
// Windows
rec
.
encodingID
.
set
(
10
);
// Unicode UCS-4
/* capture offset to subtable */
CmapSubtable
&
subtable
=
rec
.
subtable
.
serialize
(
&
context
,
cmap
);
CmapSubtable
&
subtable
=
rec
.
subtable
.
serialize
(
&
context
,
cmap
);
subtable
.
u
.
format
.
set
(
12
);
subtable
.
u
.
format
.
set
(
12
);
CmapSubtableFormat12
&
format12
=
subtable
.
u
.
format12
;
if
(
unlikely
(
!
context
.
extend_min
(
format12
)))
return
false
;
if
(
unlikely
(
!
context
.
extend_min
(
format12
)))
return
false
;
format12
.
format
.
set
(
12
);
format12
.
reservedZ
.
set
(
0
);
format12
.
lengthZ
.
set
(
16
+
12
*
groups
.
len
);
format12
.
format
.
set
(
12
);
format12
.
reservedZ
.
set
(
0
);
format12
.
lengthZ
.
set
(
16
+
12
*
groups
.
len
);
if
(
unlikely
(
!
format12
.
serialize
(
&
context
,
groups
)))
return
false
;
if
(
unlikely
(
!
format12
.
serialize
(
&
context
,
groups
)))
return
false
;
context
.
end_serialize
();
...
...
@@ -594,7 +594,7 @@ struct cmap
{
hb_auto_array_t
<
CmapSubtableLongGroup
>
groups
;
if
(
unlikely
(
!
populate_groups
(
plan
,
&
groups
)))
return
false
;
if
(
unlikely
(
!
populate_groups
(
plan
,
&
groups
)))
return
false
;
// We now know how big our blob needs to be
// TODO use APIs from the structs to get size?
...
...
@@ -602,15 +602,15 @@ struct cmap
+
8
// 1 EncodingRecord
+
16
// Format 12 header
+
12
*
groups
.
len
;
// SequentialMapGroup records
void
*
dest
=
calloc
(
dest_sz
,
1
);
if
(
unlikely
(
!
dest
))
{
void
*
dest
=
calloc
(
dest_sz
,
1
);
if
(
unlikely
(
!
dest
))
{
DEBUG_MSG
(
SUBSET
,
nullptr
,
"Unable to alloc %ld for cmap subset output"
,
dest_sz
);
return
false
;
}
if
(
unlikely
(
!
_subset
(
groups
,
dest_sz
,
dest
)))
if
(
unlikely
(
!
_subset
(
groups
,
dest_sz
,
dest
)))
{
free
(
dest
);
free
(
dest
);
return
false
;
}
...
...
@@ -620,7 +620,7 @@ struct cmap
HB_MEMORY_MODE_READONLY
,
/* userdata */
nullptr
,
free
);
return
hb_subset_plan_add_table
(
plan
,
HB_OT_TAG_cmap
,
cmap_prime
);
return
hb_subset_plan_add_table
(
plan
,
HB_OT_TAG_cmap
,
cmap_prime
);
}
struct
accelerator_t
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录