Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
eed903b1
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
接近 2 年 前同步成功
通知
1
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看板
提交
eed903b1
编写于
5月 11, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Indic] Refactor for the arrival of 'init' feature
Yep, on Bengali now!
上级
18c06e18
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
36 addition
and
16 deletion
+36
-16
src/hb-ot-shape-complex-indic.cc
src/hb-ot-shape-complex-indic.cc
+36
-16
未找到文件。
src/hb-ot-shape-complex-indic.cc
浏览文件 @
eed903b1
...
@@ -85,10 +85,13 @@ is_consonant (const hb_glyph_info_t &info)
...
@@ -85,10 +85,13 @@ is_consonant (const hb_glyph_info_t &info)
return
!!
(
FLAG
(
info
.
indic_category
())
&
(
FLAG
(
OT_C
)
|
FLAG
(
OT_Ra
)
|
FLAG
(
OT_V
)
|
FLAG
(
OT_NBSP
)
|
FLAG
(
OT_DOTTEDCIRCLE
)));
return
!!
(
FLAG
(
info
.
indic_category
())
&
(
FLAG
(
OT_C
)
|
FLAG
(
OT_Ra
)
|
FLAG
(
OT_V
)
|
FLAG
(
OT_NBSP
)
|
FLAG
(
OT_DOTTEDCIRCLE
)));
}
}
st
atic
const
struc
t
{
st
ruct
feature_list_
t
{
hb_tag_t
tag
;
hb_tag_t
tag
;
hb_bool_t
is_global
;
hb_bool_t
is_global
;
}
indic_basic_features
[]
=
};
static
const
feature_list_t
indic_basic_features
[]
=
{
{
{
HB_TAG
(
'n'
,
'u'
,
'k'
,
't'
),
true
},
{
HB_TAG
(
'n'
,
'u'
,
'k'
,
't'
),
true
},
{
HB_TAG
(
'a'
,
'k'
,
'h'
,
'n'
),
false
},
{
HB_TAG
(
'a'
,
'k'
,
'h'
,
'n'
),
false
},
...
@@ -116,17 +119,24 @@ enum {
...
@@ -116,17 +119,24 @@ enum {
CJCT
CJCT
};
};
static
const
hb_tag_t
indic_other_features
[]
=
static
const
feature_list_t
indic_other_features
[]
=
{
{
HB_TAG
(
'p'
,
'r'
,
'e'
,
's'
),
{
HB_TAG
(
'i'
,
'n'
,
'i'
,
't'
),
false
},
HB_TAG
(
'a'
,
'b'
,
'v'
,
's'
),
{
HB_TAG
(
'p'
,
'r'
,
'e'
,
's'
),
true
},
HB_TAG
(
'b'
,
'l'
,
'w'
,
's'
),
{
HB_TAG
(
'a'
,
'b'
,
'v'
,
's'
),
true
},
HB_TAG
(
'p'
,
's'
,
't'
,
's'
),
{
HB_TAG
(
'b'
,
'l'
,
'w'
,
's'
),
true
},
HB_TAG
(
'h'
,
'a'
,
'l'
,
'n'
),
{
HB_TAG
(
'p'
,
's'
,
't'
,
's'
),
true
},
{
HB_TAG
(
'h'
,
'a'
,
'l'
,
'n'
),
true
},
HB_TAG
(
'd'
,
'i'
,
's'
,
't'
),
HB_TAG
(
'a'
,
'b'
,
'v'
,
'm'
),
{
HB_TAG
(
'd'
,
'i'
,
's'
,
't'
),
true
},
HB_TAG
(
'b'
,
'l'
,
'w'
,
'm'
),
{
HB_TAG
(
'a'
,
'b'
,
'v'
,
'm'
),
true
},
{
HB_TAG
(
'b'
,
'l'
,
'w'
,
'm'
),
true
},
};
/* Same order as the indic_other_features array */
enum
{
INIT
};
};
...
@@ -159,7 +169,7 @@ _hb_ot_shape_complex_collect_features_indic (hb_ot_map_builder_t *map, const hb_
...
@@ -159,7 +169,7 @@ _hb_ot_shape_complex_collect_features_indic (hb_ot_map_builder_t *map, const hb_
map
->
add_gsub_pause
(
final_reordering
,
NULL
);
map
->
add_gsub_pause
(
final_reordering
,
NULL
);
for
(
unsigned
int
i
=
0
;
i
<
ARRAY_LENGTH
(
indic_other_features
);
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
ARRAY_LENGTH
(
indic_other_features
);
i
++
)
{
map
->
add_bool_feature
(
indic_other_features
[
i
]
,
true
);
map
->
add_bool_feature
(
indic_other_features
[
i
]
.
tag
,
indic_other_features
[
i
].
is_global
);
map
->
add_gsub_pause
(
NULL
,
NULL
);
map
->
add_gsub_pause
(
NULL
,
NULL
);
}
}
}
}
...
@@ -514,7 +524,7 @@ initial_reordering (const hb_ot_map_t *map,
...
@@ -514,7 +524,7 @@ initial_reordering (const hb_ot_map_t *map,
}
}
static
void
static
void
final_reordering_syllable
(
hb_buffer_t
*
buffer
,
final_reordering_syllable
(
hb_buffer_t
*
buffer
,
hb_mask_t
*
mask_array
,
unsigned
int
start
,
unsigned
int
end
)
unsigned
int
start
,
unsigned
int
end
)
{
{
hb_glyph_info_t
*
info
=
buffer
->
info
;
hb_glyph_info_t
*
info
=
buffer
->
info
;
...
@@ -724,6 +734,11 @@ final_reordering_syllable (hb_buffer_t *buffer,
...
@@ -724,6 +734,11 @@ final_reordering_syllable (hb_buffer_t *buffer,
* consonant.
* consonant.
*/
*/
/* TODO */
/* Finish off the clusters and go home! */
/* Finish off the clusters and go home! */
...
@@ -756,16 +771,21 @@ final_reordering (const hb_ot_map_t *map,
...
@@ -756,16 +771,21 @@ final_reordering (const hb_ot_map_t *map,
unsigned
int
count
=
buffer
->
len
;
unsigned
int
count
=
buffer
->
len
;
if
(
!
count
)
return
;
if
(
!
count
)
return
;
hb_mask_t
mask_array
[
ARRAY_LENGTH
(
indic_other_features
)]
=
{
0
};
unsigned
int
num_masks
=
ARRAY_LENGTH
(
indic_other_features
);
for
(
unsigned
int
i
=
0
;
i
<
num_masks
;
i
++
)
mask_array
[
i
]
=
map
->
get_1_mask
(
indic_other_features
[
i
].
tag
);
hb_glyph_info_t
*
info
=
buffer
->
info
;
hb_glyph_info_t
*
info
=
buffer
->
info
;
unsigned
int
last
=
0
;
unsigned
int
last
=
0
;
unsigned
int
last_syllable
=
info
[
0
].
syllable
();
unsigned
int
last_syllable
=
info
[
0
].
syllable
();
for
(
unsigned
int
i
=
1
;
i
<
count
;
i
++
)
for
(
unsigned
int
i
=
1
;
i
<
count
;
i
++
)
if
(
last_syllable
!=
info
[
i
].
syllable
())
{
if
(
last_syllable
!=
info
[
i
].
syllable
())
{
final_reordering_syllable
(
buffer
,
last
,
i
);
final_reordering_syllable
(
buffer
,
mask_array
,
last
,
i
);
last
=
i
;
last
=
i
;
last_syllable
=
info
[
last
].
syllable
();
last_syllable
=
info
[
last
].
syllable
();
}
}
final_reordering_syllable
(
buffer
,
last
,
count
);
final_reordering_syllable
(
buffer
,
mask_array
,
last
,
count
);
HB_BUFFER_DEALLOCATE_VAR
(
buffer
,
indic_category
);
HB_BUFFER_DEALLOCATE_VAR
(
buffer
,
indic_category
);
HB_BUFFER_DEALLOCATE_VAR
(
buffer
,
indic_position
);
HB_BUFFER_DEALLOCATE_VAR
(
buffer
,
indic_position
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录