Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
8280459e
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看板
未验证
提交
8280459e
编写于
11月 22, 2018
作者:
B
Behdad Esfahbod
提交者:
GitHub
11月 22, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1291 from harfbuzz/use-reordering
[use] Fix reordering
上级
e4a4555d
3c7792ca
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
38 addition
and
15 deletion
+38
-15
src/hb-ot-shape-complex-use.cc
src/hb-ot-shape-complex-use.cc
+33
-15
src/hb.hh
src/hb.hh
+2
-0
test/shaping/data/in-house/fonts/4afb0e8b9a86bb9bd73a1247de4e33fbe3c1fd93.ttf
...-house/fonts/4afb0e8b9a86bb9bd73a1247de4e33fbe3c1fd93.ttf
+0
-0
test/shaping/data/in-house/tests/use.tests
test/shaping/data/in-house/tests/use.tests
+3
-0
未找到文件。
src/hb-ot-shape-complex-use.cc
浏览文件 @
8280459e
...
...
@@ -432,7 +432,8 @@ record_pref (const hb_ot_shape_plan_t *plan HB_UNUSED,
static
inline
bool
is_halant
(
const
hb_glyph_info_t
&
info
)
{
return
info
.
use_category
()
==
USE_H
&&
!
_hb_glyph_info_ligated
(
&
info
);
return
(
info
.
use_category
()
==
USE_H
||
info
.
use_category
()
==
USE_HVM
)
&&
!
_hb_glyph_info_ligated
(
&
info
);
}
static
void
...
...
@@ -449,19 +450,38 @@ reorder_syllable (hb_buffer_t *buffer, unsigned int start, unsigned int end)
hb_glyph_info_t
*
info
=
buffer
->
info
;
#define BASE_FLAGS (FLAG (USE_B) | FLAG (USE_GB))
#define POST_BASE_FLAGS (FLAG64 (USE_FM) | \
FLAG64 (USE_FAbv) | \
FLAG64 (USE_FBlw) | \
FLAG64 (USE_FPst) | \
FLAG64 (USE_MAbv) | \
FLAG64 (USE_MBlw) | \
FLAG64 (USE_MPst) | \
FLAG64 (USE_MPre) | \
FLAG64 (USE_VAbv) | \
FLAG64 (USE_VBlw) | \
FLAG64 (USE_VPst) | \
FLAG64 (USE_VPre) | \
FLAG64 (USE_VMAbv) | \
FLAG64 (USE_VMBlw) | \
FLAG64 (USE_VMPst) | \
FLAG64 (USE_VMPre))
/* Move things forward. */
if
(
info
[
start
].
use_category
()
==
USE_R
&&
end
-
start
>
1
)
{
/* Got a repha. Reorder it to after first base, before first halant. */
/* Got a repha. Reorder it towards the end, but before the first post-base
* glyph. */
for
(
unsigned
int
i
=
start
+
1
;
i
<
end
;
i
++
)
if
((
FLAG_UNSAFE
(
info
[
i
].
use_category
())
&
(
BASE_FLAGS
))
||
is_halant
(
info
[
i
]))
{
bool
is_post_base_glyph
=
(
FLAG64_UNSAFE
(
info
[
i
].
use_category
())
&
POST_BASE_FLAGS
)
||
is_halant
(
info
[
i
]);
if
(
is_post_base_glyph
||
i
==
end
-
1
)
{
/* If we hit a
halant, move before it; otherwise it's a base: move to it's
*
place, and s
hift things in between backward. */
/* If we hit a
post-base glyph, move before it; otherwise move to the
*
end. S
hift things in between backward. */
if
(
is_
halant
(
info
[
i
])
)
if
(
is_
post_base_glyph
)
i
--
;
buffer
->
merge_clusters
(
start
,
i
+
1
);
...
...
@@ -471,21 +491,19 @@ reorder_syllable (hb_buffer_t *buffer, unsigned int start, unsigned int end)
break
;
}
}
}
/* Move things back. */
unsigned
int
j
=
end
;
unsigned
int
j
=
start
;
for
(
unsigned
int
i
=
start
;
i
<
end
;
i
++
)
{
uint32_t
flag
=
FLAG_UNSAFE
(
info
[
i
].
use_category
());
if
(
(
flag
&
(
BASE_FLAGS
))
||
is_halant
(
info
[
i
]))
if
(
is_halant
(
info
[
i
]))
{
/* If we hit a halant, move after it; otherwise it's a base: move to it's
* place, and shift things in between backward. */
if
(
is_halant
(
info
[
i
]))
j
=
i
+
1
;
else
j
=
i
;
/* If we hit a halant, move after it; otherwise move to the beginning, and
* shift things in between forward. */
j
=
i
+
1
;
}
else
if
(((
flag
)
&
(
FLAG
(
USE_VPre
)
|
FLAG
(
USE_VMPre
)))
&&
/* Only move the first component of a MultipleSubst. */
...
...
src/hb.hh
浏览文件 @
8280459e
...
...
@@ -449,6 +449,8 @@ typedef uint64_t hb_vector_size_impl_t;
#define FLAG(x) (ASSERT_STATIC_EXPR_ZERO ((unsigned int)(x) < 32) + (1U << (unsigned int)(x)))
#define FLAG_UNSAFE(x) ((unsigned int)(x) < 32 ? (1U << (unsigned int)(x)) : 0)
#define FLAG_RANGE(x,y) (ASSERT_STATIC_EXPR_ZERO ((x) < (y)) + FLAG(y+1) - FLAG(x))
#define FLAG64(x) (ASSERT_STATIC_EXPR_ZERO ((unsigned long long)(x) < 64) + (1ULL << (unsigned long long)(x)))
#define FLAG64_UNSAFE(x) ((unsigned long long)(x) < 64 ? (1ULL << (unsigned long long)(x)) : 0)
/* Size signifying variable-sized array */
...
...
test/shaping/data/in-house/fonts/4afb0e8b9a86bb9bd73a1247de4e33fbe3c1fd93.ttf
0 → 100644
浏览文件 @
8280459e
文件已添加
test/shaping/data/in-house/tests/use.tests
浏览文件 @
8280459e
...
...
@@ -9,3 +9,6 @@
../fonts/2a670df15b73a5dc75a5cc491bde5ac93c5077dc.ttf::U+11124,U+11131,U+11134:[u11124=0+514|u11131=0+0|uni25CC=0+547|u11134=0+0]
../fonts/573d3a3177c9a8646e94c8a0d7b224334340946a.ttf:--font-funcs=ft:U+11410,U+11442,U+11411,U+11440,U+11443,U+11410,U+11442,U+11411,U+11441,U+11443:[E_dv.alt=0+275|Ga.icd=0+367|Gha.diag=0@100,0+386|AA_dv.alt=0+208|Candrabindu=0@17,-8+0|E_dv.alt=5+275|Ga.icd=5+367|Gha.diag=5@100,0+386|AU_dv_part.alt=5+213|Candrabindu.sm=5@-52,179+0]
../fonts/dcf774ca21062e7439f98658b18974ea8b956d0c.ttf::U+11328,U+1134D,U+1CF4:[gid1=0+793|gid2=0+0|gid3=0+0]
../fonts/4afb0e8b9a86bb9bd73a1247de4e33fbe3c1fd93.ttf::U+1C00,U+1C27,U+1C28,U+1C34,U+1C35:[uni1C35=0+500|uni1C34=0+500|uni1C28=0+500|uni1C27=0+500|uni1C00=0+500]
../fonts/4afb0e8b9a86bb9bd73a1247de4e33fbe3c1fd93.ttf::U+0D4E,U+0D15,U+0D4D,U+0D15,U+0D46:[uni0D15=0+500|uni0D4E=0+500|uni0D4D=0+500|uni0D46=3+500|uni0D15=3+500]
../fonts/4afb0e8b9a86bb9bd73a1247de4e33fbe3c1fd93.ttf::U+1102D,U+11046,U+11013,U+11046,U+11013,U+11046:[u11013=0+500|u11046_u11013=0+500|u1102D_u11046=0+500|u11046=0+500]
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录