Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
321d5588
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
9 个月 前同步成功
通知
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,体验更适合开发者的 AI 搜索 >>
提交
321d5588
编写于
7月 02, 2019
作者:
Q
Qunxin Liu
提交者:
Garret Rieger
8月 06, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[subset] Add subsetting for GPOS Lookup Type 1: Single Adjustment Positioning Subtable
上级
37572882
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
166 addition
and
4 deletion
+166
-4
src/hb-ot-layout-gpos-table.hh
src/hb-ot-layout-gpos-table.hh
+153
-4
test/subset/data/Makefile.am
test/subset/data/Makefile.am
+1
-0
test/subset/data/Makefile.sources
test/subset/data/Makefile.sources
+1
-0
test/subset/data/expected/layout.gpos/gpos1_2_font.keep-layout-retain-gids.41,43.otf
...ayout.gpos/gpos1_2_font.keep-layout-retain-gids.41,43.otf
+0
-0
test/subset/data/expected/layout.gpos/gpos1_2_font.keep-layout-retain-gids.41,46.otf
...ayout.gpos/gpos1_2_font.keep-layout-retain-gids.41,46.otf
+0
-0
test/subset/data/expected/layout.gpos/gpos1_2_font.keep-layout-retain-gids.43,46.otf
...ayout.gpos/gpos1_2_font.keep-layout-retain-gids.43,46.otf
+0
-0
test/subset/data/expected/layout.gpos/gpos1_2_font.keep-layout-retain-gids.retain-all-codepoint.otf
...1_2_font.keep-layout-retain-gids.retain-all-codepoint.otf
+0
-0
test/subset/data/fonts/gpos1_2_font.otf
test/subset/data/fonts/gpos1_2_font.otf
+0
-0
test/subset/data/tests/layout.gpos.tests
test/subset/data/tests/layout.gpos.tests
+11
-0
未找到文件。
src/hb-ot-layout-gpos-table.hh
浏览文件 @
321d5588
...
...
@@ -236,6 +236,11 @@ struct ValueFormat : HBUINT16
}
};
template
<
typename
Iterator
>
static
inline
void
SinglePos_serialize
(
hb_serialize_context_t
*
c
,
Iterator
it
,
ValueFormat
valFormat
);
struct
AnchorFormat1
{
...
...
@@ -496,11 +501,52 @@ struct SinglePosFormat1
return_trace
(
true
);
}
template
<
typename
Iterator
,
hb_requires
(
hb_is_iterator
(
Iterator
))>
void
serialize
(
hb_serialize_context_t
*
c
,
Iterator
it
,
ValueFormat
valFormat
)
{
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
;
if
(
unlikely
(
!
c
->
check_assign
(
valueFormat
,
valFormat
)))
return
;
auto
vals
=
hb_second
(
*
it
);
+
vals
|
hb_apply
([
=
]
(
const
Value
&
_
)
{
c
->
copy
(
_
);
})
;
auto
glyphs
=
+
it
|
hb_map_retains_sorting
(
hb_first
)
;
coverage
.
serialize
(
c
,
this
).
serialize
(
c
,
glyphs
);
}
bool
subset
(
hb_subset_context_t
*
c
)
const
{
TRACE_SUBSET
(
this
);
// TODO(subset)
return_trace
(
false
);
const
hb_set_t
&
glyphset
=
*
c
->
plan
->
glyphset_gsub
();
const
hb_map_t
&
glyph_map
=
*
c
->
plan
->
glyph_map
;
unsigned
length
=
valueFormat
.
get_len
();
auto
it
=
+
hb_iter
(
this
+
coverage
)
|
hb_filter
(
glyphset
)
|
hb_map_retains_sorting
([
&
]
(
hb_codepoint_t
p
)
{
return
hb_pair
(
glyph_map
[
p
],
values
.
as_array
(
length
));
})
;
bool
ret
=
bool
(
it
);
SinglePos_serialize
(
c
->
serializer
,
it
,
valueFormat
);
return_trace
(
ret
);
}
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
...
...
@@ -552,11 +598,58 @@ struct SinglePosFormat2
return_trace
(
true
);
}
template
<
typename
Iterator
,
hb_requires
(
hb_is_iterator
(
Iterator
))>
void
serialize
(
hb_serialize_context_t
*
c
,
Iterator
it
,
ValueFormat
valFormat
)
{
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
;
if
(
unlikely
(
!
c
->
check_assign
(
valueFormat
,
valFormat
)))
return
;
if
(
unlikely
(
!
c
->
check_assign
(
valueCount
,
it
.
len
())))
return
;
+
it
|
hb_map
(
hb_second
)
|
hb_apply
([
=
]
(
hb_array_t
<
const
Value
>
val_iter
)
{
+
val_iter
|
hb_apply
([
=
]
(
const
Value
&
_
)
{
c
->
copy
(
_
);
})
;
})
;
auto
glyphs
=
+
it
|
hb_map_retains_sorting
(
hb_first
)
;
coverage
.
serialize
(
c
,
this
).
serialize
(
c
,
glyphs
);
}
bool
subset
(
hb_subset_context_t
*
c
)
const
{
TRACE_SUBSET
(
this
);
// TODO(subset)
return_trace
(
false
);
const
hb_set_t
&
glyphset
=
*
c
->
plan
->
glyphset_gsub
();
const
hb_map_t
&
glyph_map
=
*
c
->
plan
->
glyph_map
;
unsigned
sub_length
=
valueFormat
.
get_len
();
unsigned
total_length
=
(
unsigned
)
valueCount
*
sub_length
;
auto
it
=
+
hb_zip
(
this
+
coverage
,
hb_range
((
unsigned
)
valueCount
))
|
hb_filter
(
glyphset
,
hb_first
)
|
hb_map_retains_sorting
([
&
]
(
const
hb_pair_t
<
hb_codepoint_t
,
unsigned
>&
_
)
{
return
hb_pair
(
glyph_map
[
_
.
first
],
values
.
as_array
(
total_length
).
sub_array
(
_
.
second
*
sub_length
,
sub_length
));
})
;
bool
ret
=
bool
(
it
);
SinglePos_serialize
(
c
->
serializer
,
it
,
valueFormat
);
return_trace
(
ret
);
}
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
...
...
@@ -583,6 +676,55 @@ struct SinglePosFormat2
struct
SinglePos
{
template
<
typename
Iterator
,
hb_requires
(
hb_is_iterator
(
Iterator
))>
unsigned
get_format
(
Iterator
glyph_val_iter_pairs
)
{
unsigned
subset_format
=
1
;
hb_array_t
<
const
Value
>
first_val_iter
=
hb_second
(
*
glyph_val_iter_pairs
);
+
glyph_val_iter_pairs
|
hb_map
(
hb_second
)
|
hb_apply
([
&
]
(
hb_array_t
<
const
Value
>
val_iter
)
{
+
hb_zip
(
val_iter
,
first_val_iter
)
|
hb_apply
([
&
]
(
const
hb_pair_t
<
Value
,
Value
>&
_
)
{
if
(
_
.
first
!=
_
.
second
)
{
subset_format
=
2
;
return
;
}
})
;
})
;
return
subset_format
;
}
template
<
typename
Iterator
,
hb_requires
(
hb_is_iterator
(
Iterator
))>
void
serialize
(
hb_serialize_context_t
*
c
,
Iterator
glyph_val_iter_pairs
,
ValueFormat
valFormat
)
{
if
(
unlikely
(
!
c
->
extend_min
(
u
.
format
)))
return
;
unsigned
format
=
2
;
if
(
glyph_val_iter_pairs
)
format
=
get_format
(
glyph_val_iter_pairs
);
u
.
format
=
format
;
switch
(
u
.
format
)
{
case
1
:
u
.
format1
.
serialize
(
c
,
glyph_val_iter_pairs
,
valFormat
);
return
;
case
2
:
u
.
format2
.
serialize
(
c
,
glyph_val_iter_pairs
,
valFormat
);
return
;
default:
return
;
}
}
template
<
typename
context_t
,
typename
...
Ts
>
typename
context_t
::
return_t
dispatch
(
context_t
*
c
,
Ts
&&
...
ds
)
const
{
...
...
@@ -603,6 +745,13 @@ struct SinglePos
}
u
;
};
template
<
typename
Iterator
>
static
inline
void
SinglePos_serialize
(
hb_serialize_context_t
*
c
,
Iterator
it
,
ValueFormat
valFormat
)
{
c
->
start_embed
<
SinglePos
>
()
->
serialize
(
c
,
it
,
valFormat
);
}
struct
PairValueRecord
{
...
...
test/subset/data/Makefile.am
浏览文件 @
321d5588
...
...
@@ -13,6 +13,7 @@ EXTRA_DIST += \
expected/japanese
\
expected/cff-japanese
\
expected/layout
\
expected/layout.gpos
\
fonts
\
profiles
\
$(NULL)
...
...
test/subset/data/Makefile.sources
浏览文件 @
321d5588
...
...
@@ -5,6 +5,7 @@ TESTS = \
tests/japanese.tests
\
tests/cff-japanese.tests
\
tests/layout.tests
\
tests/layout.gpos.tests
\
$(NULL)
XFAIL_TESTS
=
\
...
...
test/subset/data/expected/layout.gpos/gpos1_2_font.keep-layout-retain-gids.41,43.otf
0 → 100644
浏览文件 @
321d5588
文件已添加
test/subset/data/expected/layout.gpos/gpos1_2_font.keep-layout-retain-gids.41,46.otf
0 → 100644
浏览文件 @
321d5588
文件已添加
test/subset/data/expected/layout.gpos/gpos1_2_font.keep-layout-retain-gids.43,46.otf
0 → 100644
浏览文件 @
321d5588
文件已添加
test/subset/data/expected/layout.gpos/gpos1_2_font.keep-layout-retain-gids.retain-all-codepoint.otf
0 → 100644
浏览文件 @
321d5588
文件已添加
test/subset/data/fonts/gpos1_2_font.otf
0 → 100644
浏览文件 @
321d5588
文件已添加
test/subset/data/tests/layout.gpos.tests
0 → 100644
浏览文件 @
321d5588
FONTS:
gpos1_2_font.otf
PROFILES:
keep-layout-retain-gids.txt
SUBSETS:
AC
CF
AF
*
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录