Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
a9844d41
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看板
提交
a9844d41
编写于
5月 09, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Combine lig_id and lig_comp into one byte, to free up one for Indic
上级
92332e51
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
34 addition
and
17 deletion
+34
-17
src/hb-ot-layout-gpos-table.hh
src/hb-ot-layout-gpos-table.hh
+8
-6
src/hb-ot-layout-gsub-table.hh
src/hb-ot-layout-gsub-table.hh
+4
-7
src/hb-ot-layout-gsubgpos-private.hh
src/hb-ot-layout-gsubgpos-private.hh
+22
-4
未找到文件。
src/hb-ot-layout-gpos-table.hh
浏览文件 @
a9844d41
...
@@ -1105,9 +1105,11 @@ struct MarkLigPosFormat1
...
@@ -1105,9 +1105,11 @@ struct MarkLigPosFormat1
* is identical to the ligature ID of the found ligature. If yes, we
* is identical to the ligature ID of the found ligature. If yes, we
* can directly use the component index. If not, we attach the mark
* can directly use the component index. If not, we attach the mark
* glyph to the last component of the ligature. */
* glyph to the last component of the ligature. */
if
(
c
->
buffer
->
info
[
j
].
lig_id
()
&&
c
->
buffer
->
info
[
j
].
lig_id
()
==
c
->
buffer
->
info
[
c
->
buffer
->
idx
].
lig_id
()
&&
c
->
buffer
->
info
[
c
->
buffer
->
idx
].
lig_comp
())
if
(
get_lig_id
(
c
->
buffer
->
info
[
j
])
&&
get_lig_id
(
c
->
buffer
->
info
[
j
])
==
get_lig_id
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
])
&&
get_lig_comp
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
])
>
0
)
{
{
comp_index
=
c
->
buffer
->
info
[
c
->
buffer
->
idx
].
lig_comp
(
)
-
1
;
comp_index
=
get_lig_comp
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
)
-
1
;
if
(
comp_index
>=
comp_count
)
if
(
comp_index
>=
comp_count
)
comp_index
=
comp_count
-
1
;
comp_index
=
comp_count
-
1
;
}
}
...
@@ -1208,8 +1210,9 @@ struct MarkMarkPosFormat1
...
@@ -1208,8 +1210,9 @@ struct MarkMarkPosFormat1
/* Two marks match only if they belong to the same base, or same component
/* Two marks match only if they belong to the same base, or same component
* of the same ligature. That is, the component numbers must match, and
* of the same ligature. That is, the component numbers must match, and
* if those are non-zero, the ligid number should also match. */
* if those are non-zero, the ligid number should also match. */
if
((
c
->
buffer
->
info
[
j
].
lig_comp
()
!=
c
->
buffer
->
info
[
c
->
buffer
->
idx
].
lig_comp
())
||
if
((
get_lig_comp
(
c
->
buffer
->
info
[
j
])
!=
get_lig_comp
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]))
||
(
c
->
buffer
->
info
[
j
].
lig_comp
()
&&
c
->
buffer
->
info
[
j
].
lig_id
()
!=
c
->
buffer
->
info
[
c
->
buffer
->
idx
].
lig_id
()))
(
get_lig_comp
(
c
->
buffer
->
info
[
j
])
>
0
&&
get_lig_id
(
c
->
buffer
->
info
[
j
])
!=
get_lig_id
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
])))
return
false
;
return
false
;
unsigned
int
mark2_index
=
(
this
+
mark2Coverage
)
(
c
->
buffer
->
info
[
j
].
codepoint
);
unsigned
int
mark2_index
=
(
this
+
mark2Coverage
)
(
c
->
buffer
->
info
[
j
].
codepoint
);
...
@@ -1545,8 +1548,7 @@ GPOS::position_finish (hb_buffer_t *buffer)
...
@@ -1545,8 +1548,7 @@ GPOS::position_finish (hb_buffer_t *buffer)
for
(
unsigned
int
i
=
0
;
i
<
len
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
len
;
i
++
)
fix_mark_attachment
(
pos
,
i
,
direction
);
fix_mark_attachment
(
pos
,
i
,
direction
);
HB_BUFFER_DEALLOCATE_VAR
(
buffer
,
lig_comp
);
HB_BUFFER_DEALLOCATE_VAR
(
buffer
,
lig_props
);
HB_BUFFER_DEALLOCATE_VAR
(
buffer
,
lig_id
);
HB_BUFFER_DEALLOCATE_VAR
(
buffer
,
props_cache
);
HB_BUFFER_DEALLOCATE_VAR
(
buffer
,
props_cache
);
}
}
...
...
src/hb-ot-layout-gsub-table.hh
浏览文件 @
a9844d41
...
@@ -516,8 +516,7 @@ struct Ligature
...
@@ -516,8 +516,7 @@ struct Ligature
/* Allocate new ligature id */
/* Allocate new ligature id */
unsigned
int
lig_id
=
allocate_lig_id
(
c
->
buffer
);
unsigned
int
lig_id
=
allocate_lig_id
(
c
->
buffer
);
c
->
buffer
->
info
[
c
->
buffer
->
idx
].
lig_comp
()
=
0
;
set_lig_props
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
],
lig_id
,
0
);
c
->
buffer
->
info
[
c
->
buffer
->
idx
].
lig_id
()
=
lig_id
;
if
(
skippy_iter
.
idx
<
c
->
buffer
->
idx
+
count
)
/* No input glyphs skipped */
if
(
skippy_iter
.
idx
<
c
->
buffer
->
idx
+
count
)
/* No input glyphs skipped */
{
{
...
@@ -538,8 +537,7 @@ struct Ligature
...
@@ -538,8 +537,7 @@ struct Ligature
{
{
while
(
c
->
should_mark_skip_current_glyph
())
while
(
c
->
should_mark_skip_current_glyph
())
{
{
c
->
buffer
->
info
[
c
->
buffer
->
idx
].
lig_comp
()
=
i
;
set_lig_props
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
],
lig_id
,
i
);
c
->
buffer
->
info
[
c
->
buffer
->
idx
].
lig_id
()
=
lig_id
;
c
->
replace_glyph
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
].
codepoint
);
c
->
replace_glyph
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
].
codepoint
);
}
}
...
@@ -1193,12 +1191,11 @@ void
...
@@ -1193,12 +1191,11 @@ void
GSUB
::
substitute_start
(
hb_buffer_t
*
buffer
)
GSUB
::
substitute_start
(
hb_buffer_t
*
buffer
)
{
{
HB_BUFFER_ALLOCATE_VAR
(
buffer
,
props_cache
);
HB_BUFFER_ALLOCATE_VAR
(
buffer
,
props_cache
);
HB_BUFFER_ALLOCATE_VAR
(
buffer
,
lig_id
);
HB_BUFFER_ALLOCATE_VAR
(
buffer
,
lig_props
);
HB_BUFFER_ALLOCATE_VAR
(
buffer
,
lig_comp
);
unsigned
int
count
=
buffer
->
len
;
unsigned
int
count
=
buffer
->
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
buffer
->
info
[
i
].
props_cache
()
=
buffer
->
info
[
i
].
lig_
id
()
=
buffer
->
info
[
i
].
lig_comp
()
=
0
;
buffer
->
info
[
i
].
props_cache
()
=
buffer
->
info
[
i
].
lig_
props
()
=
0
;
}
}
void
void
...
...
src/hb-ot-layout-gsubgpos-private.hh
浏览文件 @
a9844d41
...
@@ -35,12 +35,30 @@
...
@@ -35,12 +35,30 @@
/* buffer var allocations */
/* buffer var allocations */
#define lig_id() var2.u8[2]
/* unique ligature id */
#define lig_props() var2.u8[3]
#define lig_comp() var2.u8[3]
/* component number in the ligature (0 = base) */
/* unique ligature id */
/* component number in the ligature (0 = base) */
static
inline
void
set_lig_props
(
hb_glyph_info_t
&
info
,
unsigned
int
lig_id
,
unsigned
int
lig_comp
)
{
info
.
lig_props
()
=
(
lig_id
<<
4
)
|
(
lig_comp
&
0x0F
);
}
static
inline
unsigned
int
get_lig_id
(
hb_glyph_info_t
&
info
)
{
return
info
.
lig_props
()
>>
4
;
}
static
inline
unsigned
int
get_lig_comp
(
hb_glyph_info_t
&
info
)
{
return
info
.
lig_props
()
&
0x0F
;
}
static
inline
uint8_t
allocate_lig_id
(
hb_buffer_t
*
buffer
)
{
static
inline
uint8_t
allocate_lig_id
(
hb_buffer_t
*
buffer
)
{
uint8_t
lig_id
=
buffer
->
next_serial
();
uint8_t
lig_id
=
buffer
->
next_serial
()
&
0x0F
;
if
(
unlikely
(
!
lig_id
))
lig_id
=
buffer
->
next_serial
();
/* in case of overflow */
if
(
unlikely
(
!
lig_id
))
lig_id
=
allocate_lig_id
(
buffer
);
/* in case of overflow */
return
lig_id
;
return
lig_id
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录