Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
7e7007a1
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看板
提交
7e7007a1
编写于
5月 14, 2010
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Shortening buffer accessors: rename buffer->in_string to buffer->info
上级
8e6b6bb2
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
108 addition
and
108 deletion
+108
-108
src/hb-buffer-private.hh
src/hb-buffer-private.hh
+1
-1
src/hb-buffer.cc
src/hb-buffer.cc
+41
-41
src/hb-ot-layout-gpos-private.hh
src/hb-ot-layout-gpos-private.hh
+29
-29
src/hb-ot-layout-gsub-private.hh
src/hb-ot-layout-gsub-private.hh
+15
-15
src/hb-ot-layout-gsubgpos-private.hh
src/hb-ot-layout-gsubgpos-private.hh
+13
-13
src/hb-shape.cc
src/hb-shape.cc
+9
-9
未找到文件。
src/hb-buffer-private.hh
浏览文件 @
7e7007a1
...
@@ -114,7 +114,7 @@ struct _hb_buffer_t {
...
@@ -114,7 +114,7 @@ struct _hb_buffer_t {
unsigned
int
out_length
;
unsigned
int
out_length
;
unsigned
int
in_pos
;
unsigned
int
in_pos
;
hb_internal_glyph_info_t
*
in
_string
;
hb_internal_glyph_info_t
*
in
fo
;
hb_internal_glyph_info_t
*
out_string
;
hb_internal_glyph_info_t
*
out_string
;
hb_internal_glyph_position_t
*
positions
;
hb_internal_glyph_position_t
*
positions
;
...
...
src/hb-buffer.cc
浏览文件 @
7e7007a1
...
@@ -38,20 +38,20 @@ static hb_buffer_t _hb_buffer_nil = {
...
@@ -38,20 +38,20 @@ static hb_buffer_t _hb_buffer_nil = {
/* Here is how the buffer works internally:
/* Here is how the buffer works internally:
*
*
* There are two string pointers: in
_string
and out_string. They
* There are two string pointers: in
fo
and out_string. They
* always have same allocated size, but different length and positions.
* always have same allocated size, but different length and positions.
*
*
* As an optimization, both in
_string
and out_string may point to the
* As an optimization, both in
fo
and out_string may point to the
* same piece of memory, which is owned by in
_string
. This remains the
* same piece of memory, which is owned by in
fo
. This remains the
* case as long as out_length doesn't exceed in_length at any time.
* case as long as out_length doesn't exceed in_length at any time.
* In that case, swap() is no-op and the glyph operations operate mostly
* In that case, swap() is no-op and the glyph operations operate mostly
* in-place.
* in-place.
*
*
* As soon as out_string gets longer than in
_string
, out_string is moved over
* As soon as out_string gets longer than in
fo
, out_string is moved over
* to an alternate buffer (which we reuse the positions buffer for!), and its
* to an alternate buffer (which we reuse the positions buffer for!), and its
* current contents (out_length entries) are copied to the alt buffer.
* current contents (out_length entries) are copied to the alt buffer.
* This should all remain transparent to the user. swap() then switches
* This should all remain transparent to the user. swap() then switches
* in
_string
and out_string.
* in
fo
and out_string.
*/
*/
/* XXX err handling */
/* XXX err handling */
...
@@ -62,14 +62,14 @@ static void
...
@@ -62,14 +62,14 @@ static void
hb_buffer_ensure_separate
(
hb_buffer_t
*
buffer
,
unsigned
int
size
)
hb_buffer_ensure_separate
(
hb_buffer_t
*
buffer
,
unsigned
int
size
)
{
{
hb_buffer_ensure
(
buffer
,
size
);
hb_buffer_ensure
(
buffer
,
size
);
if
(
buffer
->
out_string
==
buffer
->
in
_string
)
if
(
buffer
->
out_string
==
buffer
->
in
fo
)
{
{
assert
(
buffer
->
have_output
);
assert
(
buffer
->
have_output
);
if
(
!
buffer
->
positions
)
if
(
!
buffer
->
positions
)
buffer
->
positions
=
(
hb_internal_glyph_position_t
*
)
calloc
(
buffer
->
allocated
,
sizeof
(
buffer
->
positions
[
0
]));
buffer
->
positions
=
(
hb_internal_glyph_position_t
*
)
calloc
(
buffer
->
allocated
,
sizeof
(
buffer
->
positions
[
0
]));
buffer
->
out_string
=
(
hb_internal_glyph_info_t
*
)
buffer
->
positions
;
buffer
->
out_string
=
(
hb_internal_glyph_info_t
*
)
buffer
->
positions
;
memcpy
(
buffer
->
out_string
,
buffer
->
in
_string
,
buffer
->
out_length
*
sizeof
(
buffer
->
out_string
[
0
]));
memcpy
(
buffer
->
out_string
,
buffer
->
in
fo
,
buffer
->
out_length
*
sizeof
(
buffer
->
out_string
[
0
]));
}
}
}
}
...
@@ -110,7 +110,7 @@ hb_buffer_destroy (hb_buffer_t *buffer)
...
@@ -110,7 +110,7 @@ hb_buffer_destroy (hb_buffer_t *buffer)
hb_unicode_funcs_destroy
(
buffer
->
unicode
);
hb_unicode_funcs_destroy
(
buffer
->
unicode
);
free
(
buffer
->
in
_string
);
free
(
buffer
->
in
fo
);
free
(
buffer
->
positions
);
free
(
buffer
->
positions
);
free
(
buffer
);
free
(
buffer
);
...
@@ -184,7 +184,7 @@ hb_buffer_clear (hb_buffer_t *buffer)
...
@@ -184,7 +184,7 @@ hb_buffer_clear (hb_buffer_t *buffer)
buffer
->
in_length
=
0
;
buffer
->
in_length
=
0
;
buffer
->
out_length
=
0
;
buffer
->
out_length
=
0
;
buffer
->
in_pos
=
0
;
buffer
->
in_pos
=
0
;
buffer
->
out_string
=
buffer
->
in
_string
;
buffer
->
out_string
=
buffer
->
in
fo
;
buffer
->
max_lig_id
=
0
;
buffer
->
max_lig_id
=
0
;
}
}
...
@@ -201,15 +201,15 @@ hb_buffer_ensure (hb_buffer_t *buffer, unsigned int size)
...
@@ -201,15 +201,15 @@ hb_buffer_ensure (hb_buffer_t *buffer, unsigned int size)
if
(
buffer
->
positions
)
if
(
buffer
->
positions
)
buffer
->
positions
=
(
hb_internal_glyph_position_t
*
)
realloc
(
buffer
->
positions
,
new_allocated
*
sizeof
(
buffer
->
positions
[
0
]));
buffer
->
positions
=
(
hb_internal_glyph_position_t
*
)
realloc
(
buffer
->
positions
,
new_allocated
*
sizeof
(
buffer
->
positions
[
0
]));
if
(
buffer
->
out_string
!=
buffer
->
in
_string
)
if
(
buffer
->
out_string
!=
buffer
->
in
fo
)
{
{
buffer
->
in
_string
=
(
hb_internal_glyph_info_t
*
)
realloc
(
buffer
->
in_string
,
new_allocated
*
sizeof
(
buffer
->
in_string
[
0
]));
buffer
->
in
fo
=
(
hb_internal_glyph_info_t
*
)
realloc
(
buffer
->
info
,
new_allocated
*
sizeof
(
buffer
->
info
[
0
]));
buffer
->
out_string
=
(
hb_internal_glyph_info_t
*
)
buffer
->
positions
;
buffer
->
out_string
=
(
hb_internal_glyph_info_t
*
)
buffer
->
positions
;
}
}
else
else
{
{
buffer
->
in
_string
=
(
hb_internal_glyph_info_t
*
)
realloc
(
buffer
->
in_string
,
new_allocated
*
sizeof
(
buffer
->
in_string
[
0
]));
buffer
->
in
fo
=
(
hb_internal_glyph_info_t
*
)
realloc
(
buffer
->
info
,
new_allocated
*
sizeof
(
buffer
->
info
[
0
]));
buffer
->
out_string
=
buffer
->
in
_string
;
buffer
->
out_string
=
buffer
->
in
fo
;
}
}
buffer
->
allocated
=
new_allocated
;
buffer
->
allocated
=
new_allocated
;
...
@@ -226,7 +226,7 @@ hb_buffer_add_glyph (hb_buffer_t *buffer,
...
@@ -226,7 +226,7 @@ hb_buffer_add_glyph (hb_buffer_t *buffer,
hb_buffer_ensure
(
buffer
,
buffer
->
in_length
+
1
);
hb_buffer_ensure
(
buffer
,
buffer
->
in_length
+
1
);
glyph
=
&
buffer
->
in
_string
[
buffer
->
in_length
];
glyph
=
&
buffer
->
in
fo
[
buffer
->
in_length
];
glyph
->
codepoint
=
codepoint
;
glyph
->
codepoint
=
codepoint
;
glyph
->
mask
=
mask
;
glyph
->
mask
=
mask
;
glyph
->
cluster
=
cluster
;
glyph
->
cluster
=
cluster
;
...
@@ -246,7 +246,7 @@ _hb_buffer_clear_output (hb_buffer_t *buffer)
...
@@ -246,7 +246,7 @@ _hb_buffer_clear_output (hb_buffer_t *buffer)
buffer
->
have_output
=
TRUE
;
buffer
->
have_output
=
TRUE
;
buffer
->
have_positions
=
FALSE
;
buffer
->
have_positions
=
FALSE
;
buffer
->
out_length
=
0
;
buffer
->
out_length
=
0
;
buffer
->
out_string
=
buffer
->
in
_string
;
buffer
->
out_string
=
buffer
->
in
fo
;
}
}
void
void
...
@@ -272,11 +272,11 @@ _hb_buffer_swap (hb_buffer_t *buffer)
...
@@ -272,11 +272,11 @@ _hb_buffer_swap (hb_buffer_t *buffer)
assert
(
buffer
->
have_output
);
assert
(
buffer
->
have_output
);
if
(
buffer
->
out_string
!=
buffer
->
in
_string
)
if
(
buffer
->
out_string
!=
buffer
->
in
fo
)
{
{
hb_internal_glyph_info_t
*
tmp_string
;
hb_internal_glyph_info_t
*
tmp_string
;
tmp_string
=
buffer
->
in
_string
;
tmp_string
=
buffer
->
in
fo
;
buffer
->
in
_string
=
buffer
->
out_string
;
buffer
->
in
fo
=
buffer
->
out_string
;
buffer
->
out_string
=
tmp_string
;
buffer
->
out_string
=
tmp_string
;
buffer
->
positions
=
(
hb_internal_glyph_position_t
*
)
buffer
->
out_string
;
buffer
->
positions
=
(
hb_internal_glyph_position_t
*
)
buffer
->
out_string
;
}
}
...
@@ -320,18 +320,18 @@ _hb_buffer_add_output_glyphs (hb_buffer_t *buffer,
...
@@ -320,18 +320,18 @@ _hb_buffer_add_output_glyphs (hb_buffer_t *buffer,
unsigned
int
mask
;
unsigned
int
mask
;
unsigned
int
cluster
;
unsigned
int
cluster
;
if
(
buffer
->
out_string
!=
buffer
->
in
_string
||
if
(
buffer
->
out_string
!=
buffer
->
in
fo
||
buffer
->
out_length
+
num_out
>
buffer
->
in_pos
+
num_in
)
buffer
->
out_length
+
num_out
>
buffer
->
in_pos
+
num_in
)
{
{
hb_buffer_ensure_separate
(
buffer
,
buffer
->
out_length
+
num_out
);
hb_buffer_ensure_separate
(
buffer
,
buffer
->
out_length
+
num_out
);
}
}
mask
=
buffer
->
in
_string
[
buffer
->
in_pos
].
mask
;
mask
=
buffer
->
in
fo
[
buffer
->
in_pos
].
mask
;
cluster
=
buffer
->
in
_string
[
buffer
->
in_pos
].
cluster
;
cluster
=
buffer
->
in
fo
[
buffer
->
in_pos
].
cluster
;
if
(
component
==
0xFFFF
)
if
(
component
==
0xFFFF
)
component
=
buffer
->
in
_string
[
buffer
->
in_pos
].
component
;
component
=
buffer
->
in
fo
[
buffer
->
in_pos
].
component
;
if
(
lig_id
==
0xFFFF
)
if
(
lig_id
==
0xFFFF
)
lig_id
=
buffer
->
in
_string
[
buffer
->
in_pos
].
lig_id
;
lig_id
=
buffer
->
in
fo
[
buffer
->
in_pos
].
lig_id
;
for
(
i
=
0
;
i
<
num_out
;
i
++
)
for
(
i
=
0
;
i
<
num_out
;
i
++
)
{
{
...
@@ -360,18 +360,18 @@ _hb_buffer_add_output_glyphs_be16 (hb_buffer_t *buffer,
...
@@ -360,18 +360,18 @@ _hb_buffer_add_output_glyphs_be16 (hb_buffer_t *buffer,
unsigned
int
mask
;
unsigned
int
mask
;
unsigned
int
cluster
;
unsigned
int
cluster
;
if
(
buffer
->
out_string
!=
buffer
->
in
_string
||
if
(
buffer
->
out_string
!=
buffer
->
in
fo
||
buffer
->
out_length
+
num_out
>
buffer
->
in_pos
+
num_in
)
buffer
->
out_length
+
num_out
>
buffer
->
in_pos
+
num_in
)
{
{
hb_buffer_ensure_separate
(
buffer
,
buffer
->
out_length
+
num_out
);
hb_buffer_ensure_separate
(
buffer
,
buffer
->
out_length
+
num_out
);
}
}
mask
=
buffer
->
in
_string
[
buffer
->
in_pos
].
mask
;
mask
=
buffer
->
in
fo
[
buffer
->
in_pos
].
mask
;
cluster
=
buffer
->
in
_string
[
buffer
->
in_pos
].
cluster
;
cluster
=
buffer
->
in
fo
[
buffer
->
in_pos
].
cluster
;
if
(
component
==
0xFFFF
)
if
(
component
==
0xFFFF
)
component
=
buffer
->
in
_string
[
buffer
->
in_pos
].
component
;
component
=
buffer
->
in
fo
[
buffer
->
in_pos
].
component
;
if
(
lig_id
==
0xFFFF
)
if
(
lig_id
==
0xFFFF
)
lig_id
=
buffer
->
in
_string
[
buffer
->
in_pos
].
lig_id
;
lig_id
=
buffer
->
in
fo
[
buffer
->
in_pos
].
lig_id
;
for
(
i
=
0
;
i
<
num_out
;
i
++
)
for
(
i
=
0
;
i
<
num_out
;
i
++
)
{
{
...
@@ -396,13 +396,13 @@ _hb_buffer_add_output_glyph (hb_buffer_t *buffer,
...
@@ -396,13 +396,13 @@ _hb_buffer_add_output_glyph (hb_buffer_t *buffer,
{
{
hb_internal_glyph_info_t
*
info
;
hb_internal_glyph_info_t
*
info
;
if
(
buffer
->
out_string
!=
buffer
->
in
_string
)
if
(
buffer
->
out_string
!=
buffer
->
in
fo
)
{
{
hb_buffer_ensure
(
buffer
,
buffer
->
out_length
+
1
);
hb_buffer_ensure
(
buffer
,
buffer
->
out_length
+
1
);
buffer
->
out_string
[
buffer
->
out_length
]
=
buffer
->
in
_string
[
buffer
->
in_pos
];
buffer
->
out_string
[
buffer
->
out_length
]
=
buffer
->
in
fo
[
buffer
->
in_pos
];
}
}
else
if
(
buffer
->
out_length
!=
buffer
->
in_pos
)
else
if
(
buffer
->
out_length
!=
buffer
->
in_pos
)
buffer
->
out_string
[
buffer
->
out_length
]
=
buffer
->
in
_string
[
buffer
->
in_pos
];
buffer
->
out_string
[
buffer
->
out_length
]
=
buffer
->
in
fo
[
buffer
->
in_pos
];
info
=
&
buffer
->
out_string
[
buffer
->
out_length
];
info
=
&
buffer
->
out_string
[
buffer
->
out_length
];
info
->
codepoint
=
glyph_index
;
info
->
codepoint
=
glyph_index
;
...
@@ -421,13 +421,13 @@ _hb_buffer_next_glyph (hb_buffer_t *buffer)
...
@@ -421,13 +421,13 @@ _hb_buffer_next_glyph (hb_buffer_t *buffer)
{
{
if
(
buffer
->
have_output
)
if
(
buffer
->
have_output
)
{
{
if
(
buffer
->
out_string
!=
buffer
->
in
_string
)
if
(
buffer
->
out_string
!=
buffer
->
in
fo
)
{
{
hb_buffer_ensure
(
buffer
,
buffer
->
out_length
+
1
);
hb_buffer_ensure
(
buffer
,
buffer
->
out_length
+
1
);
buffer
->
out_string
[
buffer
->
out_length
]
=
buffer
->
in
_string
[
buffer
->
in_pos
];
buffer
->
out_string
[
buffer
->
out_length
]
=
buffer
->
in
fo
[
buffer
->
in_pos
];
}
}
else
if
(
buffer
->
out_length
!=
buffer
->
in_pos
)
else
if
(
buffer
->
out_length
!=
buffer
->
in_pos
)
buffer
->
out_string
[
buffer
->
out_length
]
=
buffer
->
in
_string
[
buffer
->
in_pos
];
buffer
->
out_string
[
buffer
->
out_length
]
=
buffer
->
in
fo
[
buffer
->
in_pos
];
buffer
->
out_length
++
;
buffer
->
out_length
++
;
}
}
...
@@ -446,7 +446,7 @@ hb_buffer_get_length (hb_buffer_t *buffer)
...
@@ -446,7 +446,7 @@ hb_buffer_get_length (hb_buffer_t *buffer)
hb_glyph_info_t
*
hb_glyph_info_t
*
hb_buffer_get_glyph_infos
(
hb_buffer_t
*
buffer
)
hb_buffer_get_glyph_infos
(
hb_buffer_t
*
buffer
)
{
{
return
(
hb_glyph_info_t
*
)
buffer
->
in
_string
;
return
(
hb_glyph_info_t
*
)
buffer
->
in
fo
;
}
}
/* Return value valid as long as buffer not modified */
/* Return value valid as long as buffer not modified */
...
@@ -470,9 +470,9 @@ reverse_range (hb_buffer_t *buffer,
...
@@ -470,9 +470,9 @@ reverse_range (hb_buffer_t *buffer,
for
(
i
=
start
,
j
=
end
-
1
;
i
<
j
;
i
++
,
j
--
)
{
for
(
i
=
start
,
j
=
end
-
1
;
i
<
j
;
i
++
,
j
--
)
{
hb_internal_glyph_info_t
t
;
hb_internal_glyph_info_t
t
;
t
=
buffer
->
in
_string
[
i
];
t
=
buffer
->
in
fo
[
i
];
buffer
->
in
_string
[
i
]
=
buffer
->
in_string
[
j
];
buffer
->
in
fo
[
i
]
=
buffer
->
info
[
j
];
buffer
->
in
_string
[
j
]
=
t
;
buffer
->
in
fo
[
j
]
=
t
;
}
}
if
(
buffer
->
positions
)
{
if
(
buffer
->
positions
)
{
...
@@ -507,12 +507,12 @@ hb_buffer_reverse_clusters (hb_buffer_t *buffer)
...
@@ -507,12 +507,12 @@ hb_buffer_reverse_clusters (hb_buffer_t *buffer)
count
=
buffer
->
in_length
;
count
=
buffer
->
in_length
;
start
=
0
;
start
=
0
;
last_cluster
=
buffer
->
in
_string
[
0
].
cluster
;
last_cluster
=
buffer
->
in
fo
[
0
].
cluster
;
for
(
i
=
1
;
i
<
count
;
i
++
)
{
for
(
i
=
1
;
i
<
count
;
i
++
)
{
if
(
last_cluster
!=
buffer
->
in
_string
[
i
].
cluster
)
{
if
(
last_cluster
!=
buffer
->
in
fo
[
i
].
cluster
)
{
reverse_range
(
buffer
,
start
,
i
);
reverse_range
(
buffer
,
start
,
i
);
start
=
i
;
start
=
i
;
last_cluster
=
buffer
->
in
_string
[
i
].
cluster
;
last_cluster
=
buffer
->
in
fo
[
i
].
cluster
;
}
}
}
}
reverse_range
(
buffer
,
start
,
i
);
reverse_range
(
buffer
,
start
,
i
);
...
...
src/hb-ot-layout-gpos-private.hh
浏览文件 @
7e7007a1
...
@@ -399,8 +399,8 @@ struct MarkArray : ArrayOf<MarkRecord> /* Array of MarkRecords--in Coverage orde
...
@@ -399,8 +399,8 @@ struct MarkArray : ArrayOf<MarkRecord> /* Array of MarkRecords--in Coverage orde
hb_position_t
mark_x
,
mark_y
,
base_x
,
base_y
;
hb_position_t
mark_x
,
mark_y
,
base_x
,
base_y
;
mark_anchor
.
get_anchor
(
c
->
layout
,
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
codepoint
,
&
mark_x
,
&
mark_y
);
mark_anchor
.
get_anchor
(
c
->
layout
,
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
codepoint
,
&
mark_x
,
&
mark_y
);
glyph_anchor
.
get_anchor
(
c
->
layout
,
c
->
buffer
->
in
_string
[
glyph_pos
].
codepoint
,
&
base_x
,
&
base_y
);
glyph_anchor
.
get_anchor
(
c
->
layout
,
c
->
buffer
->
in
fo
[
glyph_pos
].
codepoint
,
&
base_x
,
&
base_y
);
hb_internal_glyph_position_t
&
o
=
c
->
buffer
->
positions
[
c
->
buffer
->
in_pos
];
hb_internal_glyph_position_t
&
o
=
c
->
buffer
->
positions
[
c
->
buffer
->
in_pos
];
o
.
x_advance
=
0
;
o
.
x_advance
=
0
;
...
@@ -430,7 +430,7 @@ struct SinglePosFormat1
...
@@ -430,7 +430,7 @@ struct SinglePosFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
();
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
if
(
likely
(
index
==
NOT_COVERED
))
return
false
;
return
false
;
...
@@ -469,7 +469,7 @@ struct SinglePosFormat2
...
@@ -469,7 +469,7 @@ struct SinglePosFormat2
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
();
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
if
(
likely
(
index
==
NOT_COVERED
))
return
false
;
return
false
;
...
@@ -570,7 +570,7 @@ struct PairSet
...
@@ -570,7 +570,7 @@ struct PairSet
const
PairValueRecord
*
record
=
CastP
<
PairValueRecord
>
(
array
);
const
PairValueRecord
*
record
=
CastP
<
PairValueRecord
>
(
array
);
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
{
if
(
c
->
buffer
->
in
_string
[
pos
].
codepoint
==
record
->
secondGlyph
)
if
(
c
->
buffer
->
in
fo
[
pos
].
codepoint
==
record
->
secondGlyph
)
{
{
valueFormats
[
0
].
apply_value
(
c
->
layout
,
this
,
&
record
->
values
[
0
],
c
->
buffer
->
positions
[
c
->
buffer
->
in_pos
]);
valueFormats
[
0
].
apply_value
(
c
->
layout
,
this
,
&
record
->
values
[
0
],
c
->
buffer
->
positions
[
c
->
buffer
->
in_pos
]);
valueFormats
[
1
].
apply_value
(
c
->
layout
,
this
,
&
record
->
values
[
len1
],
c
->
buffer
->
positions
[
pos
]);
valueFormats
[
1
].
apply_value
(
c
->
layout
,
this
,
&
record
->
values
[
len1
],
c
->
buffer
->
positions
[
pos
]);
...
@@ -623,12 +623,12 @@ struct PairPosFormat1
...
@@ -623,12 +623,12 @@ struct PairPosFormat1
if
(
unlikely
(
c
->
buffer
->
in_pos
+
2
>
end
))
if
(
unlikely
(
c
->
buffer
->
in_pos
+
2
>
end
))
return
false
;
return
false
;
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
if
(
likely
(
index
==
NOT_COVERED
))
return
false
;
return
false
;
unsigned
int
j
=
c
->
buffer
->
in_pos
+
1
;
unsigned
int
j
=
c
->
buffer
->
in_pos
+
1
;
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
in
_string
[
j
],
c
->
lookup_flag
,
NULL
))
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
in
fo
[
j
],
c
->
lookup_flag
,
NULL
))
{
{
if
(
unlikely
(
j
==
end
))
if
(
unlikely
(
j
==
end
))
return
false
;
return
false
;
...
@@ -685,12 +685,12 @@ struct PairPosFormat2
...
@@ -685,12 +685,12 @@ struct PairPosFormat2
if
(
unlikely
(
c
->
buffer
->
in_pos
+
2
>
end
))
if
(
unlikely
(
c
->
buffer
->
in_pos
+
2
>
end
))
return
false
;
return
false
;
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
if
(
likely
(
index
==
NOT_COVERED
))
return
false
;
return
false
;
unsigned
int
j
=
c
->
buffer
->
in_pos
+
1
;
unsigned
int
j
=
c
->
buffer
->
in_pos
+
1
;
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
in
_string
[
j
],
c
->
lookup_flag
,
NULL
))
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
in
fo
[
j
],
c
->
lookup_flag
,
NULL
))
{
{
if
(
unlikely
(
j
==
end
))
if
(
unlikely
(
j
==
end
))
return
false
;
return
false
;
...
@@ -701,8 +701,8 @@ struct PairPosFormat2
...
@@ -701,8 +701,8 @@ struct PairPosFormat2
unsigned
int
len2
=
valueFormat2
.
get_len
();
unsigned
int
len2
=
valueFormat2
.
get_len
();
unsigned
int
record_len
=
len1
+
len2
;
unsigned
int
record_len
=
len1
+
len2
;
unsigned
int
klass1
=
(
this
+
classDef1
)
(
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
codepoint
);
unsigned
int
klass1
=
(
this
+
classDef1
)
(
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
codepoint
);
unsigned
int
klass2
=
(
this
+
classDef2
)
(
c
->
buffer
->
in
_string
[
j
].
codepoint
);
unsigned
int
klass2
=
(
this
+
classDef2
)
(
c
->
buffer
->
in
fo
[
j
].
codepoint
);
if
(
unlikely
(
klass1
>=
class1Count
||
klass2
>=
class2Count
))
if
(
unlikely
(
klass1
>=
class1Count
||
klass2
>=
class2Count
))
return
false
;
return
false
;
...
@@ -954,7 +954,7 @@ struct CursivePosFormat1
...
@@ -954,7 +954,7 @@ struct CursivePosFormat1
if
(
c
->
property
==
HB_OT_LAYOUT_GLYPH_CLASS_MARK
)
if
(
c
->
property
==
HB_OT_LAYOUT_GLYPH_CLASS_MARK
)
return
false
;
return
false
;
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
if
(
likely
(
index
==
NOT_COVERED
))
return
false
;
return
false
;
...
@@ -964,7 +964,7 @@ struct CursivePosFormat1
...
@@ -964,7 +964,7 @@ struct CursivePosFormat1
goto
end
;
goto
end
;
hb_position_t
entry_x
,
entry_y
;
hb_position_t
entry_x
,
entry_y
;
(
this
+
record
.
entryAnchor
).
get_anchor
(
c
->
layout
,
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
codepoint
,
&
entry_x
,
&
entry_y
);
(
this
+
record
.
entryAnchor
).
get_anchor
(
c
->
layout
,
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
codepoint
,
&
entry_x
,
&
entry_y
);
/* TODO vertical */
/* TODO vertical */
...
@@ -994,7 +994,7 @@ struct CursivePosFormat1
...
@@ -994,7 +994,7 @@ struct CursivePosFormat1
if
(
record
.
exitAnchor
)
if
(
record
.
exitAnchor
)
{
{
gpi
->
last
=
c
->
buffer
->
in_pos
;
gpi
->
last
=
c
->
buffer
->
in_pos
;
(
this
+
record
.
exitAnchor
).
get_anchor
(
c
->
layout
,
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
codepoint
,
&
gpi
->
anchor_x
,
&
gpi
->
anchor_y
);
(
this
+
record
.
exitAnchor
).
get_anchor
(
c
->
layout
,
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
codepoint
,
&
gpi
->
anchor_x
,
&
gpi
->
anchor_y
);
}
}
c
->
buffer
->
in_pos
++
;
c
->
buffer
->
in_pos
++
;
...
@@ -1063,7 +1063,7 @@ struct MarkBasePosFormat1
...
@@ -1063,7 +1063,7 @@ struct MarkBasePosFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
();
unsigned
int
mark_index
=
(
this
+
markCoverage
)
(
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
codepoint
);
unsigned
int
mark_index
=
(
this
+
markCoverage
)
(
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
codepoint
);
if
(
likely
(
mark_index
==
NOT_COVERED
))
if
(
likely
(
mark_index
==
NOT_COVERED
))
return
false
;
return
false
;
...
@@ -1075,13 +1075,13 @@ struct MarkBasePosFormat1
...
@@ -1075,13 +1075,13 @@ struct MarkBasePosFormat1
if
(
unlikely
(
!
j
))
if
(
unlikely
(
!
j
))
return
false
;
return
false
;
j
--
;
j
--
;
}
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
in
_string
[
j
],
LookupFlag
::
IgnoreMarks
,
&
property
));
}
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
in
fo
[
j
],
LookupFlag
::
IgnoreMarks
,
&
property
));
/* The following assertion is too strong, so we've disabled it. */
/* The following assertion is too strong, so we've disabled it. */
if
(
false
&&
!
(
property
&
HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH
))
if
(
false
&&
!
(
property
&
HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH
))
return
false
;
return
false
;
unsigned
int
base_index
=
(
this
+
baseCoverage
)
(
c
->
buffer
->
in
_string
[
j
].
codepoint
);
unsigned
int
base_index
=
(
this
+
baseCoverage
)
(
c
->
buffer
->
in
fo
[
j
].
codepoint
);
if
(
base_index
==
NOT_COVERED
)
if
(
base_index
==
NOT_COVERED
)
return
false
;
return
false
;
...
@@ -1165,7 +1165,7 @@ struct MarkLigPosFormat1
...
@@ -1165,7 +1165,7 @@ struct MarkLigPosFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
();
unsigned
int
mark_index
=
(
this
+
markCoverage
)
(
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
codepoint
);
unsigned
int
mark_index
=
(
this
+
markCoverage
)
(
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
codepoint
);
if
(
likely
(
mark_index
==
NOT_COVERED
))
if
(
likely
(
mark_index
==
NOT_COVERED
))
return
false
;
return
false
;
...
@@ -1177,13 +1177,13 @@ struct MarkLigPosFormat1
...
@@ -1177,13 +1177,13 @@ struct MarkLigPosFormat1
if
(
unlikely
(
!
j
))
if
(
unlikely
(
!
j
))
return
false
;
return
false
;
j
--
;
j
--
;
}
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
in
_string
[
j
],
LookupFlag
::
IgnoreMarks
,
&
property
));
}
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
in
fo
[
j
],
LookupFlag
::
IgnoreMarks
,
&
property
));
/* The following assertion is too strong, so we've disabled it. */
/* The following assertion is too strong, so we've disabled it. */
if
(
false
&&
!
(
property
&
HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE
))
if
(
false
&&
!
(
property
&
HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE
))
return
false
;
return
false
;
unsigned
int
lig_index
=
(
this
+
ligatureCoverage
)
(
c
->
buffer
->
in
_string
[
j
].
codepoint
);
unsigned
int
lig_index
=
(
this
+
ligatureCoverage
)
(
c
->
buffer
->
in
fo
[
j
].
codepoint
);
if
(
lig_index
==
NOT_COVERED
)
if
(
lig_index
==
NOT_COVERED
)
return
false
;
return
false
;
...
@@ -1199,9 +1199,9 @@ struct MarkLigPosFormat1
...
@@ -1199,9 +1199,9 @@ 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
->
in
_string
[
j
].
lig_id
&&
c
->
buffer
->
in_string
[
j
].
lig_id
==
c
->
buffer
->
in_string
[
c
->
buffer
->
in_pos
].
lig_id
&&
c
->
buffer
->
in_string
[
c
->
buffer
->
in_pos
].
component
)
if
(
c
->
buffer
->
in
fo
[
j
].
lig_id
&&
c
->
buffer
->
info
[
j
].
lig_id
==
c
->
buffer
->
info
[
c
->
buffer
->
in_pos
].
lig_id
&&
c
->
buffer
->
info
[
c
->
buffer
->
in_pos
].
component
)
{
{
comp_index
=
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
component
-
1
;
comp_index
=
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
component
-
1
;
if
(
comp_index
>=
comp_count
)
if
(
comp_index
>=
comp_count
)
comp_index
=
comp_count
-
1
;
comp_index
=
comp_count
-
1
;
}
}
...
@@ -1284,7 +1284,7 @@ struct MarkMarkPosFormat1
...
@@ -1284,7 +1284,7 @@ struct MarkMarkPosFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
();
unsigned
int
mark1_index
=
(
this
+
mark1Coverage
)
(
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
codepoint
);
unsigned
int
mark1_index
=
(
this
+
mark1Coverage
)
(
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
codepoint
);
if
(
likely
(
mark1_index
==
NOT_COVERED
))
if
(
likely
(
mark1_index
==
NOT_COVERED
))
return
false
;
return
false
;
...
@@ -1296,7 +1296,7 @@ struct MarkMarkPosFormat1
...
@@ -1296,7 +1296,7 @@ struct MarkMarkPosFormat1
if
(
unlikely
(
!
j
))
if
(
unlikely
(
!
j
))
return
false
;
return
false
;
j
--
;
j
--
;
}
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
in
_string
[
j
],
c
->
lookup_flag
,
&
property
));
}
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
in
fo
[
j
],
c
->
lookup_flag
,
&
property
));
if
(
!
(
property
&
HB_OT_LAYOUT_GLYPH_CLASS_MARK
))
if
(
!
(
property
&
HB_OT_LAYOUT_GLYPH_CLASS_MARK
))
return
false
;
return
false
;
...
@@ -1304,11 +1304,11 @@ struct MarkMarkPosFormat1
...
@@ -1304,11 +1304,11 @@ 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
->
in
_string
[
j
].
component
!=
c
->
buffer
->
in_string
[
c
->
buffer
->
in_pos
].
component
)
||
if
((
c
->
buffer
->
in
fo
[
j
].
component
!=
c
->
buffer
->
info
[
c
->
buffer
->
in_pos
].
component
)
||
(
c
->
buffer
->
in
_string
[
j
].
component
&&
c
->
buffer
->
in_string
[
j
].
lig_id
!=
c
->
buffer
->
in_string
[
c
->
buffer
->
in_pos
].
lig_id
))
(
c
->
buffer
->
in
fo
[
j
].
component
&&
c
->
buffer
->
info
[
j
].
lig_id
!=
c
->
buffer
->
info
[
c
->
buffer
->
in_pos
].
lig_id
))
return
false
;
return
false
;
unsigned
int
mark2_index
=
(
this
+
mark2Coverage
)
(
c
->
buffer
->
in
_string
[
j
].
codepoint
);
unsigned
int
mark2_index
=
(
this
+
mark2Coverage
)
(
c
->
buffer
->
in
fo
[
j
].
codepoint
);
if
(
mark2_index
==
NOT_COVERED
)
if
(
mark2_index
==
NOT_COVERED
)
return
false
;
return
false
;
...
@@ -1513,7 +1513,7 @@ struct PosLookup : Lookup
...
@@ -1513,7 +1513,7 @@ struct PosLookup : Lookup
c
->
nesting_level_left
=
nesting_level_left
;
c
->
nesting_level_left
=
nesting_level_left
;
c
->
lookup_flag
=
get_flag
();
c
->
lookup_flag
=
get_flag
();
if
(
!
_hb_ot_layout_check_glyph_property
(
c
->
layout
->
face
,
&
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
],
c
->
lookup_flag
,
&
c
->
property
))
if
(
!
_hb_ot_layout_check_glyph_property
(
c
->
layout
->
face
,
&
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
],
c
->
lookup_flag
,
&
c
->
property
))
return
false
;
return
false
;
for
(
unsigned
int
i
=
0
;
i
<
get_subtable_count
();
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
get_subtable_count
();
i
++
)
...
@@ -1538,7 +1538,7 @@ struct PosLookup : Lookup
...
@@ -1538,7 +1538,7 @@ struct PosLookup : Lookup
while
(
buffer
->
in_pos
<
buffer
->
in_length
)
while
(
buffer
->
in_pos
<
buffer
->
in_length
)
{
{
bool
done
;
bool
done
;
if
(
~
buffer
->
in
_string
[
buffer
->
in_pos
].
mask
&
mask
)
if
(
~
buffer
->
in
fo
[
buffer
->
in_pos
].
mask
&
mask
)
{
{
done
=
apply_once
(
layout
,
buffer
,
NO_CONTEXT
,
MAX_NESTING_LEVEL
);
done
=
apply_once
(
layout
,
buffer
,
NO_CONTEXT
,
MAX_NESTING_LEVEL
);
ret
|=
done
;
ret
|=
done
;
...
...
src/hb-ot-layout-gsub-private.hh
浏览文件 @
7e7007a1
...
@@ -39,7 +39,7 @@ struct SingleSubstFormat1
...
@@ -39,7 +39,7 @@ struct SingleSubstFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
();
hb_codepoint_t
glyph_id
=
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
codepoint
;
hb_codepoint_t
glyph_id
=
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
codepoint
;
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
if
(
likely
(
index
==
NOT_COVERED
))
if
(
likely
(
index
==
NOT_COVERED
))
return
false
;
return
false
;
...
@@ -80,7 +80,7 @@ struct SingleSubstFormat2
...
@@ -80,7 +80,7 @@ struct SingleSubstFormat2
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
();
hb_codepoint_t
glyph_id
=
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
codepoint
;
hb_codepoint_t
glyph_id
=
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
codepoint
;
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
if
(
likely
(
index
==
NOT_COVERED
))
if
(
likely
(
index
==
NOT_COVERED
))
return
false
;
return
false
;
...
@@ -204,7 +204,7 @@ struct MultipleSubstFormat1
...
@@ -204,7 +204,7 @@ struct MultipleSubstFormat1
{
{
TRACE_APPLY
();
TRACE_APPLY
();
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
if
(
likely
(
index
==
NOT_COVERED
))
return
false
;
return
false
;
...
@@ -273,7 +273,7 @@ struct AlternateSubstFormat1
...
@@ -273,7 +273,7 @@ struct AlternateSubstFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
();
hb_codepoint_t
glyph_id
=
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
codepoint
;
hb_codepoint_t
glyph_id
=
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
codepoint
;
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
if
(
likely
(
index
==
NOT_COVERED
))
if
(
likely
(
index
==
NOT_COVERED
))
...
@@ -374,7 +374,7 @@ struct Ligature
...
@@ -374,7 +374,7 @@ struct Ligature
for
(
i
=
1
,
j
=
c
->
buffer
->
in_pos
+
1
;
i
<
count
;
i
++
,
j
++
)
for
(
i
=
1
,
j
=
c
->
buffer
->
in_pos
+
1
;
i
<
count
;
i
++
,
j
++
)
{
{
unsigned
int
property
;
unsigned
int
property
;
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
in
_string
[
j
],
c
->
lookup_flag
,
&
property
))
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
in
fo
[
j
],
c
->
lookup_flag
,
&
property
))
{
{
if
(
unlikely
(
j
+
count
-
i
==
end
))
if
(
unlikely
(
j
+
count
-
i
==
end
))
return
false
;
return
false
;
...
@@ -384,7 +384,7 @@ struct Ligature
...
@@ -384,7 +384,7 @@ struct Ligature
if
(
!
(
property
&
HB_OT_LAYOUT_GLYPH_CLASS_MARK
))
if
(
!
(
property
&
HB_OT_LAYOUT_GLYPH_CLASS_MARK
))
is_mark
=
false
;
is_mark
=
false
;
if
(
likely
(
c
->
buffer
->
in
_string
[
j
].
codepoint
!=
component
[
i
]))
if
(
likely
(
c
->
buffer
->
in
fo
[
j
].
codepoint
!=
component
[
i
]))
return
false
;
return
false
;
}
}
/* This is just a guess ... */
/* This is just a guess ... */
...
@@ -399,7 +399,7 @@ struct Ligature
...
@@ -399,7 +399,7 @@ struct Ligature
c
->
buffer
->
add_output_glyphs_be16
(
i
,
c
->
buffer
->
add_output_glyphs_be16
(
i
,
1
,
(
const
uint16_t
*
)
&
ligGlyph
,
1
,
(
const
uint16_t
*
)
&
ligGlyph
,
0
,
0
,
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
lig_id
&&
!
c
->
buffer
->
in_string
[
c
->
buffer
->
in_pos
].
component
?
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
lig_id
&&
!
c
->
buffer
->
info
[
c
->
buffer
->
in_pos
].
component
?
0xFFFF
:
c
->
buffer
->
allocate_lig_id
());
0xFFFF
:
c
->
buffer
->
allocate_lig_id
());
else
else
{
{
...
@@ -415,8 +415,8 @@ struct Ligature
...
@@ -415,8 +415,8 @@ struct Ligature
for
(
i
=
1
;
i
<
count
;
i
++
)
for
(
i
=
1
;
i
<
count
;
i
++
)
{
{
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
],
c
->
lookup_flag
,
NULL
))
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
],
c
->
lookup_flag
,
NULL
))
c
->
buffer
->
add_output_glyph
(
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
codepoint
,
i
,
lig_id
);
c
->
buffer
->
add_output_glyph
(
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
codepoint
,
i
,
lig_id
);
(
c
->
buffer
->
in_pos
)
++
;
(
c
->
buffer
->
in_pos
)
++
;
}
}
...
@@ -483,7 +483,7 @@ struct LigatureSubstFormat1
...
@@ -483,7 +483,7 @@ struct LigatureSubstFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
();
hb_codepoint_t
glyph_id
=
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
codepoint
;
hb_codepoint_t
glyph_id
=
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
codepoint
;
bool
first_is_mark
=
!!
(
c
->
property
&
HB_OT_LAYOUT_GLYPH_CLASS_MARK
);
bool
first_is_mark
=
!!
(
c
->
property
&
HB_OT_LAYOUT_GLYPH_CLASS_MARK
);
...
@@ -604,7 +604,7 @@ struct ReverseChainSingleSubstFormat1
...
@@ -604,7 +604,7 @@ struct ReverseChainSingleSubstFormat1
if
(
unlikely
(
c
->
context_length
!=
NO_CONTEXT
))
if
(
unlikely
(
c
->
context_length
!=
NO_CONTEXT
))
return
false
;
/* No chaining to this type */
return
false
;
/* No chaining to this type */
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
if
(
likely
(
index
==
NOT_COVERED
))
return
false
;
return
false
;
...
@@ -619,7 +619,7 @@ struct ReverseChainSingleSubstFormat1
...
@@ -619,7 +619,7 @@ struct ReverseChainSingleSubstFormat1
match_coverage
,
this
,
match_coverage
,
this
,
1
))
1
))
{
{
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
codepoint
=
substitute
[
index
];
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
codepoint
=
substitute
[
index
];
c
->
buffer
->
in_pos
--
;
/* Reverse! */
c
->
buffer
->
in_pos
--
;
/* Reverse! */
return
true
;
return
true
;
}
}
...
@@ -789,7 +789,7 @@ struct SubstLookup : Lookup
...
@@ -789,7 +789,7 @@ struct SubstLookup : Lookup
c
->
nesting_level_left
=
nesting_level_left
;
c
->
nesting_level_left
=
nesting_level_left
;
c
->
lookup_flag
=
get_flag
();
c
->
lookup_flag
=
get_flag
();
if
(
!
_hb_ot_layout_check_glyph_property
(
c
->
layout
->
face
,
&
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
],
c
->
lookup_flag
,
&
c
->
property
))
if
(
!
_hb_ot_layout_check_glyph_property
(
c
->
layout
->
face
,
&
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
],
c
->
lookup_flag
,
&
c
->
property
))
return
false
;
return
false
;
if
(
unlikely
(
lookup_type
==
SubstLookupSubTable
::
Extension
))
if
(
unlikely
(
lookup_type
==
SubstLookupSubTable
::
Extension
))
...
@@ -830,7 +830,7 @@ struct SubstLookup : Lookup
...
@@ -830,7 +830,7 @@ struct SubstLookup : Lookup
buffer
->
in_pos
=
0
;
buffer
->
in_pos
=
0
;
while
(
buffer
->
in_pos
<
buffer
->
in_length
)
while
(
buffer
->
in_pos
<
buffer
->
in_length
)
{
{
if
((
~
buffer
->
in
_string
[
buffer
->
in_pos
].
mask
&
mask
)
&&
if
((
~
buffer
->
in
fo
[
buffer
->
in_pos
].
mask
&
mask
)
&&
apply_once
(
layout
,
buffer
,
NO_CONTEXT
,
MAX_NESTING_LEVEL
))
apply_once
(
layout
,
buffer
,
NO_CONTEXT
,
MAX_NESTING_LEVEL
))
ret
=
true
;
ret
=
true
;
else
else
...
@@ -846,7 +846,7 @@ struct SubstLookup : Lookup
...
@@ -846,7 +846,7 @@ struct SubstLookup : Lookup
buffer
->
in_pos
=
buffer
->
in_length
-
1
;
buffer
->
in_pos
=
buffer
->
in_length
-
1
;
do
do
{
{
if
((
~
buffer
->
in
_string
[
buffer
->
in_pos
].
mask
&
mask
)
&&
if
((
~
buffer
->
in
fo
[
buffer
->
in_pos
].
mask
&
mask
)
&&
apply_once
(
layout
,
buffer
,
NO_CONTEXT
,
MAX_NESTING_LEVEL
))
apply_once
(
layout
,
buffer
,
NO_CONTEXT
,
MAX_NESTING_LEVEL
))
ret
=
true
;
ret
=
true
;
else
else
...
...
src/hb-ot-layout-gsubgpos-private.hh
浏览文件 @
7e7007a1
...
@@ -94,14 +94,14 @@ static inline bool match_input (hb_apply_context_t *c,
...
@@ -94,14 +94,14 @@ static inline bool match_input (hb_apply_context_t *c,
for
(
i
=
1
,
j
=
c
->
buffer
->
in_pos
+
1
;
i
<
count
;
i
++
,
j
++
)
for
(
i
=
1
,
j
=
c
->
buffer
->
in_pos
+
1
;
i
<
count
;
i
++
,
j
++
)
{
{
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
in
_string
[
j
],
c
->
lookup_flag
,
NULL
))
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
in
fo
[
j
],
c
->
lookup_flag
,
NULL
))
{
{
if
(
unlikely
(
j
+
count
-
i
==
end
))
if
(
unlikely
(
j
+
count
-
i
==
end
))
return
false
;
return
false
;
j
++
;
j
++
;
}
}
if
(
likely
(
!
match_func
(
c
->
buffer
->
in
_string
[
j
].
codepoint
,
input
[
i
-
1
],
match_data
)))
if
(
likely
(
!
match_func
(
c
->
buffer
->
in
fo
[
j
].
codepoint
,
input
[
i
-
1
],
match_data
)))
return
false
;
return
false
;
}
}
...
@@ -149,14 +149,14 @@ static inline bool match_lookahead (hb_apply_context_t *c,
...
@@ -149,14 +149,14 @@ static inline bool match_lookahead (hb_apply_context_t *c,
for
(
i
=
0
,
j
=
c
->
buffer
->
in_pos
+
offset
;
i
<
count
;
i
++
,
j
++
)
for
(
i
=
0
,
j
=
c
->
buffer
->
in_pos
+
offset
;
i
<
count
;
i
++
,
j
++
)
{
{
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
in
_string
[
j
],
c
->
lookup_flag
,
NULL
))
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
in
fo
[
j
],
c
->
lookup_flag
,
NULL
))
{
{
if
(
unlikely
(
j
+
count
-
i
==
end
))
if
(
unlikely
(
j
+
count
-
i
==
end
))
return
false
;
return
false
;
j
++
;
j
++
;
}
}
if
(
likely
(
!
match_func
(
c
->
buffer
->
in
_string
[
j
].
codepoint
,
lookahead
[
i
],
match_data
)))
if
(
likely
(
!
match_func
(
c
->
buffer
->
in
fo
[
j
].
codepoint
,
lookahead
[
i
],
match_data
)))
return
false
;
return
false
;
}
}
...
@@ -198,7 +198,7 @@ static inline bool apply_lookup (hb_apply_context_t *c,
...
@@ -198,7 +198,7 @@ static inline bool apply_lookup (hb_apply_context_t *c,
*/
*/
for
(
unsigned
int
i
=
0
;
i
<
count
;
/* NOP */
)
for
(
unsigned
int
i
=
0
;
i
<
count
;
/* NOP */
)
{
{
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
],
c
->
lookup_flag
,
NULL
))
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
],
c
->
lookup_flag
,
NULL
))
{
{
if
(
unlikely
(
c
->
buffer
->
in_pos
==
end
))
if
(
unlikely
(
c
->
buffer
->
in_pos
==
end
))
return
true
;
return
true
;
...
@@ -337,7 +337,7 @@ struct ContextFormat1
...
@@ -337,7 +337,7 @@ struct ContextFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
,
apply_lookup_func_t
apply_func
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
,
apply_lookup_func_t
apply_func
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
();
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
if
(
likely
(
index
==
NOT_COVERED
))
return
false
;
return
false
;
...
@@ -376,12 +376,12 @@ struct ContextFormat2
...
@@ -376,12 +376,12 @@ struct ContextFormat2
inline
bool
apply
(
hb_apply_context_t
*
c
,
apply_lookup_func_t
apply_func
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
,
apply_lookup_func_t
apply_func
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
();
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
if
(
likely
(
index
==
NOT_COVERED
))
return
false
;
return
false
;
const
ClassDef
&
class_def
=
this
+
classDef
;
const
ClassDef
&
class_def
=
this
+
classDef
;
index
=
class_def
(
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
codepoint
);
index
=
class_def
(
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
codepoint
);
const
RuleSet
&
rule_set
=
this
+
ruleSet
[
index
];
const
RuleSet
&
rule_set
=
this
+
ruleSet
[
index
];
/* LONGTERMTODO: Old code fetches glyph classes at most once and caches
/* LONGTERMTODO: Old code fetches glyph classes at most once and caches
* them across subrule lookups. Not sure it's worth it.
* them across subrule lookups. Not sure it's worth it.
...
@@ -424,7 +424,7 @@ struct ContextFormat3
...
@@ -424,7 +424,7 @@ struct ContextFormat3
inline
bool
apply
(
hb_apply_context_t
*
c
,
apply_lookup_func_t
apply_func
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
,
apply_lookup_func_t
apply_func
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
();
unsigned
int
index
=
(
this
+
coverage
[
0
])
(
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
codepoint
);
unsigned
int
index
=
(
this
+
coverage
[
0
])
(
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
if
(
likely
(
index
==
NOT_COVERED
))
return
false
;
return
false
;
...
@@ -628,7 +628,7 @@ struct ChainContextFormat1
...
@@ -628,7 +628,7 @@ struct ChainContextFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
,
apply_lookup_func_t
apply_func
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
,
apply_lookup_func_t
apply_func
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
();
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
if
(
likely
(
index
==
NOT_COVERED
))
return
false
;
return
false
;
...
@@ -666,7 +666,7 @@ struct ChainContextFormat2
...
@@ -666,7 +666,7 @@ struct ChainContextFormat2
inline
bool
apply
(
hb_apply_context_t
*
c
,
apply_lookup_func_t
apply_func
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
,
apply_lookup_func_t
apply_func
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
();
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
if
(
likely
(
index
==
NOT_COVERED
))
return
false
;
return
false
;
...
@@ -674,7 +674,7 @@ struct ChainContextFormat2
...
@@ -674,7 +674,7 @@ struct ChainContextFormat2
const
ClassDef
&
input_class_def
=
this
+
inputClassDef
;
const
ClassDef
&
input_class_def
=
this
+
inputClassDef
;
const
ClassDef
&
lookahead_class_def
=
this
+
lookaheadClassDef
;
const
ClassDef
&
lookahead_class_def
=
this
+
lookaheadClassDef
;
index
=
input_class_def
(
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
codepoint
);
index
=
input_class_def
(
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
codepoint
);
const
ChainRuleSet
&
rule_set
=
this
+
ruleSet
[
index
];
const
ChainRuleSet
&
rule_set
=
this
+
ruleSet
[
index
];
/* LONGTERMTODO: Old code fetches glyph classes at most once and caches
/* LONGTERMTODO: Old code fetches glyph classes at most once and caches
* them across subrule lookups. Not sure it's worth it.
* them across subrule lookups. Not sure it's worth it.
...
@@ -732,7 +732,7 @@ struct ChainContextFormat3
...
@@ -732,7 +732,7 @@ struct ChainContextFormat3
TRACE_APPLY
();
TRACE_APPLY
();
const
OffsetArrayOf
<
Coverage
>
&
input
=
StructAfter
<
OffsetArrayOf
<
Coverage
>
>
(
backtrack
);
const
OffsetArrayOf
<
Coverage
>
&
input
=
StructAfter
<
OffsetArrayOf
<
Coverage
>
>
(
backtrack
);
unsigned
int
index
=
(
this
+
input
[
0
])
(
c
->
buffer
->
in
_string
[
c
->
buffer
->
in_pos
].
codepoint
);
unsigned
int
index
=
(
this
+
input
[
0
])
(
c
->
buffer
->
in
fo
[
c
->
buffer
->
in_pos
].
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
if
(
likely
(
index
==
NOT_COVERED
))
return
false
;
return
false
;
...
...
src/hb-shape.cc
浏览文件 @
7e7007a1
...
@@ -50,8 +50,8 @@ hb_form_clusters (hb_buffer_t *buffer)
...
@@ -50,8 +50,8 @@ hb_form_clusters (hb_buffer_t *buffer)
count
=
buffer
->
in_length
;
count
=
buffer
->
in_length
;
for
(
buffer
->
in_pos
=
1
;
buffer
->
in_pos
<
count
;
buffer
->
in_pos
++
)
for
(
buffer
->
in_pos
=
1
;
buffer
->
in_pos
<
count
;
buffer
->
in_pos
++
)
if
(
buffer
->
unicode
->
get_general_category
(
buffer
->
in
_string
[
buffer
->
in_pos
].
codepoint
)
==
HB_CATEGORY_NON_SPACING_MARK
)
if
(
buffer
->
unicode
->
get_general_category
(
buffer
->
in
fo
[
buffer
->
in_pos
].
codepoint
)
==
HB_CATEGORY_NON_SPACING_MARK
)
buffer
->
in
_string
[
buffer
->
in_pos
].
cluster
=
buffer
->
in_string
[
buffer
->
in_pos
-
1
].
cluster
;
buffer
->
in
fo
[
buffer
->
in_pos
].
cluster
=
buffer
->
info
[
buffer
->
in_pos
-
1
].
cluster
;
}
}
static
hb_direction_t
static
hb_direction_t
...
@@ -84,7 +84,7 @@ hb_mirror_chars (hb_buffer_t *buffer)
...
@@ -84,7 +84,7 @@ hb_mirror_chars (hb_buffer_t *buffer)
count
=
buffer
->
in_length
;
count
=
buffer
->
in_length
;
for
(
buffer
->
in_pos
=
0
;
buffer
->
in_pos
<
count
;
buffer
->
in_pos
++
)
{
for
(
buffer
->
in_pos
=
0
;
buffer
->
in_pos
<
count
;
buffer
->
in_pos
++
)
{
buffer
->
in
_string
[
buffer
->
in_pos
].
codepoint
=
get_mirroring
(
buffer
->
in_string
[
buffer
->
in_pos
].
codepoint
);
buffer
->
in
fo
[
buffer
->
in_pos
].
codepoint
=
get_mirroring
(
buffer
->
info
[
buffer
->
in_pos
].
codepoint
);
}
}
}
}
...
@@ -99,14 +99,14 @@ hb_map_glyphs (hb_font_t *font,
...
@@ -99,14 +99,14 @@ hb_map_glyphs (hb_font_t *font,
return
;
return
;
count
=
buffer
->
in_length
-
1
;
count
=
buffer
->
in_length
-
1
;
for
(
buffer
->
in_pos
=
0
;
buffer
->
in_pos
<
count
;
buffer
->
in_pos
++
)
{
for
(
buffer
->
in_pos
=
0
;
buffer
->
in_pos
<
count
;
buffer
->
in_pos
++
)
{
if
(
unlikely
(
is_variation_selector
(
buffer
->
in
_string
[
buffer
->
in_pos
+
1
].
codepoint
)))
{
if
(
unlikely
(
is_variation_selector
(
buffer
->
in
fo
[
buffer
->
in_pos
+
1
].
codepoint
)))
{
buffer
->
in
_string
[
buffer
->
in_pos
].
codepoint
=
hb_font_get_glyph
(
font
,
face
,
buffer
->
in_string
[
buffer
->
in_pos
].
codepoint
,
buffer
->
in_string
[
buffer
->
in_pos
+
1
].
codepoint
);
buffer
->
in
fo
[
buffer
->
in_pos
].
codepoint
=
hb_font_get_glyph
(
font
,
face
,
buffer
->
info
[
buffer
->
in_pos
].
codepoint
,
buffer
->
info
[
buffer
->
in_pos
+
1
].
codepoint
);
buffer
->
in_pos
++
;
buffer
->
in_pos
++
;
}
else
{
}
else
{
buffer
->
in
_string
[
buffer
->
in_pos
].
codepoint
=
hb_font_get_glyph
(
font
,
face
,
buffer
->
in_string
[
buffer
->
in_pos
].
codepoint
,
0
);
buffer
->
in
fo
[
buffer
->
in_pos
].
codepoint
=
hb_font_get_glyph
(
font
,
face
,
buffer
->
info
[
buffer
->
in_pos
].
codepoint
,
0
);
}
}
}
}
buffer
->
in
_string
[
buffer
->
in_pos
].
codepoint
=
hb_font_get_glyph
(
font
,
face
,
buffer
->
in_string
[
buffer
->
in_pos
].
codepoint
,
0
);
buffer
->
in
fo
[
buffer
->
in_pos
].
codepoint
=
hb_font_get_glyph
(
font
,
face
,
buffer
->
info
[
buffer
->
in_pos
].
codepoint
,
0
);
}
}
static
void
static
void
...
@@ -157,7 +157,7 @@ hb_position_default (hb_font_t *font,
...
@@ -157,7 +157,7 @@ hb_position_default (hb_font_t *font,
count
=
buffer
->
in_length
;
count
=
buffer
->
in_length
;
for
(
buffer
->
in_pos
=
0
;
buffer
->
in_pos
<
count
;
buffer
->
in_pos
++
)
{
for
(
buffer
->
in_pos
=
0
;
buffer
->
in_pos
<
count
;
buffer
->
in_pos
++
)
{
hb_glyph_metrics_t
metrics
;
hb_glyph_metrics_t
metrics
;
hb_font_get_glyph_metrics
(
font
,
face
,
buffer
->
in
_string
[
buffer
->
in_pos
].
codepoint
,
&
metrics
);
hb_font_get_glyph_metrics
(
font
,
face
,
buffer
->
in
fo
[
buffer
->
in_pos
].
codepoint
,
&
metrics
);
buffer
->
positions
[
buffer
->
in_pos
].
x_advance
=
metrics
.
x_advance
;
buffer
->
positions
[
buffer
->
in_pos
].
x_advance
=
metrics
.
x_advance
;
buffer
->
positions
[
buffer
->
in_pos
].
y_advance
=
metrics
.
y_advance
;
buffer
->
positions
[
buffer
->
in_pos
].
y_advance
=
metrics
.
y_advance
;
}
}
...
@@ -196,7 +196,7 @@ hb_truetype_kern (hb_font_t *font,
...
@@ -196,7 +196,7 @@ hb_truetype_kern (hb_font_t *font,
count
=
buffer
->
in_length
;
count
=
buffer
->
in_length
;
for
(
buffer
->
in_pos
=
1
;
buffer
->
in_pos
<
count
;
buffer
->
in_pos
++
)
{
for
(
buffer
->
in_pos
=
1
;
buffer
->
in_pos
<
count
;
buffer
->
in_pos
++
)
{
hb_position_t
kern
,
kern1
,
kern2
;
hb_position_t
kern
,
kern1
,
kern2
;
kern
=
hb_font_get_kerning
(
font
,
face
,
buffer
->
in
_string
[
buffer
->
in_pos
-
1
].
codepoint
,
buffer
->
in_string
[
buffer
->
in_pos
].
codepoint
);
kern
=
hb_font_get_kerning
(
font
,
face
,
buffer
->
in
fo
[
buffer
->
in_pos
-
1
].
codepoint
,
buffer
->
info
[
buffer
->
in_pos
].
codepoint
);
kern1
=
kern
>>
1
;
kern1
=
kern
>>
1
;
kern2
=
kern
-
kern1
;
kern2
=
kern
-
kern1
;
buffer
->
positions
[
buffer
->
in_pos
-
1
].
x_advance
+=
kern1
;
buffer
->
positions
[
buffer
->
in_pos
-
1
].
x_advance
+=
kern1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录