Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
24eacf17
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,发现更多精彩内容 >>
提交
24eacf17
编写于
8月 02, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Indic] Move consonant-position-setting into initial_reordering()
上级
afbcc24b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
35 addition
and
30 deletion
+35
-30
src/hb-ot-shape-complex-indic.cc
src/hb-ot-shape-complex-indic.cc
+35
-30
未找到文件。
src/hb-ot-shape-complex-indic.cc
浏览文件 @
24eacf17
...
...
@@ -236,6 +236,34 @@ override_features_indic (const hb_ot_complex_shaper_t *shaper,
}
static
void
setup_masks_indic
(
const
hb_ot_complex_shaper_t
*
shaper
,
const
hb_ot_map_t
*
map
,
hb_buffer_t
*
buffer
,
hb_font_t
*
font
HB_UNUSED
)
{
HB_BUFFER_ALLOCATE_VAR
(
buffer
,
indic_category
);
HB_BUFFER_ALLOCATE_VAR
(
buffer
,
indic_position
);
/* We cannot setup masks here. We save information about characters
* and setup masks later on in a pause-callback. */
unsigned
int
count
=
buffer
->
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
set_indic_properties
(
buffer
->
info
[
i
]);
}
static
int
compare_indic_order
(
const
hb_glyph_info_t
*
pa
,
const
hb_glyph_info_t
*
pb
)
{
int
a
=
pa
->
indic_position
();
int
b
=
pb
->
indic_position
();
return
a
<
b
?
-
1
:
a
==
b
?
0
:
+
1
;
}
static
void
update_consonant_positions
(
const
hb_ot_map_t
*
map
,
hb_buffer_t
*
buffer
,
...
...
@@ -254,7 +282,7 @@ update_consonant_positions (const hb_ot_map_t *map,
case
HB_SCRIPT_MALAYALAM
:
virama
=
0x0D4D
;
break
;
case
HB_SCRIPT_SINHALA
:
virama
=
0x0DCA
;
break
;
case
HB_SCRIPT_KHMER
:
virama
=
0x17D2
;
break
;
default:
virama
=
0
;
break
;
default:
virama
=
0
;
break
;
}
indic_shape_plan_t
indic_plan
(
map
);
...
...
@@ -263,43 +291,18 @@ update_consonant_positions (const hb_ot_map_t *map,
hb_codepoint_t
glyphs
[
2
];
if
(
virama
&&
font
->
get_glyph
(
virama
,
0
,
&
glyphs
[
1
-
consonant_pos
]))
{
/* Technically speaking, the spec says we should apply 'locl' to virama too.
* Maybe one day... */
hb_face_t
*
face
=
font
->
face
;
unsigned
int
count
=
buffer
->
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
if
(
buffer
->
info
[
i
].
indic_position
()
==
POS_BASE_C
)
{
font
->
get_glyph
(
buffer
->
info
[
i
].
codepoint
,
0
,
&
glyphs
[
consonant_pos
])
;
glyphs
[
consonant_pos
]
=
buffer
->
info
[
i
].
codepoint
;
buffer
->
info
[
i
].
indic_position
()
=
consonant_position_from_font
(
&
indic_plan
,
glyphs
,
2
,
face
);
}
}
}
static
void
setup_masks_indic
(
const
hb_ot_complex_shaper_t
*
shaper
,
const
hb_ot_map_t
*
map
,
hb_buffer_t
*
buffer
,
hb_font_t
*
font
)
{
HB_BUFFER_ALLOCATE_VAR
(
buffer
,
indic_category
);
HB_BUFFER_ALLOCATE_VAR
(
buffer
,
indic_position
);
/* We cannot setup masks here. We save information about characters
* and setup masks later on in a pause-callback. */
unsigned
int
count
=
buffer
->
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
set_indic_properties
(
buffer
->
info
[
i
]);
update_consonant_positions
(
map
,
buffer
,
font
);
}
static
int
compare_indic_order
(
const
hb_glyph_info_t
*
pa
,
const
hb_glyph_info_t
*
pb
)
{
int
a
=
pa
->
indic_position
();
int
b
=
pb
->
indic_position
();
return
a
<
b
?
-
1
:
a
==
b
?
0
:
+
1
;
}
/* Rules from:
* https://www.microsoft.com/typography/otfntdev/devanot/shaping.aspx */
...
...
@@ -696,10 +699,12 @@ initial_reordering_non_indic (const hb_ot_map_t *map HB_UNUSED,
static
void
initial_reordering
(
const
hb_ot_map_t
*
map
,
hb_font_t
*
font
HB_UNUSED
,
hb_font_t
*
font
,
hb_buffer_t
*
buffer
,
void
*
user_data
HB_UNUSED
)
{
update_consonant_positions
(
map
,
buffer
,
font
);
hb_mask_t
basic_mask_array
[
ARRAY_LENGTH
(
indic_basic_features
)]
=
{
0
};
unsigned
int
num_masks
=
ARRAY_LENGTH
(
indic_basic_features
);
for
(
unsigned
int
i
=
0
;
i
<
num_masks
;
i
++
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录