Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
1dcf5fb0
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看板
提交
1dcf5fb0
编写于
8月 25, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[cmap Add hb_subset_collect_variation_unicodes()
To be moved to hb-face.h later.
上级
4806b380
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
82 addition
and
12 deletion
+82
-12
src/hb-ot-cmap-table.hh
src/hb-ot-cmap-table.hh
+50
-9
src/hb-subset.cc
src/hb-subset.cc
+24
-1
src/hb-subset.h
src/hb-subset.h
+8
-2
未找到文件。
src/hb-ot-cmap-table.hh
浏览文件 @
1dcf5fb0
...
...
@@ -296,7 +296,7 @@ struct CmapSubtableFormat4
{
/* XXX This does NOT skip over chars mapping to gid0... */
if
(
this
->
startCount
[
i
]
!=
0xFFFFu
||
this
->
endCount
[
i
]
!=
0xFFFFu
)
// Skip the last segment (0xFFFF)
hb_set_add_range
(
out
,
this
->
startCount
[
i
],
this
->
endCount
[
i
]);
out
->
add_range
(
this
->
startCount
[
i
],
this
->
endCount
[
i
]);
}
}
...
...
@@ -459,11 +459,9 @@ struct CmapSubtableLongSegmented
inline
void
collect_unicodes
(
hb_set_t
*
out
)
const
{
for
(
unsigned
int
i
=
0
;
i
<
this
->
groups
.
len
;
i
++
)
{
hb_set_add_range
(
out
,
MIN
((
unsigned
int
)
this
->
groups
[
i
].
startCharCode
,
(
unsigned
int
)
HB_MAX_UNICODE_CODEPOINT_VALUE
),
MIN
((
unsigned
int
)
this
->
groups
[
i
].
endCharCode
,
(
unsigned
int
)
HB_MAX_UNICODE_CODEPOINT_VALUE
));
out
->
add_range
(
this
->
groups
[
i
].
startCharCode
,
MIN
((
hb_codepoint_t
)
this
->
groups
[
i
].
endCharCode
,
(
hb_codepoint_t
)
HB_MAX_UNICODE_CODEPOINT_VALUE
));
}
}
...
...
@@ -600,7 +598,23 @@ struct UnicodeValueRange
DEFINE_SIZE_STATIC
(
4
);
};
typedef
SortedArrayOf
<
UnicodeValueRange
,
HBUINT32
>
DefaultUVS
;
struct
DefaultUVS
:
SortedArrayOf
<
UnicodeValueRange
,
HBUINT32
>
{
inline
void
collect_unicodes
(
hb_set_t
*
out
)
const
{
unsigned
int
count
=
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
hb_codepoint_t
first
=
arrayZ
[
i
].
startUnicodeValue
;
hb_codepoint_t
last
=
MIN
((
hb_codepoint_t
)
(
first
+
arrayZ
[
i
].
additionalCount
),
(
hb_codepoint_t
)
HB_MAX_UNICODE_CODEPOINT_VALUE
);
out
->
add_range
(
first
,
last
);
}
}
public:
DEFINE_SIZE_ARRAY
(
4
,
arrayZ
);
};
struct
UVSMapping
{
...
...
@@ -621,7 +635,18 @@ struct UVSMapping
DEFINE_SIZE_STATIC
(
5
);
};
typedef
SortedArrayOf
<
UVSMapping
,
HBUINT32
>
NonDefaultUVS
;
struct
NonDefaultUVS
:
SortedArrayOf
<
UVSMapping
,
HBUINT32
>
{
inline
void
collect_unicodes
(
hb_set_t
*
out
)
const
{
unsigned
int
count
=
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
out
->
add
(
arrayZ
[
i
].
glyphID
);
}
public:
DEFINE_SIZE_ARRAY
(
4
,
arrayZ
);
};
struct
VariationSelectorRecord
{
...
...
@@ -644,6 +669,12 @@ struct VariationSelectorRecord
return
GLYPH_VARIANT_NOT_FOUND
;
}
inline
void
collect_unicodes
(
hb_set_t
*
out
,
const
void
*
base
)
const
{
(
base
+
defaultUVS
).
collect_unicodes
(
out
);
(
base
+
nonDefaultUVS
).
collect_unicodes
(
out
);
}
inline
int
cmp
(
const
hb_codepoint_t
&
variation_selector
)
const
{
return
varSelector
.
cmp
(
variation_selector
);
...
...
@@ -672,7 +703,7 @@ struct CmapSubtableFormat14
hb_codepoint_t
variation_selector
,
hb_codepoint_t
*
glyph
)
const
{
return
record
[
record
.
bsearch
(
variation_selector
)].
get_glyph
(
codepoint
,
glyph
,
this
);
return
record
[
record
.
bsearch
(
variation_selector
)].
get_glyph
(
codepoint
,
glyph
,
this
);
}
inline
void
collect_variation_selectors
(
hb_set_t
*
out
)
const
...
...
@@ -681,6 +712,11 @@ struct CmapSubtableFormat14
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
out
->
add
(
record
.
arrayZ
[
i
].
varSelector
);
}
inline
void
collect_variation_unicodes
(
hb_codepoint_t
variation_selector
,
hb_set_t
*
out
)
const
{
record
[
record
.
bsearch
(
variation_selector
)].
collect_unicodes
(
out
,
this
);
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
...
...
@@ -1045,6 +1081,11 @@ struct cmap
{
subtable_uvs
->
collect_variation_selectors
(
out
);
}
inline
void
collect_variation_unicodes
(
hb_codepoint_t
variation_selector
,
hb_set_t
*
out
)
const
{
subtable_uvs
->
collect_variation_unicodes
(
variation_selector
,
out
);
}
protected:
typedef
bool
(
*
hb_cmap_get_glyph_func_t
)
(
const
void
*
obj
,
...
...
src/hb-subset.cc
浏览文件 @
1dcf5fb0
...
...
@@ -263,7 +263,8 @@ hb_subset_collect_unicodes (hb_face_t *face, hb_set_t *out)
* Since: REPLACEME
*/
void
hb_subset_collect_variation_selectors
(
hb_face_t
*
face
,
hb_set_t
*
out
)
hb_subset_collect_variation_selectors
(
hb_face_t
*
face
,
hb_set_t
*
out
)
{
/* XXX Use saved accel. */
OT
::
cmap
::
accelerator_t
cmap
;
...
...
@@ -271,3 +272,25 @@ hb_subset_collect_variation_selectors (hb_face_t *face, hb_set_t *out)
cmap
.
collect_variation_selectors
(
out
);
cmap
.
fini
();
}
/**
* hb_subset_collect_variation_unicodes:
* @face: font face.
* @out: set to add Unicode characters for @variation_selector covered by @face to.
*
*
*
* Since: REPLACEME
*/
void
hb_subset_collect_variation_unicodes
(
hb_face_t
*
face
,
hb_codepoint_t
variation_selector
,
hb_set_t
*
out
)
{
/* XXX Use saved accel. */
OT
::
cmap
::
accelerator_t
cmap
;
cmap
.
init
(
face
);
cmap
.
collect_variation_unicodes
(
variation_selector
,
out
);
cmap
.
fini
();
}
src/hb-subset.h
浏览文件 @
1dcf5fb0
...
...
@@ -84,10 +84,16 @@ hb_subset (hb_face_t *source,
/* TODO Move to hb-face.h. */
HB_EXTERN
void
hb_subset_collect_unicodes
(
hb_face_t
*
sour
ce
,
hb_set_t
*
out
);
hb_subset_collect_unicodes
(
hb_face_t
*
fa
ce
,
hb_set_t
*
out
);
HB_EXTERN
void
hb_subset_collect_variation_selectors
(
hb_face_t
*
source
,
hb_set_t
*
out
);
hb_subset_collect_variation_selectors
(
hb_face_t
*
face
,
hb_set_t
*
out
);
HB_EXTERN
void
hb_subset_collect_variation_unicodes
(
hb_face_t
*
face
,
hb_codepoint_t
variation_selector
,
hb_set_t
*
out
);
HB_END_DECLS
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录