Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
2ec3ba46
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看板
提交
2ec3ba46
编写于
7月 29, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[GSUB/GPOS] Minor
Start squeezing more out of lig_id/lig_comp.
上级
ef6e9cec
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
34 addition
and
7 deletion
+34
-7
src/hb-ot-layout-gsub-table.hh
src/hb-ot-layout-gsub-table.hh
+3
-3
src/hb-ot-layout-private.hh
src/hb-ot-layout-private.hh
+31
-4
未找到文件。
src/hb-ot-layout-gsub-table.hh
浏览文件 @
2ec3ba46
...
@@ -215,7 +215,7 @@ struct Sequence
...
@@ -215,7 +215,7 @@ struct Sequence
unsigned
int
klass
=
c
->
property
&
HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE
?
HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH
:
0
;
unsigned
int
klass
=
c
->
property
&
HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE
?
HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH
:
0
;
unsigned
int
count
=
substitute
.
len
;
unsigned
int
count
=
substitute
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
set_lig_props
(
c
->
buffer
->
cur
(),
0
,
i
);
set_lig_props
_for_component
(
c
->
buffer
->
cur
()
,
i
);
c
->
output_glyph
(
substitute
.
array
[
i
],
klass
);
c
->
output_glyph
(
substitute
.
array
[
i
],
klass
);
}
}
c
->
buffer
->
skip_glyph
();
c
->
buffer
->
skip_glyph
();
...
@@ -512,7 +512,7 @@ struct Ligature
...
@@ -512,7 +512,7 @@ struct Ligature
/* Allocate new ligature id */
/* Allocate new ligature id */
unsigned
int
lig_id
=
is_a_mark_ligature
?
0
:
allocate_lig_id
(
c
->
buffer
);
unsigned
int
lig_id
=
is_a_mark_ligature
?
0
:
allocate_lig_id
(
c
->
buffer
);
if
(
!
is_a_mark_ligature
)
if
(
!
is_a_mark_ligature
)
set_lig_props
(
c
->
buffer
->
cur
(),
lig_id
,
0
);
set_lig_props
_for_ligature
(
c
->
buffer
->
cur
(),
lig_id
,
count
);
if
(
skippy_iter
.
idx
<
c
->
buffer
->
idx
+
count
)
/* No input glyphs skipped */
if
(
skippy_iter
.
idx
<
c
->
buffer
->
idx
+
count
)
/* No input glyphs skipped */
{
{
...
@@ -536,7 +536,7 @@ struct Ligature
...
@@ -536,7 +536,7 @@ struct Ligature
while
(
c
->
should_mark_skip_current_glyph
())
while
(
c
->
should_mark_skip_current_glyph
())
{
{
if
(
!
is_a_mark_ligature
)
if
(
!
is_a_mark_ligature
)
set_lig_props
(
c
->
buffer
->
cur
(),
lig_id
,
i
);
set_lig_props
_for_mark
(
c
->
buffer
->
cur
(),
lig_id
,
i
);
c
->
buffer
->
next_glyph
();
c
->
buffer
->
next_glyph
();
}
}
...
...
src/hb-ot-layout-private.hh
浏览文件 @
2ec3ba46
...
@@ -94,17 +94,44 @@ _hb_ot_layout_skip_mark (hb_face_t *face,
...
@@ -94,17 +94,44 @@ _hb_ot_layout_skip_mark (hb_face_t *face,
static
inline
void
static
inline
void
set_lig_props
(
hb_glyph_info_t
&
info
,
unsigned
int
lig_id
,
unsigned
int
lig_comp
)
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
);
info
.
lig_props
()
=
(
lig_id
<<
5
)
|
(
lig_comp
&
0x0F
);
}
}
static
inline
void
set_lig_props_for_ligature
(
hb_glyph_info_t
&
info
,
unsigned
int
lig_id
,
unsigned
int
lig_num_comps
)
{
info
.
lig_props
()
=
(
lig_id
<<
5
)
|
0x10
|
(
lig_num_comps
&
0x0F
);
}
static
inline
void
set_lig_props_for_mark
(
hb_glyph_info_t
&
info
,
unsigned
int
lig_id
,
unsigned
int
lig_comp
)
{
info
.
lig_props
()
=
(
lig_id
<<
5
)
|
(
lig_comp
&
0x0F
);
}
static
inline
void
set_lig_props_for_component
(
hb_glyph_info_t
&
info
,
unsigned
int
comp
)
{
set_lig_props_for_mark
(
info
,
0
,
comp
);
}
static
inline
unsigned
int
static
inline
unsigned
int
get_lig_id
(
const
hb_glyph_info_t
&
info
)
get_lig_id
(
const
hb_glyph_info_t
&
info
)
{
{
return
info
.
lig_props
()
>>
4
;
return
info
.
lig_props
()
>>
5
;
}
}
static
inline
unsigned
int
static
inline
unsigned
int
get_lig_comp
(
const
hb_glyph_info_t
&
info
)
get_lig_comp
(
const
hb_glyph_info_t
&
info
)
{
{
return
info
.
lig_props
()
&
0x0F
;
if
(
info
.
lig_props
()
&
0x10
)
return
0
;
else
return
info
.
lig_props
()
&
0x0F
;
}
static
inline
unsigned
int
get_lig_num_comps
(
const
hb_glyph_info_t
&
info
)
{
if
(
info
.
lig_props
()
&
0x10
)
return
info
.
lig_props
()
&
0x0F
;
else
return
1
;
}
}
static
inline
bool
static
inline
bool
is_a_ligature
(
const
hb_glyph_info_t
&
info
)
is_a_ligature
(
const
hb_glyph_info_t
&
info
)
...
@@ -113,7 +140,7 @@ is_a_ligature (const hb_glyph_info_t &info)
...
@@ -113,7 +140,7 @@ is_a_ligature (const hb_glyph_info_t &info)
}
}
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
()
&
0x0
F
;
uint8_t
lig_id
=
buffer
->
next_serial
()
&
0x0
7
;
if
(
unlikely
(
!
lig_id
))
if
(
unlikely
(
!
lig_id
))
lig_id
=
allocate_lig_id
(
buffer
);
/* in case of overflow */
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录