Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
327d14ef
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,发现更多精彩内容 >>
提交
327d14ef
编写于
8月 31, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Indic] Start adding dotted-circle instrastructure
上级
1be368e9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
51 addition
and
14 deletion
+51
-14
src/hb-ot-shape-complex-indic-machine.rl
src/hb-ot-shape-complex-indic-machine.rl
+9
-10
src/hb-ot-shape-complex-indic.cc
src/hb-ot-shape-complex-indic.cc
+42
-4
未找到文件。
src/hb-ot-shape-complex-indic-machine.rl
浏览文件 @
327d14ef
...
@@ -78,24 +78,23 @@ standalone_cluster = reph? place_holder.n? (halant_group.cn){0,4} halant_or_matr
...
@@ -78,24 +78,23 @@ standalone_cluster = reph? place_holder.n? (halant_group.cn){0,4} halant_or_matr
other = any;
other = any;
main := |*
main := |*
consonant_syllable => {
process
_syllable (consonant_syllable); };
consonant_syllable => {
found
_syllable (consonant_syllable); };
vowel_syllable => {
process
_syllable (vowel_syllable); };
vowel_syllable => {
found
_syllable (vowel_syllable); };
standalone_cluster => {
process
_syllable (standalone_cluster); };
standalone_cluster => {
found
_syllable (standalone_cluster); };
other => {
process_syllable (non_indic
); };
other => {
found_syllable (non_indic_cluster
); };
*|;
*|;
}%%
}%%
#define
process_syllable(func
) \
#define
found_syllable(syllable_type
) \
HB_STMT_START { \
HB_STMT_START { \
if (0) fprintf (stderr, "syllable %d..%d %s\n", last, p+1, #
func
); \
if (0) fprintf (stderr, "syllable %d..%d %s\n", last, p+1, #
syllable_type
); \
for (unsigned int i = last; i < p+1; i++) \
for (unsigned int i = last; i < p+1; i++) \
info[i].syllable() = syllable_serial; \
info[i].syllable() = (syllable_serial << 4) | syllable_type; \
PASTE (initial_reordering_, func) (plan, buffer, last, p+1); \
last = p+1; \
last = p+1; \
syllable_serial++; \
syllable_serial++; \
if (unlikely (
!syllable_serial)) syllable_serial++
; \
if (unlikely (
syllable_serial == 16)) syllable_serial = 1
; \
} HB_STMT_END
} HB_STMT_END
static void
static void
...
@@ -113,7 +112,7 @@ find_syllables (const hb_ot_shape_plan_t *plan, hb_buffer_t *buffer)
...
@@ -113,7 +112,7 @@ find_syllables (const hb_ot_shape_plan_t *plan, hb_buffer_t *buffer)
pe = eof = buffer->len;
pe = eof = buffer->len;
unsigned int last = 0;
unsigned int last = 0;
u
int8_
t syllable_serial = 1;
u
nsigned in
t syllable_serial = 1;
%%{
%%{
write exec;
write exec;
}%%
}%%
...
...
src/hb-ot-shape-complex-indic.cc
浏览文件 @
327d14ef
...
@@ -770,23 +770,61 @@ initial_reordering_standalone_cluster (const hb_ot_shape_plan_t *plan,
...
@@ -770,23 +770,61 @@ initial_reordering_standalone_cluster (const hb_ot_shape_plan_t *plan,
}
}
static
void
static
void
initial_reordering_non_indic
(
const
hb_ot_shape_plan_t
*
plan
HB_UNUSED
,
initial_reordering_non_indic
_cluster
(
const
hb_ot_shape_plan_t
*
plan
HB_UNUSED
,
hb_buffer_t
*
buffer
HB_UNUSED
,
hb_buffer_t
*
buffer
HB_UNUSED
,
unsigned
int
start
HB_UNUSED
,
unsigned
int
end
HB_UNUSED
)
unsigned
int
start
HB_UNUSED
,
unsigned
int
end
HB_UNUSED
)
{
{
/* Nothing to do right now. If we ever switch to using the output
/* Nothing to do right now. If we ever switch to using the output
* buffer in the reordering process, we'd need to next_glyph() here. */
* buffer in the reordering process, we'd need to next_glyph() here. */
}
}
enum
syllable_type_t
{
consonant_syllable
,
vowel_syllable
,
standalone_cluster
,
broken_cluster
,
non_indic_cluster
,
};
#include "hb-ot-shape-complex-indic-machine.hh"
#include "hb-ot-shape-complex-indic-machine.hh"
static
void
initial_reordering_syllable
(
const
hb_ot_shape_plan_t
*
plan
,
hb_buffer_t
*
buffer
,
unsigned
int
start
,
unsigned
int
end
)
{
syllable_type_t
syllable_type
=
(
syllable_type_t
)
(
buffer
->
info
[
start
].
syllable
()
&
0x0F
);
switch
(
syllable_type
)
{
case
consonant_syllable
:
initial_reordering_consonant_syllable
(
plan
,
buffer
,
start
,
end
);
return
;
case
vowel_syllable
:
initial_reordering_vowel_syllable
(
plan
,
buffer
,
start
,
end
);
return
;
case
standalone_cluster
:
initial_reordering_standalone_cluster
(
plan
,
buffer
,
start
,
end
);
return
;
case
broken_cluster
:
initial_reordering_non_indic_cluster
(
plan
,
buffer
,
start
,
end
);
return
;
case
non_indic_cluster
:
initial_reordering_non_indic_cluster
(
plan
,
buffer
,
start
,
end
);
return
;
}
}
static
void
static
void
initial_reordering
(
const
hb_ot_shape_plan_t
*
plan
,
initial_reordering
(
const
hb_ot_shape_plan_t
*
plan
,
hb_font_t
*
font
,
hb_font_t
*
font
,
hb_buffer_t
*
buffer
)
hb_buffer_t
*
buffer
)
{
{
unsigned
int
count
=
buffer
->
len
;
if
(
unlikely
(
!
count
))
return
;
update_consonant_positions
(
plan
,
font
,
buffer
);
update_consonant_positions
(
plan
,
font
,
buffer
);
find_syllables
(
plan
,
buffer
);
find_syllables
(
plan
,
buffer
);
hb_glyph_info_t
*
info
=
buffer
->
info
;
unsigned
int
last
=
0
;
unsigned
int
last_syllable
=
info
[
0
].
syllable
();
for
(
unsigned
int
i
=
1
;
i
<
count
;
i
++
)
if
(
last_syllable
!=
info
[
i
].
syllable
())
{
initial_reordering_syllable
(
plan
,
buffer
,
last
,
i
);
last
=
i
;
last_syllable
=
info
[
last
].
syllable
();
}
initial_reordering_syllable
(
plan
,
buffer
,
last
,
count
);
}
}
static
void
static
void
...
@@ -1110,7 +1148,7 @@ final_reordering (const hb_ot_shape_plan_t *plan,
...
@@ -1110,7 +1148,7 @@ final_reordering (const hb_ot_shape_plan_t *plan,
hb_buffer_t
*
buffer
)
hb_buffer_t
*
buffer
)
{
{
unsigned
int
count
=
buffer
->
len
;
unsigned
int
count
=
buffer
->
len
;
if
(
!
count
)
return
;
if
(
unlikely
(
!
count
)
)
return
;
hb_glyph_info_t
*
info
=
buffer
->
info
;
hb_glyph_info_t
*
info
=
buffer
->
info
;
unsigned
int
last
=
0
;
unsigned
int
last
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录