Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
aa9c450b
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看板
提交
aa9c450b
编写于
10月 08, 2010
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Enable 'rtlm' mirroring
上级
36925f69
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
19 deletion
+20
-19
src/hb-ot-map-private.hh
src/hb-ot-map-private.hh
+5
-4
src/hb-ot-shape.cc
src/hb-ot-shape.cc
+15
-15
未找到文件。
src/hb-ot-map-private.hh
浏览文件 @
aa9c450b
...
...
@@ -105,9 +105,7 @@ struct hb_ot_map_t {
hb_ot_map_t
(
void
)
:
feature_count
(
0
)
{}
void
add_feature
(
hb_tag_t
tag
,
unsigned
int
value
,
bool
global
)
void
add_feature
(
hb_tag_t
tag
,
unsigned
int
value
,
bool
global
)
{
feature_info_t
*
info
=
&
feature_infos
[
feature_count
++
];
info
->
tag
=
tag
;
...
...
@@ -116,11 +114,14 @@ struct hb_ot_map_t {
info
->
global
=
global
;
}
inline
void
add_bool_feature
(
hb_tag_t
tag
,
bool
global
=
true
)
{
add_feature
(
tag
,
1
,
global
);
}
HB_INTERNAL
void
compile
(
hb_ot_shape_context_t
*
c
);
hb_mask_t
get_global_mask
(
void
)
const
{
return
global_mask
;
}
hb_mask_t
get_mask
(
hb_tag_t
tag
,
unsigned
int
*
shift
)
const
{
hb_mask_t
get_mask
(
hb_tag_t
tag
,
unsigned
int
*
shift
=
NULL
)
const
{
const
feature_map_t
*
map
=
(
const
feature_map_t
*
)
bsearch
(
&
tag
,
feature_maps
,
feature_count
,
sizeof
(
feature_maps
[
0
]),
(
hb_compare_func_t
)
feature_map_t
::
cmp
);
if
(
shift
)
*
shift
=
map
?
map
->
shift
:
0
;
return
map
?
map
->
mask
:
0
;
...
...
src/hb-ot-shape.cc
浏览文件 @
aa9c450b
...
...
@@ -53,12 +53,12 @@ hb_ot_shape_collect_features (hb_ot_shape_context_t *c)
{
switch
(
c
->
original_direction
)
{
case
HB_DIRECTION_LTR
:
c
->
map
->
add_
feature
(
HB_TAG
(
'l'
,
't'
,
'r'
,
'a'
),
1
,
true
);
c
->
map
->
add_
feature
(
HB_TAG
(
'l'
,
't'
,
'r'
,
'm'
),
1
,
true
);
c
->
map
->
add_
bool_feature
(
HB_TAG
(
'l'
,
't'
,
'r'
,
'a'
)
);
c
->
map
->
add_
bool_feature
(
HB_TAG
(
'l'
,
't'
,
'r'
,
'm'
)
);
break
;
case
HB_DIRECTION_RTL
:
c
->
map
->
add_
feature
(
HB_TAG
(
'r'
,
't'
,
'l'
,
'a'
),
1
,
true
);
c
->
map
->
add_
feature
(
HB_TAG
(
'r'
,
't'
,
'l'
,
'm'
),
1
,
false
);
c
->
map
->
add_
bool_feature
(
HB_TAG
(
'r'
,
't'
,
'l'
,
'a'
)
);
c
->
map
->
add_
bool_feature
(
HB_TAG
(
'r'
,
't'
,
'l'
,
'm'
)
,
false
);
break
;
case
HB_DIRECTION_TTB
:
case
HB_DIRECTION_BTT
:
...
...
@@ -67,7 +67,7 @@ hb_ot_shape_collect_features (hb_ot_shape_context_t *c)
}
for
(
unsigned
int
i
=
0
;
i
<
ARRAY_LENGTH
(
default_features
);
i
++
)
c
->
map
->
add_
feature
(
default_features
[
i
],
1
,
true
);
c
->
map
->
add_
bool_feature
(
default_features
[
i
]
);
/* complex */
...
...
@@ -173,22 +173,22 @@ hb_ensure_native_direction (hb_buffer_t *buffer)
/* Substitute */
static
void
hb_mirror_chars
(
hb_
buffer_t
*
buffer
)
hb_mirror_chars
(
hb_
ot_shape_context_t
*
c
)
{
hb_unicode_get_mirroring_func_t
get_mirroring
=
buffer
->
unicode
->
v
.
get_mirroring
;
hb_unicode_get_mirroring_func_t
get_mirroring
=
c
->
buffer
->
unicode
->
v
.
get_mirroring
;
if
(
HB_DIRECTION_IS_FORWARD
(
buffer
->
props
.
direction
))
if
(
HB_DIRECTION_IS_FORWARD
(
c
->
buffer
->
props
.
direction
))
return
;
// map = c->map.find_feature
(HB_TAG ('r','t','l','m'));
hb_mask_t
rtlm_mask
=
c
->
map
->
get_mask
(
HB_TAG
(
'r'
,
't'
,
'l'
,
'm'
));
unsigned
int
count
=
buffer
->
len
;
unsigned
int
count
=
c
->
buffer
->
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
hb_codepoint_t
codepoint
=
get_mirroring
(
buffer
->
info
[
i
].
codepoint
);
if
(
likely
(
codepoint
==
buffer
->
info
[
i
].
codepoint
))
;
// buffer->info[i].mask |= map->
mask;
hb_codepoint_t
codepoint
=
get_mirroring
(
c
->
buffer
->
info
[
i
].
codepoint
);
if
(
likely
(
codepoint
==
c
->
buffer
->
info
[
i
].
codepoint
))
c
->
buffer
->
info
[
i
].
mask
|=
rtlm_
mask
;
else
buffer
->
info
[
i
].
codepoint
=
codepoint
;
c
->
buffer
->
info
[
i
].
codepoint
=
codepoint
;
}
}
...
...
@@ -287,7 +287,7 @@ hb_ot_shape_internal (hb_ot_shape_context_t *c)
c
->
buffer
->
clear_masks
();
/* Mirroring needs to see the original direction */
hb_mirror_chars
(
c
->
buffer
);
hb_mirror_chars
(
c
);
hb_ensure_native_direction
(
c
->
buffer
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录