Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
8ba9e689
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看板
提交
8ba9e689
编写于
7月 22, 2015
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[USE] Do Arabic-like shaping
上级
9daf2dfb
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
75 addition
and
2 deletion
+75
-2
src/hb-ot-shape-complex-use.cc
src/hb-ot-shape-complex-use.cc
+75
-2
未找到文件。
src/hb-ot-shape-complex-use.cc
浏览文件 @
8ba9e689
...
...
@@ -27,6 +27,7 @@
*/
#include "hb-ot-shape-complex-use-private.hh"
#include "hb-ot-shape-complex-arabic-private.hh"
/* buffer var allocations */
#define use_category() complex_var_u8_0()
...
...
@@ -53,6 +54,19 @@ basic_features[] =
HB_TAG
(
'c'
,
'j'
,
'c'
,
't'
),
};
static
const
hb_tag_t
arabic_features
[]
=
{
HB_TAG
(
'i'
,
's'
,
'o'
,
'l'
),
HB_TAG
(
'i'
,
'n'
,
'i'
,
't'
),
HB_TAG
(
'm'
,
'e'
,
'd'
,
'i'
),
HB_TAG
(
'f'
,
'i'
,
'n'
,
'a'
),
/* The spec doesn't specify these but we apply anyway, since our Arabic shaper
* does. These are only used in Syriac spec. */
HB_TAG
(
'm'
,
'e'
,
'd'
,
'2'
),
HB_TAG
(
'f'
,
'i'
,
'n'
,
'2'
),
HB_TAG
(
'f'
,
'i'
,
'n'
,
'3'
),
};
static
const
hb_tag_t
other_features
[]
=
{
/*
...
...
@@ -120,7 +134,10 @@ collect_features_use (hb_ot_shape_planner_t *plan)
map
->
add_gsub_pause
(
reorder
);
/* "Topographical features" */
// TODO isol/init/medi/fina
for
(
unsigned
int
i
=
0
;
i
<
ARRAY_LENGTH
(
other_features
);
i
++
)
map
->
add_feature
(
arabic_features
[
i
],
1
,
F_NONE
);
map
->
add_gsub_pause
(
NULL
);
/* "Standard typographic presentation" and "Positional feature application" */
for
(
unsigned
int
i
=
0
;
i
<
ARRAY_LENGTH
(
other_features
);
i
++
)
...
...
@@ -132,8 +149,41 @@ struct use_shape_plan_t
ASSERT_POD
();
hb_mask_t
rphf_mask
;
arabic_shape_plan_t
*
arabic_plan
;
};
static
bool
has_arabic_joining
(
hb_script_t
script
)
{
/* List of scripts that have data in arabic-table. */
switch
((
int
)
script
)
{
/* Unicode-1.1 additions */
case
HB_SCRIPT_ARABIC
:
/* Unicode-3.0 additions */
case
HB_SCRIPT_MONGOLIAN
:
case
HB_SCRIPT_SYRIAC
:
/* Unicode-5.0 additions */
case
HB_SCRIPT_NKO
:
case
HB_SCRIPT_PHAGS_PA
:
/* Unicode-6.0 additions */
case
HB_SCRIPT_MANDAIC
:
/* Unicode-7.0 additions */
case
HB_SCRIPT_MANICHAEAN
:
case
HB_SCRIPT_PSALTER_PAHLAVI
:
return
true
;
default:
return
false
;
}
}
static
void
*
data_create_use
(
const
hb_ot_shape_plan_t
*
plan
)
{
...
...
@@ -143,12 +193,27 @@ data_create_use (const hb_ot_shape_plan_t *plan)
use_plan
->
rphf_mask
=
plan
->
map
.
get_1_mask
(
HB_TAG
(
'r'
,
'p'
,
'h'
,
'f'
));
if
(
has_arabic_joining
(
plan
->
props
.
script
))
{
use_plan
->
arabic_plan
=
(
arabic_shape_plan_t
*
)
data_create_arabic
(
plan
);
if
(
unlikely
(
!
use_plan
->
arabic_plan
))
{
free
(
use_plan
);
return
NULL
;
}
}
return
use_plan
;
}
static
void
data_destroy_use
(
void
*
data
)
{
use_shape_plan_t
*
use_plan
=
(
use_shape_plan_t
*
)
data
;
if
(
use_plan
->
arabic_plan
)
data_destroy_arabic
(
use_plan
->
arabic_plan
);
free
(
data
);
}
...
...
@@ -175,10 +240,18 @@ set_use_properties (hb_glyph_info_t &info)
static
void
setup_masks_use
(
const
hb_ot_shape_plan_t
*
plan
HB_UNUSED
,
setup_masks_use
(
const
hb_ot_shape_plan_t
*
plan
,
hb_buffer_t
*
buffer
,
hb_font_t
*
font
HB_UNUSED
)
{
const
use_shape_plan_t
*
use_plan
=
(
const
use_shape_plan_t
*
)
plan
->
data
;
/* Do this before allocating use_category(). */
if
(
use_plan
->
arabic_plan
)
{
setup_masks_arabic_plan
(
use_plan
->
arabic_plan
,
buffer
,
plan
->
props
.
script
);
}
HB_BUFFER_ALLOCATE_VAR
(
buffer
,
use_category
);
/* We cannot setup masks here. We save information about characters
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录