Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
0d160d5f
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看板
提交
0d160d5f
编写于
9月 03, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[subset] Implement subsetting of SingleSubst
上级
3f00d0b0
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
81 addition
and
25 deletion
+81
-25
src/hb-machinery.hh
src/hb-machinery.hh
+2
-0
src/hb-null.hh
src/hb-null.hh
+28
-15
src/hb-ot-layout-gsub-table.hh
src/hb-ot-layout-gsub-table.hh
+49
-10
src/hb-vector.hh
src/hb-vector.hh
+2
-0
未找到文件。
src/hb-machinery.hh
浏览文件 @
0d160d5f
...
...
@@ -452,6 +452,8 @@ struct hb_serialize_context_t
this
->
debug_depth
=
0
;
}
inline
bool
err
(
bool
e
)
{
return
this
->
ran_out_of_room
=
this
->
ran_out_of_room
||
e
;
}
/* To be called around main operation. */
template
<
typename
Type
>
inline
Type
*
start_serialize
(
void
)
...
...
src/hb-null.hh
浏览文件 @
0d160d5f
...
...
@@ -51,27 +51,40 @@ static inline Type const & Null (void) {
/* Specializaitons for arbitrary-content Null objects expressed in bytes. */
#define DECLARE_NULL_NAMESPACE_BYTES(Namespace, Type) \
}
/* Close namespace. */
\
extern HB_INTERNAL const unsigned char _hb_Null_##Namespace##_##Type[Namespace::Type::min_size]; \
template <> \
/*static*/
inline const Namespace::Type& Null<Namespace::Type> (void) { \
return *reinterpret_cast<const Namespace::Type *> (_hb_Null_##Namespace##_##Type); \
} \
namespace Namespace { \
static_assert (true, "Just so we take semicolon after.")
}
/* Close namespace. */
\
extern HB_INTERNAL const unsigned char _hb_Null_##Namespace##_##Type[Namespace::Type::min_size]; \
template <> \
/*static*/
inline const Namespace::Type& Null<Namespace::Type> (void) { \
return *reinterpret_cast<const Namespace::Type *> (_hb_Null_##Namespace##_##Type); \
} \
namespace Namespace { \
static_assert (true, "Just so we take semicolon after.")
#define DEFINE_NULL_NAMESPACE_BYTES(Namespace, Type) \
const unsigned char _hb_Null_##Namespace##_##Type[Namespace::Type::min_size]
const unsigned char _hb_Null_##Namespace##_##Type[Namespace::Type::min_size]
/* Specializaitons for arbitrary-content Null objects expressed as struct initializer. */
#define DECLARE_NULL_INSTANCE(Type) \
extern HB_INTERNAL const Type _hb_Null_##Type; \
template <> \
/*static*/
inline const Type& Null<Type> (void) { \
return _hb_Null_##Type; \
} \
extern HB_INTERNAL const Type _hb_Null_##Type; \
template <> \
/*static*/
inline const Type& Null<Type> (void) { \
return _hb_Null_##Type; \
} \
static_assert (true, "Just so we take semicolon after.")
#define DEFINE_NULL_INSTANCE(Type) \
const Type _hb_Null_##Type
const Type _hb_Null_##Type
/* Specializaiton to disallow Null objects. */
#define DECLARE_NULL_DISALLOW(Type) \
template <> inline const Type& Null<Type> (void)
#define DECLARE_NULL_NAMSPACE_DISALLOW(Namespace, Type) \
}
/* Close namespace. */
\
template <> \
/*static*/
inline const Namespace::Type& Null<Namespace::Type> (void) { \
extern void *_hb_undefined; \
return *reinterpret_cast<const Namespace::Type *> (_hb_undefined); \
} \
namespace Namespace { \
static_assert (true, "Just so we take semicolon after.")
/* Global writable pool. Enlarge as necessary. */
...
...
src/hb-ot-layout-gsub-table.hh
浏览文件 @
0d160d5f
...
...
@@ -35,6 +35,11 @@
namespace
OT
{
static
inline
void
SingleSubst_serialize
(
hb_serialize_context_t
*
c
,
Supplier
<
GlyphID
>
&
glyphs
,
Supplier
<
GlyphID
>
&
substitutes
,
unsigned
int
num_glyphs
);
struct
SingleSubstFormat1
{
inline
bool
intersects
(
const
hb_set_t
*
glyphs
)
const
...
...
@@ -104,19 +109,26 @@ struct SingleSubstFormat1
inline
bool
subset
(
hb_subset_context_t
*
c
)
const
{
return
false
;
TRACE_SUBSET
(
this
);
hb_auto_t
<
hb_vector_t
<
hb_codepoint_t
>>
from
;
hb_auto_t
<
hb_vector_t
<
hb_codepoint_t
>>
to
;
hb_auto_t
<
hb_vector_t
<
GlyphID
>>
from
;
hb_auto_t
<
hb_vector_t
<
GlyphID
>>
to
;
hb_codepoint_t
delta
=
deltaGlyphID
;
for
(
hb_auto_t
<
Coverage
::
Iter
>
iter
(
this
+
coverage
);
iter
.
more
();
iter
.
next
())
{
//if (!c->plan->glyphs
->has (iter.get_glyph ()))
//
continue;
from
.
push
(
iter
.
get_glyph
());
to
.
push
((
iter
.
get_glyph
()
+
delta
)
&
0xFFFF
);
if
(
!
c
->
plan
->
glyphset
->
has
(
iter
.
get_glyph
()))
continue
;
from
.
push
(
)
->
set
(
iter
.
get_glyph
());
to
.
push
(
)
->
set
(
(
iter
.
get_glyph
()
+
delta
)
&
0xFFFF
);
}
return_trace
(
false
);
c
->
serializer
->
err
(
from
.
in_error
()
||
to
.
in_error
());
Supplier
<
GlyphID
>
from_supplier
(
&
from
);
Supplier
<
GlyphID
>
to_supplier
(
&
to
);
SingleSubst_serialize
(
c
->
serializer
,
from_supplier
,
to_supplier
,
from
.
len
);
return_trace
(
from
.
len
);
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
...
...
@@ -204,8 +216,24 @@ struct SingleSubstFormat2
inline
bool
subset
(
hb_subset_context_t
*
c
)
const
{
TRACE_SUBSET
(
this
);
// TODO(subset)
return_trace
(
false
);
hb_auto_t
<
hb_vector_t
<
GlyphID
>>
from
;
hb_auto_t
<
hb_vector_t
<
GlyphID
>>
to
;
for
(
hb_auto_t
<
Coverage
::
Iter
>
iter
(
this
+
coverage
);
iter
.
more
();
iter
.
next
())
{
if
(
!
c
->
plan
->
glyphset
->
has
(
iter
.
get_glyph
()))
continue
;
from
.
push
()
->
set
(
iter
.
get_glyph
());
to
.
push
()
->
set
(
substitute
[
iter
.
get_coverage
()]);
}
c
->
serializer
->
err
(
from
.
in_error
()
||
to
.
in_error
());
Supplier
<
GlyphID
>
from_supplier
(
&
from
);
Supplier
<
GlyphID
>
to_supplier
(
&
to
);
SingleSubst_serialize
(
c
->
serializer
,
from_supplier
,
to_supplier
,
from
.
len
);
return_trace
(
from
.
len
);
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
...
...
@@ -275,6 +303,17 @@ struct SingleSubst
}
u
;
};
static
inline
void
SingleSubst_serialize
(
hb_serialize_context_t
*
c
,
Supplier
<
GlyphID
>
&
glyphs
,
Supplier
<
GlyphID
>
&
substitutes
,
unsigned
int
num_glyphs
)
{
c
->
start_embed
<
SingleSubst
>
()
->
serialize
(
c
,
glyphs
,
substitutes
,
num_glyphs
);
}
struct
Sequence
{
...
...
src/hb-vector.hh
浏览文件 @
0d160d5f
...
...
@@ -72,6 +72,8 @@ struct hb_vector_t
return
p
;
}
inline
bool
in_error
(
void
)
const
{
return
allocated
==
0
;
}
/* Allocate for size but don't adjust len. */
inline
bool
alloc
(
unsigned
int
size
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录