Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
b7d04eb6
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看板
提交
b7d04eb6
编写于
4月 10, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Do Arabic fallback shaping
上级
ae4a2b93
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
33 addition
and
5 deletion
+33
-5
src/hb-ot-shape-complex-arabic.cc
src/hb-ot-shape-complex-arabic.cc
+33
-5
未找到文件。
src/hb-ot-shape-complex-arabic.cc
浏览文件 @
b7d04eb6
...
...
@@ -58,8 +58,6 @@ enum {
static
unsigned
int
get_joining_type
(
hb_codepoint_t
u
,
hb_unicode_general_category_t
gen_cat
)
{
/* TODO Macroize the magic bit operations */
if
(
likely
(
hb_in_range
<
hb_codepoint_t
>
(
u
,
JOINING_TABLE_FIRST
,
JOINING_TABLE_LAST
)))
{
unsigned
int
j_type
=
joining_table
[
u
-
JOINING_TABLE_FIRST
];
if
(
likely
(
j_type
!=
JOINING_TYPE_X
))
...
...
@@ -82,6 +80,12 @@ static unsigned int get_joining_type (hb_codepoint_t u, hb_unicode_general_categ
JOINING_TYPE_T
:
JOINING_TYPE_U
;
}
static
hb_codepoint_t
get_arabic_shape
(
hb_codepoint_t
u
,
unsigned
int
shape
)
{
if
(
likely
(
hb_in_range
<
hb_codepoint_t
>
(
u
,
SHAPING_TABLE_FIRST
,
SHAPING_TABLE_LAST
))
&&
shape
<
4
)
return
shaping_table
[
u
-
SHAPING_TABLE_FIRST
][
shape
];
return
u
;
}
static
const
hb_tag_t
arabic_syriac_features
[]
=
...
...
@@ -189,6 +193,15 @@ _hb_ot_shape_complex_normalization_preference_arabic (void)
return
HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS
;
}
static
void
arabic_fallback_shape
(
hb_buffer_t
*
buffer
)
{
unsigned
int
count
=
buffer
->
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
buffer
->
info
[
i
].
codepoint
=
get_arabic_shape
(
buffer
->
info
[
i
].
codepoint
,
buffer
->
info
[
i
].
arabic_shaping_action
());
}
void
_hb_ot_shape_complex_setup_masks_arabic
(
hb_ot_map_t
*
map
,
hb_buffer_t
*
buffer
)
{
...
...
@@ -218,12 +231,27 @@ _hb_ot_shape_complex_setup_masks_arabic (hb_ot_map_t *map, hb_buffer_t *buffer)
}
hb_mask_t
mask_array
[
TOTAL_NUM_FEATURES
+
1
]
=
{
0
};
hb_mask_t
total_masks
=
0
;
unsigned
int
num_masks
=
buffer
->
props
.
script
==
HB_SCRIPT_SYRIAC
?
SYRIAC_NUM_FEATURES
:
COMMON_NUM_FEATURES
;
for
(
unsigned
int
i
=
0
;
i
<
num_masks
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
num_masks
;
i
++
)
{
mask_array
[
i
]
=
map
->
get_1_mask
(
arabic_syriac_features
[
i
]);
total_masks
|=
mask_array
[
i
];
}
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
buffer
->
info
[
i
].
mask
|=
mask_array
[
buffer
->
info
[
i
].
arabic_shaping_action
()];
if
(
total_masks
)
{
/* Has OpenType tables */
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
buffer
->
info
[
i
].
mask
|=
mask_array
[
buffer
->
info
[
i
].
arabic_shaping_action
()];
}
else
if
(
buffer
->
props
.
script
==
HB_SCRIPT_ARABIC
)
{
/* Fallback Arabic shaping to Presentation Forms */
/* Pitfalls:
* - This path fires if user force-set init/medi/fina/isol off,
* - If font does not declare script 'arab', well, what to do?
* Most probably it's safe to assume that init/medi/fina/isol
* still mean Arabic shaping, although they do not have to.
*/
arabic_fallback_shape
(
buffer
);
}
HB_BUFFER_DEALLOCATE_VAR
(
buffer
,
arabic_shaping_action
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录