Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
52886ca5
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
52886ca5
编写于
4月 16, 2009
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[GSUB] Implement Alternate subtables
上级
4f27ce7e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
97 addition
and
9 deletion
+97
-9
src/hb-ot-layout-gsub-private.h
src/hb-ot-layout-gsub-private.h
+96
-8
src/hb-ot-layout-open-private.h
src/hb-ot-layout-open-private.h
+1
-1
未找到文件。
src/hb-ot-layout-gsub-private.h
浏览文件 @
52886ca5
...
...
@@ -221,10 +221,12 @@ struct MultipleSubstFormat1 {
glyph_id
=
IN_CURGLYPH
();
index
=
get_glyph_coverage
(
glyph_id
);
if
(
index
>=
sequenceCount
)
return
false
;
const
Sequence
&
seq
=
(
*
this
)[
index
];
if
(
HB_UNLIKELY
(
!
seq
.
get_len
()))
return
false
;
_hb_buffer_add_output_glyph_ids
(
buffer
,
1
,
seq
.
glyphCount
,
seq
.
substitute
,
0xFFFF
,
0xFFFF
);
...
...
@@ -285,7 +287,9 @@ DEFINE_NULL (MultipleSubst, 2);
struct
AlternateSet
{
/* TODO */
/* GlyphIDs, in no particular order */
DEFINE_ARRAY_TYPE
(
GlyphID
,
alternate
,
glyphCount
);
private:
USHORT
glyphCount
;
/* Number of GlyphIDs in the Alternate
...
...
@@ -296,7 +300,62 @@ struct AlternateSet {
DEFINE_NULL_ASSERT_SIZE
(
AlternateSet
,
2
);
struct
AlternateSubstFormat1
{
/* TODO */
friend
struct
AlternateSubst
;
private:
/* AlternateSet tables, in Coverage Index order */
DEFINE_OFFSET_ARRAY_TYPE
(
AlternateSet
,
alternateSet
,
alternateSetCount
);
DEFINE_GET_ACCESSOR
(
Coverage
,
coverage
,
coverage
);
DEFINE_GET_GLYPH_COVERAGE
(
glyph_coverage
);
inline
bool
substitute
(
SUBTABLE_SUBSTITUTE_ARGS_DEF
)
const
{
hb_codepoint_t
glyph_id
;
unsigned
int
index
;
unsigned
int
property
;
HB_UNUSED
(
nesting_level_left
);
if
(
HB_UNLIKELY
(
context_length
<
1
))
return
false
;
if
(
!
_hb_ot_layout_check_glyph_property
(
layout
,
IN_CURITEM
(),
lookup_flag
,
&
property
))
return
false
;
glyph_id
=
IN_CURGLYPH
();
index
=
get_glyph_coverage
(
glyph_id
);
const
AlternateSet
&
alt_set
=
(
*
this
)[
index
];
if
(
HB_UNLIKELY
(
!
alt_set
.
get_len
()))
return
false
;
unsigned
int
alt_index
=
0
;
/* XXX callback to user to choose alternate
if ( gsub->altfunc )
alt_index = (gsub->altfunc)( buffer->out_pos, glyph_id,
aset.GlyphCount, aset.Alternate,
gsub->data );
*/
if
(
HB_UNLIKELY
(
alt_index
>=
alt_set
.
get_len
()))
return
false
;
glyph_id
=
alt_set
[
alt_index
];
_hb_buffer_replace_output_glyph
(
buffer
,
glyph_id
,
context_length
==
NO_CONTEXT
);
if
(
_hb_ot_layout_has_new_glyph_classes
(
layout
)
)
{
/* we inherit the old glyph class to the substituted glyph */
_hb_ot_layout_set_glyph_property
(
layout
,
glyph_id
,
property
);
}
return
true
;
}
private:
USHORT
substFormat
;
/* Format identifier--format = 1 */
...
...
@@ -310,6 +369,34 @@ struct AlternateSubstFormat1 {
};
ASSERT_SIZE
(
AlternateSubstFormat1
,
6
);
struct
AlternateSubst
{
friend
struct
SubstLookupSubTable
;
private:
unsigned
int
get_size
(
void
)
const
{
switch
(
u
.
substFormat
)
{
case
1
:
return
sizeof
(
u
.
format1
);
default:
return
sizeof
(
u
.
substFormat
);
}
}
inline
bool
substitute
(
SUBTABLE_SUBSTITUTE_ARGS_DEF
)
const
{
switch
(
u
.
substFormat
)
{
case
1
:
return
u
.
format1
.
substitute
(
SUBTABLE_SUBSTITUTE_ARGS
);
default:
return
false
;
}
}
private:
union
{
USHORT
substFormat
;
/* Format identifier */
AlternateSubstFormat1
format1
;
}
u
;
};
DEFINE_NULL
(
AlternateSubst
,
2
);
struct
Ligature
{
/* TODO */
...
...
@@ -716,9 +803,9 @@ struct SubstLookupSubTable {
unsigned
int
get_size
(
unsigned
int
lookup_type
)
const
{
switch
(
lookup_type
)
{
case
GSUB_Single
:
return
u
.
single
.
get_size
();
case
GSUB_Multiple
:
return
u
.
multiple
.
get_size
();
/*
case GSUB_Alternate:
case
GSUB_Multiple
:
return
u
.
multiple
.
get_size
();
case
GSUB_Alternate
:
return
u
.
alternate
.
get_size
();
/*
case GSUB_Ligature:
case GSUB_Context:
case GSUB_ChainingContext:
...
...
@@ -736,8 +823,8 @@ struct SubstLookupSubTable {
switch
(
lookup_type
)
{
case
GSUB_Single
:
return
u
.
single
.
substitute
(
SUBTABLE_SUBSTITUTE_ARGS
);
case
GSUB_Multiple
:
return
u
.
multiple
.
substitute
(
SUBTABLE_SUBSTITUTE_ARGS
);
case
GSUB_Alternate
:
return
u
.
alternate
.
substitute
(
SUBTABLE_SUBSTITUTE_ARGS
);
/*
case GSUB_Alternate:
case GSUB_Ligature:
case GSUB_Context:
case GSUB_ChainingContext:
...
...
@@ -755,6 +842,7 @@ struct SubstLookupSubTable {
USHORT
substFormat
;
SingleSubst
single
;
MultipleSubst
multiple
;
AlternateSubst
alternate
;
ExtensionSubst
extension
;
}
u
;
...
...
src/hb-ot-layout-open-private.h
浏览文件 @
52886ca5
...
...
@@ -822,7 +822,7 @@ struct ClassDefFormat1 {
friend
struct
ClassDef
;
private:
/*
GlyphID
s, in sorted numerical order */
/*
Class Value
s, in sorted numerical order */
DEFINE_ARRAY_TYPE
(
USHORT
,
classValueArray
,
glyphCount
);
inline
hb_ot_layout_class_t
get_class
(
hb_codepoint_t
glyph_id
)
const
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录