Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
36b73c80
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看板
提交
36b73c80
编写于
5月 14, 2010
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Shortening buffer accessors: rename buffer->in_pos to buffer->i
上级
29427c5c
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
141 addition
and
141 deletion
+141
-141
src/hb-buffer-private.hh
src/hb-buffer-private.hh
+1
-1
src/hb-buffer.cc
src/hb-buffer.cc
+26
-26
src/hb-ot-layout-gpos-private.hh
src/hb-ot-layout-gpos-private.hh
+47
-47
src/hb-ot-layout-gsub-private.hh
src/hb-ot-layout-gsub-private.hh
+24
-24
src/hb-ot-layout-gsubgpos-private.hh
src/hb-ot-layout-gsubgpos-private.hh
+23
-23
src/hb-shape.cc
src/hb-shape.cc
+20
-20
未找到文件。
src/hb-buffer-private.hh
浏览文件 @
36b73c80
...
@@ -112,7 +112,7 @@ struct _hb_buffer_t {
...
@@ -112,7 +112,7 @@ struct _hb_buffer_t {
hb_bool_t
have_positions
;
/* whether we have positions */
hb_bool_t
have_positions
;
/* whether we have positions */
unsigned
int
len
;
unsigned
int
len
;
unsigned
int
out_len
;
unsigned
int
out_len
;
unsigned
int
i
n_pos
;
unsigned
int
i
;
hb_internal_glyph_info_t
*
info
;
hb_internal_glyph_info_t
*
info
;
hb_internal_glyph_info_t
*
out_info
;
hb_internal_glyph_info_t
*
out_info
;
...
...
src/hb-buffer.cc
浏览文件 @
36b73c80
...
@@ -183,7 +183,7 @@ hb_buffer_clear (hb_buffer_t *buffer)
...
@@ -183,7 +183,7 @@ hb_buffer_clear (hb_buffer_t *buffer)
buffer
->
have_positions
=
FALSE
;
buffer
->
have_positions
=
FALSE
;
buffer
->
len
=
0
;
buffer
->
len
=
0
;
buffer
->
out_len
=
0
;
buffer
->
out_len
=
0
;
buffer
->
i
n_pos
=
0
;
buffer
->
i
=
0
;
buffer
->
out_info
=
buffer
->
info
;
buffer
->
out_info
=
buffer
->
info
;
buffer
->
max_lig_id
=
0
;
buffer
->
max_lig_id
=
0
;
}
}
...
@@ -285,7 +285,7 @@ _hb_buffer_swap (hb_buffer_t *buffer)
...
@@ -285,7 +285,7 @@ _hb_buffer_swap (hb_buffer_t *buffer)
buffer
->
len
=
buffer
->
out_len
;
buffer
->
len
=
buffer
->
out_len
;
buffer
->
out_len
=
tmp
;
buffer
->
out_len
=
tmp
;
buffer
->
i
n_pos
=
0
;
buffer
->
i
=
0
;
}
}
/* The following function copies `num_out' elements from `glyph_data'
/* The following function copies `num_out' elements from `glyph_data'
...
@@ -294,18 +294,18 @@ _hb_buffer_swap (hb_buffer_t *buffer)
...
@@ -294,18 +294,18 @@ _hb_buffer_swap (hb_buffer_t *buffer)
Finally, it sets the `length' field of `out' equal to
Finally, it sets the `length' field of `out' equal to
`pos' of the `out' structure.
`pos' of the `out' structure.
If `component' is 0xFFFF, the component value from buffer->i
n_pos
If `component' is 0xFFFF, the component value from buffer->i
will copied `num_out' times, otherwise `component' itself will
will copied `num_out' times, otherwise `component' itself will
be used to fill the `component' fields.
be used to fill the `component' fields.
If `lig_id' is 0xFFFF, the lig_id value from buffer->i
n_pos
If `lig_id' is 0xFFFF, the lig_id value from buffer->i
will copied `num_out' times, otherwise `lig_id' itself will
will copied `num_out' times, otherwise `lig_id' itself will
be used to fill the `lig_id' fields.
be used to fill the `lig_id' fields.
The mask for all replacement glyphs are taken
The mask for all replacement glyphs are taken
from the glyph at position `buffer->i
n_pos
'.
from the glyph at position `buffer->i'.
The cluster value for the glyph at position buffer->i
n_pos
is used
The cluster value for the glyph at position buffer->i is used
for all replacement glyphs */
for all replacement glyphs */
void
void
...
@@ -321,17 +321,17 @@ _hb_buffer_add_output_glyphs (hb_buffer_t *buffer,
...
@@ -321,17 +321,17 @@ _hb_buffer_add_output_glyphs (hb_buffer_t *buffer,
unsigned
int
cluster
;
unsigned
int
cluster
;
if
(
buffer
->
out_info
!=
buffer
->
info
||
if
(
buffer
->
out_info
!=
buffer
->
info
||
buffer
->
out_len
+
num_out
>
buffer
->
i
n_pos
+
num_in
)
buffer
->
out_len
+
num_out
>
buffer
->
i
+
num_in
)
{
{
hb_buffer_ensure_separate
(
buffer
,
buffer
->
out_len
+
num_out
);
hb_buffer_ensure_separate
(
buffer
,
buffer
->
out_len
+
num_out
);
}
}
mask
=
buffer
->
info
[
buffer
->
i
n_pos
].
mask
;
mask
=
buffer
->
info
[
buffer
->
i
].
mask
;
cluster
=
buffer
->
info
[
buffer
->
i
n_pos
].
cluster
;
cluster
=
buffer
->
info
[
buffer
->
i
].
cluster
;
if
(
component
==
0xFFFF
)
if
(
component
==
0xFFFF
)
component
=
buffer
->
info
[
buffer
->
i
n_pos
].
component
;
component
=
buffer
->
info
[
buffer
->
i
].
component
;
if
(
lig_id
==
0xFFFF
)
if
(
lig_id
==
0xFFFF
)
lig_id
=
buffer
->
info
[
buffer
->
i
n_pos
].
lig_id
;
lig_id
=
buffer
->
info
[
buffer
->
i
].
lig_id
;
for
(
i
=
0
;
i
<
num_out
;
i
++
)
for
(
i
=
0
;
i
<
num_out
;
i
++
)
{
{
...
@@ -344,7 +344,7 @@ _hb_buffer_add_output_glyphs (hb_buffer_t *buffer,
...
@@ -344,7 +344,7 @@ _hb_buffer_add_output_glyphs (hb_buffer_t *buffer,
info
->
gproperty
=
HB_BUFFER_GLYPH_PROPERTIES_UNKNOWN
;
info
->
gproperty
=
HB_BUFFER_GLYPH_PROPERTIES_UNKNOWN
;
}
}
buffer
->
i
n_pos
+=
num_in
;
buffer
->
i
+=
num_in
;
buffer
->
out_len
+=
num_out
;
buffer
->
out_len
+=
num_out
;
}
}
...
@@ -361,17 +361,17 @@ _hb_buffer_add_output_glyphs_be16 (hb_buffer_t *buffer,
...
@@ -361,17 +361,17 @@ _hb_buffer_add_output_glyphs_be16 (hb_buffer_t *buffer,
unsigned
int
cluster
;
unsigned
int
cluster
;
if
(
buffer
->
out_info
!=
buffer
->
info
||
if
(
buffer
->
out_info
!=
buffer
->
info
||
buffer
->
out_len
+
num_out
>
buffer
->
i
n_pos
+
num_in
)
buffer
->
out_len
+
num_out
>
buffer
->
i
+
num_in
)
{
{
hb_buffer_ensure_separate
(
buffer
,
buffer
->
out_len
+
num_out
);
hb_buffer_ensure_separate
(
buffer
,
buffer
->
out_len
+
num_out
);
}
}
mask
=
buffer
->
info
[
buffer
->
i
n_pos
].
mask
;
mask
=
buffer
->
info
[
buffer
->
i
].
mask
;
cluster
=
buffer
->
info
[
buffer
->
i
n_pos
].
cluster
;
cluster
=
buffer
->
info
[
buffer
->
i
].
cluster
;
if
(
component
==
0xFFFF
)
if
(
component
==
0xFFFF
)
component
=
buffer
->
info
[
buffer
->
i
n_pos
].
component
;
component
=
buffer
->
info
[
buffer
->
i
].
component
;
if
(
lig_id
==
0xFFFF
)
if
(
lig_id
==
0xFFFF
)
lig_id
=
buffer
->
info
[
buffer
->
i
n_pos
].
lig_id
;
lig_id
=
buffer
->
info
[
buffer
->
i
].
lig_id
;
for
(
i
=
0
;
i
<
num_out
;
i
++
)
for
(
i
=
0
;
i
<
num_out
;
i
++
)
{
{
...
@@ -384,7 +384,7 @@ _hb_buffer_add_output_glyphs_be16 (hb_buffer_t *buffer,
...
@@ -384,7 +384,7 @@ _hb_buffer_add_output_glyphs_be16 (hb_buffer_t *buffer,
info
->
gproperty
=
HB_BUFFER_GLYPH_PROPERTIES_UNKNOWN
;
info
->
gproperty
=
HB_BUFFER_GLYPH_PROPERTIES_UNKNOWN
;
}
}
buffer
->
i
n_pos
+=
num_in
;
buffer
->
i
+=
num_in
;
buffer
->
out_len
+=
num_out
;
buffer
->
out_len
+=
num_out
;
}
}
...
@@ -399,10 +399,10 @@ _hb_buffer_add_output_glyph (hb_buffer_t *buffer,
...
@@ -399,10 +399,10 @@ _hb_buffer_add_output_glyph (hb_buffer_t *buffer,
if
(
buffer
->
out_info
!=
buffer
->
info
)
if
(
buffer
->
out_info
!=
buffer
->
info
)
{
{
hb_buffer_ensure
(
buffer
,
buffer
->
out_len
+
1
);
hb_buffer_ensure
(
buffer
,
buffer
->
out_len
+
1
);
buffer
->
out_info
[
buffer
->
out_len
]
=
buffer
->
info
[
buffer
->
i
n_pos
];
buffer
->
out_info
[
buffer
->
out_len
]
=
buffer
->
info
[
buffer
->
i
];
}
}
else
if
(
buffer
->
out_len
!=
buffer
->
i
n_pos
)
else
if
(
buffer
->
out_len
!=
buffer
->
i
)
buffer
->
out_info
[
buffer
->
out_len
]
=
buffer
->
info
[
buffer
->
i
n_pos
];
buffer
->
out_info
[
buffer
->
out_len
]
=
buffer
->
info
[
buffer
->
i
];
info
=
&
buffer
->
out_info
[
buffer
->
out_len
];
info
=
&
buffer
->
out_info
[
buffer
->
out_len
];
info
->
codepoint
=
glyph_index
;
info
->
codepoint
=
glyph_index
;
...
@@ -412,7 +412,7 @@ _hb_buffer_add_output_glyph (hb_buffer_t *buffer,
...
@@ -412,7 +412,7 @@ _hb_buffer_add_output_glyph (hb_buffer_t *buffer,
info
->
lig_id
=
lig_id
;
info
->
lig_id
=
lig_id
;
info
->
gproperty
=
HB_BUFFER_GLYPH_PROPERTIES_UNKNOWN
;
info
->
gproperty
=
HB_BUFFER_GLYPH_PROPERTIES_UNKNOWN
;
buffer
->
i
n_pos
++
;
buffer
->
i
++
;
buffer
->
out_len
++
;
buffer
->
out_len
++
;
}
}
...
@@ -424,15 +424,15 @@ _hb_buffer_next_glyph (hb_buffer_t *buffer)
...
@@ -424,15 +424,15 @@ _hb_buffer_next_glyph (hb_buffer_t *buffer)
if
(
buffer
->
out_info
!=
buffer
->
info
)
if
(
buffer
->
out_info
!=
buffer
->
info
)
{
{
hb_buffer_ensure
(
buffer
,
buffer
->
out_len
+
1
);
hb_buffer_ensure
(
buffer
,
buffer
->
out_len
+
1
);
buffer
->
out_info
[
buffer
->
out_len
]
=
buffer
->
info
[
buffer
->
i
n_pos
];
buffer
->
out_info
[
buffer
->
out_len
]
=
buffer
->
info
[
buffer
->
i
];
}
}
else
if
(
buffer
->
out_len
!=
buffer
->
i
n_pos
)
else
if
(
buffer
->
out_len
!=
buffer
->
i
)
buffer
->
out_info
[
buffer
->
out_len
]
=
buffer
->
info
[
buffer
->
i
n_pos
];
buffer
->
out_info
[
buffer
->
out_len
]
=
buffer
->
info
[
buffer
->
i
];
buffer
->
out_len
++
;
buffer
->
out_len
++
;
}
}
buffer
->
i
n_pos
++
;
buffer
->
i
++
;
}
}
...
...
src/hb-ot-layout-gpos-private.hh
浏览文件 @
36b73c80
...
@@ -399,17 +399,17 @@ struct MarkArray : ArrayOf<MarkRecord> /* Array of MarkRecords--in Coverage orde
...
@@ -399,17 +399,17 @@ 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
->
info
[
c
->
buffer
->
i
n_pos
].
codepoint
,
&
mark_x
,
&
mark_y
);
mark_anchor
.
get_anchor
(
c
->
layout
,
c
->
buffer
->
info
[
c
->
buffer
->
i
].
codepoint
,
&
mark_x
,
&
mark_y
);
glyph_anchor
.
get_anchor
(
c
->
layout
,
c
->
buffer
->
info
[
glyph_pos
].
codepoint
,
&
base_x
,
&
base_y
);
glyph_anchor
.
get_anchor
(
c
->
layout
,
c
->
buffer
->
info
[
glyph_pos
].
codepoint
,
&
base_x
,
&
base_y
);
hb_internal_glyph_position_t
&
o
=
c
->
buffer
->
pos
[
c
->
buffer
->
i
n_pos
];
hb_internal_glyph_position_t
&
o
=
c
->
buffer
->
pos
[
c
->
buffer
->
i
];
o
.
x_advance
=
0
;
o
.
x_advance
=
0
;
o
.
y_advance
=
0
;
o
.
y_advance
=
0
;
o
.
x_offset
=
base_x
-
mark_x
;
o
.
x_offset
=
base_x
-
mark_x
;
o
.
y_offset
=
base_y
-
mark_y
;
o
.
y_offset
=
base_y
-
mark_y
;
o
.
back
=
c
->
buffer
->
i
n_pos
-
glyph_pos
;
o
.
back
=
c
->
buffer
->
i
-
glyph_pos
;
c
->
buffer
->
i
n_pos
++
;
c
->
buffer
->
i
++
;
return
true
;
return
true
;
}
}
...
@@ -430,13 +430,13 @@ struct SinglePosFormat1
...
@@ -430,13 +430,13 @@ 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
->
info
[
c
->
buffer
->
i
n_pos
].
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
i
].
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
if
(
likely
(
index
==
NOT_COVERED
))
return
false
;
return
false
;
valueFormat
.
apply_value
(
c
->
layout
,
this
,
values
,
c
->
buffer
->
pos
[
c
->
buffer
->
i
n_pos
]);
valueFormat
.
apply_value
(
c
->
layout
,
this
,
values
,
c
->
buffer
->
pos
[
c
->
buffer
->
i
]);
c
->
buffer
->
i
n_pos
++
;
c
->
buffer
->
i
++
;
return
true
;
return
true
;
}
}
...
@@ -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
->
info
[
c
->
buffer
->
i
n_pos
].
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
i
].
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
if
(
likely
(
index
==
NOT_COVERED
))
return
false
;
return
false
;
...
@@ -478,9 +478,9 @@ struct SinglePosFormat2
...
@@ -478,9 +478,9 @@ struct SinglePosFormat2
valueFormat
.
apply_value
(
c
->
layout
,
this
,
valueFormat
.
apply_value
(
c
->
layout
,
this
,
&
values
[
index
*
valueFormat
.
get_len
()],
&
values
[
index
*
valueFormat
.
get_len
()],
c
->
buffer
->
pos
[
c
->
buffer
->
i
n_pos
]);
c
->
buffer
->
pos
[
c
->
buffer
->
i
]);
c
->
buffer
->
i
n_pos
++
;
c
->
buffer
->
i
++
;
return
true
;
return
true
;
}
}
...
@@ -572,11 +572,11 @@ struct PairSet
...
@@ -572,11 +572,11 @@ struct PairSet
{
{
if
(
c
->
buffer
->
info
[
pos
].
codepoint
==
record
->
secondGlyph
)
if
(
c
->
buffer
->
info
[
pos
].
codepoint
==
record
->
secondGlyph
)
{
{
valueFormats
[
0
].
apply_value
(
c
->
layout
,
this
,
&
record
->
values
[
0
],
c
->
buffer
->
pos
[
c
->
buffer
->
i
n_pos
]);
valueFormats
[
0
].
apply_value
(
c
->
layout
,
this
,
&
record
->
values
[
0
],
c
->
buffer
->
pos
[
c
->
buffer
->
i
]);
valueFormats
[
1
].
apply_value
(
c
->
layout
,
this
,
&
record
->
values
[
len1
],
c
->
buffer
->
pos
[
pos
]);
valueFormats
[
1
].
apply_value
(
c
->
layout
,
this
,
&
record
->
values
[
len1
],
c
->
buffer
->
pos
[
pos
]);
if
(
len2
)
if
(
len2
)
pos
++
;
pos
++
;
c
->
buffer
->
i
n_pos
=
pos
;
c
->
buffer
->
i
=
pos
;
return
true
;
return
true
;
}
}
record
=
&
StructAtOffset
<
PairValueRecord
>
(
record
,
record_size
);
record
=
&
StructAtOffset
<
PairValueRecord
>
(
record
,
record_size
);
...
@@ -619,15 +619,15 @@ struct PairPosFormat1
...
@@ -619,15 +619,15 @@ struct PairPosFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
();
unsigned
int
end
=
MIN
(
c
->
buffer
->
len
,
c
->
buffer
->
i
n_pos
+
c
->
context_length
);
unsigned
int
end
=
MIN
(
c
->
buffer
->
len
,
c
->
buffer
->
i
+
c
->
context_length
);
if
(
unlikely
(
c
->
buffer
->
i
n_pos
+
2
>
end
))
if
(
unlikely
(
c
->
buffer
->
i
+
2
>
end
))
return
false
;
return
false
;
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
i
n_pos
].
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
i
].
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
if
(
likely
(
index
==
NOT_COVERED
))
return
false
;
return
false
;
unsigned
int
j
=
c
->
buffer
->
i
n_pos
+
1
;
unsigned
int
j
=
c
->
buffer
->
i
+
1
;
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
info
[
j
],
c
->
lookup_flag
,
NULL
))
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
info
[
j
],
c
->
lookup_flag
,
NULL
))
{
{
if
(
unlikely
(
j
==
end
))
if
(
unlikely
(
j
==
end
))
...
@@ -681,15 +681,15 @@ struct PairPosFormat2
...
@@ -681,15 +681,15 @@ struct PairPosFormat2
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
();
unsigned
int
end
=
MIN
(
c
->
buffer
->
len
,
c
->
buffer
->
i
n_pos
+
c
->
context_length
);
unsigned
int
end
=
MIN
(
c
->
buffer
->
len
,
c
->
buffer
->
i
+
c
->
context_length
);
if
(
unlikely
(
c
->
buffer
->
i
n_pos
+
2
>
end
))
if
(
unlikely
(
c
->
buffer
->
i
+
2
>
end
))
return
false
;
return
false
;
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
i
n_pos
].
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
i
].
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
if
(
likely
(
index
==
NOT_COVERED
))
return
false
;
return
false
;
unsigned
int
j
=
c
->
buffer
->
i
n_pos
+
1
;
unsigned
int
j
=
c
->
buffer
->
i
+
1
;
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
info
[
j
],
c
->
lookup_flag
,
NULL
))
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
info
[
j
],
c
->
lookup_flag
,
NULL
))
{
{
if
(
unlikely
(
j
==
end
))
if
(
unlikely
(
j
==
end
))
...
@@ -701,18 +701,18 @@ struct PairPosFormat2
...
@@ -701,18 +701,18 @@ 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
->
info
[
c
->
buffer
->
i
n_pos
].
codepoint
);
unsigned
int
klass1
=
(
this
+
classDef1
)
(
c
->
buffer
->
info
[
c
->
buffer
->
i
].
codepoint
);
unsigned
int
klass2
=
(
this
+
classDef2
)
(
c
->
buffer
->
info
[
j
].
codepoint
);
unsigned
int
klass2
=
(
this
+
classDef2
)
(
c
->
buffer
->
info
[
j
].
codepoint
);
if
(
unlikely
(
klass1
>=
class1Count
||
klass2
>=
class2Count
))
if
(
unlikely
(
klass1
>=
class1Count
||
klass2
>=
class2Count
))
return
false
;
return
false
;
const
Value
*
v
=
&
values
[
record_len
*
(
klass1
*
class2Count
+
klass2
)];
const
Value
*
v
=
&
values
[
record_len
*
(
klass1
*
class2Count
+
klass2
)];
valueFormat1
.
apply_value
(
c
->
layout
,
this
,
v
,
c
->
buffer
->
pos
[
c
->
buffer
->
i
n_pos
]);
valueFormat1
.
apply_value
(
c
->
layout
,
this
,
v
,
c
->
buffer
->
pos
[
c
->
buffer
->
i
]);
valueFormat2
.
apply_value
(
c
->
layout
,
this
,
v
+
len1
,
c
->
buffer
->
pos
[
j
]);
valueFormat2
.
apply_value
(
c
->
layout
,
this
,
v
+
len1
,
c
->
buffer
->
pos
[
j
]);
if
(
len2
)
if
(
len2
)
j
++
;
j
++
;
c
->
buffer
->
i
n_pos
=
j
;
c
->
buffer
->
i
=
j
;
return
true
;
return
true
;
}
}
...
@@ -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
->
info
[
c
->
buffer
->
i
n_pos
].
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
i
].
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
if
(
likely
(
index
==
NOT_COVERED
))
return
false
;
return
false
;
...
@@ -964,14 +964,14 @@ struct CursivePosFormat1
...
@@ -964,14 +964,14 @@ 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
->
info
[
c
->
buffer
->
i
n_pos
].
codepoint
,
&
entry_x
,
&
entry_y
);
(
this
+
record
.
entryAnchor
).
get_anchor
(
c
->
layout
,
c
->
buffer
->
info
[
c
->
buffer
->
i
].
codepoint
,
&
entry_x
,
&
entry_y
);
/* TODO vertical */
/* TODO vertical */
if
(
c
->
buffer
->
direction
==
HB_DIRECTION_RTL
)
if
(
c
->
buffer
->
direction
==
HB_DIRECTION_RTL
)
{
{
/* advance is absolute, not relative */
/* advance is absolute, not relative */
c
->
buffer
->
pos
[
c
->
buffer
->
i
n_pos
].
x_advance
=
entry_x
-
gpi
->
anchor_x
;
c
->
buffer
->
pos
[
c
->
buffer
->
i
].
x_advance
=
entry_x
-
gpi
->
anchor_x
;
}
}
else
else
{
{
...
@@ -981,23 +981,23 @@ struct CursivePosFormat1
...
@@ -981,23 +981,23 @@ struct CursivePosFormat1
if
(
c
->
lookup_flag
&
LookupFlag
::
RightToLeft
)
if
(
c
->
lookup_flag
&
LookupFlag
::
RightToLeft
)
{
{
c
->
buffer
->
pos
[
last_pos
].
cursive_chain
=
last_pos
-
c
->
buffer
->
i
n_pos
;
c
->
buffer
->
pos
[
last_pos
].
cursive_chain
=
last_pos
-
c
->
buffer
->
i
;
c
->
buffer
->
pos
[
last_pos
].
y_offset
=
entry_y
-
gpi
->
anchor_y
;
c
->
buffer
->
pos
[
last_pos
].
y_offset
=
entry_y
-
gpi
->
anchor_y
;
}
}
else
else
{
{
c
->
buffer
->
pos
[
c
->
buffer
->
i
n_pos
].
cursive_chain
=
c
->
buffer
->
in_pos
-
last_pos
;
c
->
buffer
->
pos
[
c
->
buffer
->
i
].
cursive_chain
=
c
->
buffer
->
i
-
last_pos
;
c
->
buffer
->
pos
[
c
->
buffer
->
i
n_pos
].
y_offset
=
gpi
->
anchor_y
-
entry_y
;
c
->
buffer
->
pos
[
c
->
buffer
->
i
].
y_offset
=
gpi
->
anchor_y
-
entry_y
;
}
}
end:
end:
if
(
record
.
exitAnchor
)
if
(
record
.
exitAnchor
)
{
{
gpi
->
last
=
c
->
buffer
->
i
n_pos
;
gpi
->
last
=
c
->
buffer
->
i
;
(
this
+
record
.
exitAnchor
).
get_anchor
(
c
->
layout
,
c
->
buffer
->
info
[
c
->
buffer
->
i
n_pos
].
codepoint
,
&
gpi
->
anchor_x
,
&
gpi
->
anchor_y
);
(
this
+
record
.
exitAnchor
).
get_anchor
(
c
->
layout
,
c
->
buffer
->
info
[
c
->
buffer
->
i
].
codepoint
,
&
gpi
->
anchor_x
,
&
gpi
->
anchor_y
);
}
}
c
->
buffer
->
i
n_pos
++
;
c
->
buffer
->
i
++
;
return
true
;
return
true
;
}
}
...
@@ -1063,13 +1063,13 @@ struct MarkBasePosFormat1
...
@@ -1063,13 +1063,13 @@ 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
->
info
[
c
->
buffer
->
i
n_pos
].
codepoint
);
unsigned
int
mark_index
=
(
this
+
markCoverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
i
].
codepoint
);
if
(
likely
(
mark_index
==
NOT_COVERED
))
if
(
likely
(
mark_index
==
NOT_COVERED
))
return
false
;
return
false
;
/* now we search backwards for a non-mark glyph */
/* now we search backwards for a non-mark glyph */
unsigned
int
property
;
unsigned
int
property
;
unsigned
int
j
=
c
->
buffer
->
i
n_pos
;
unsigned
int
j
=
c
->
buffer
->
i
;
do
do
{
{
if
(
unlikely
(
!
j
))
if
(
unlikely
(
!
j
))
...
@@ -1165,13 +1165,13 @@ struct MarkLigPosFormat1
...
@@ -1165,13 +1165,13 @@ 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
->
info
[
c
->
buffer
->
i
n_pos
].
codepoint
);
unsigned
int
mark_index
=
(
this
+
markCoverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
i
].
codepoint
);
if
(
likely
(
mark_index
==
NOT_COVERED
))
if
(
likely
(
mark_index
==
NOT_COVERED
))
return
false
;
return
false
;
/* now we search backwards for a non-mark glyph */
/* now we search backwards for a non-mark glyph */
unsigned
int
property
;
unsigned
int
property
;
unsigned
int
j
=
c
->
buffer
->
i
n_pos
;
unsigned
int
j
=
c
->
buffer
->
i
;
do
do
{
{
if
(
unlikely
(
!
j
))
if
(
unlikely
(
!
j
))
...
@@ -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
->
info
[
j
].
lig_id
&&
c
->
buffer
->
info
[
j
].
lig_id
==
c
->
buffer
->
info
[
c
->
buffer
->
i
n_pos
].
lig_id
&&
c
->
buffer
->
info
[
c
->
buffer
->
in_pos
].
component
)
if
(
c
->
buffer
->
info
[
j
].
lig_id
&&
c
->
buffer
->
info
[
j
].
lig_id
==
c
->
buffer
->
info
[
c
->
buffer
->
i
].
lig_id
&&
c
->
buffer
->
info
[
c
->
buffer
->
i
].
component
)
{
{
comp_index
=
c
->
buffer
->
info
[
c
->
buffer
->
i
n_pos
].
component
-
1
;
comp_index
=
c
->
buffer
->
info
[
c
->
buffer
->
i
].
component
-
1
;
if
(
comp_index
>=
comp_count
)
if
(
comp_index
>=
comp_count
)
comp_index
=
comp_count
-
1
;
comp_index
=
comp_count
-
1
;
}
}
...
@@ -1284,13 +1284,13 @@ struct MarkMarkPosFormat1
...
@@ -1284,13 +1284,13 @@ 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
->
info
[
c
->
buffer
->
i
n_pos
].
codepoint
);
unsigned
int
mark1_index
=
(
this
+
mark1Coverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
i
].
codepoint
);
if
(
likely
(
mark1_index
==
NOT_COVERED
))
if
(
likely
(
mark1_index
==
NOT_COVERED
))
return
false
;
return
false
;
/* now we search backwards for a suitable mark glyph until a non-mark glyph */
/* now we search backwards for a suitable mark glyph until a non-mark glyph */
unsigned
int
property
;
unsigned
int
property
;
unsigned
int
j
=
c
->
buffer
->
i
n_pos
;
unsigned
int
j
=
c
->
buffer
->
i
;
do
do
{
{
if
(
unlikely
(
!
j
))
if
(
unlikely
(
!
j
))
...
@@ -1304,8 +1304,8 @@ struct MarkMarkPosFormat1
...
@@ -1304,8 +1304,8 @@ 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
].
component
!=
c
->
buffer
->
info
[
c
->
buffer
->
i
n_pos
].
component
)
||
if
((
c
->
buffer
->
info
[
j
].
component
!=
c
->
buffer
->
info
[
c
->
buffer
->
i
].
component
)
||
(
c
->
buffer
->
info
[
j
].
component
&&
c
->
buffer
->
info
[
j
].
lig_id
!=
c
->
buffer
->
info
[
c
->
buffer
->
i
n_pos
].
lig_id
))
(
c
->
buffer
->
info
[
j
].
component
&&
c
->
buffer
->
info
[
j
].
lig_id
!=
c
->
buffer
->
info
[
c
->
buffer
->
i
].
lig_id
))
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
);
...
@@ -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
->
info
[
c
->
buffer
->
i
n_pos
],
c
->
lookup_flag
,
&
c
->
property
))
if
(
!
_hb_ot_layout_check_glyph_property
(
c
->
layout
->
face
,
&
c
->
buffer
->
info
[
c
->
buffer
->
i
],
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
++
)
...
@@ -1534,11 +1534,11 @@ struct PosLookup : Lookup
...
@@ -1534,11 +1534,11 @@ struct PosLookup : Lookup
layout
->
info
.
gpos
.
last
=
HB_OT_LAYOUT_GPOS_NO_LAST
;
/* no last valid glyph for cursive pos. */
layout
->
info
.
gpos
.
last
=
HB_OT_LAYOUT_GPOS_NO_LAST
;
/* no last valid glyph for cursive pos. */
buffer
->
i
n_pos
=
0
;
buffer
->
i
=
0
;
while
(
buffer
->
i
n_pos
<
buffer
->
len
)
while
(
buffer
->
i
<
buffer
->
len
)
{
{
bool
done
;
bool
done
;
if
(
~
buffer
->
info
[
buffer
->
i
n_pos
].
mask
&
mask
)
if
(
~
buffer
->
info
[
buffer
->
i
].
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
;
...
@@ -1552,7 +1552,7 @@ struct PosLookup : Lookup
...
@@ -1552,7 +1552,7 @@ struct PosLookup : Lookup
}
}
if
(
!
done
)
if
(
!
done
)
buffer
->
i
n_pos
++
;
buffer
->
i
++
;
}
}
return
ret
;
return
ret
;
...
...
src/hb-ot-layout-gsub-private.hh
浏览文件 @
36b73c80
...
@@ -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
->
info
[
c
->
buffer
->
i
n_pos
].
codepoint
;
hb_codepoint_t
glyph_id
=
c
->
buffer
->
info
[
c
->
buffer
->
i
].
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
->
info
[
c
->
buffer
->
i
n_pos
].
codepoint
;
hb_codepoint_t
glyph_id
=
c
->
buffer
->
info
[
c
->
buffer
->
i
].
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
->
info
[
c
->
buffer
->
i
n_pos
].
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
i
].
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
->
info
[
c
->
buffer
->
i
n_pos
].
codepoint
;
hb_codepoint_t
glyph_id
=
c
->
buffer
->
info
[
c
->
buffer
->
i
].
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
))
...
@@ -367,11 +367,11 @@ struct Ligature
...
@@ -367,11 +367,11 @@ struct Ligature
TRACE_APPLY
();
TRACE_APPLY
();
unsigned
int
i
,
j
;
unsigned
int
i
,
j
;
unsigned
int
count
=
component
.
len
;
unsigned
int
count
=
component
.
len
;
unsigned
int
end
=
MIN
(
c
->
buffer
->
len
,
c
->
buffer
->
i
n_pos
+
c
->
context_length
);
unsigned
int
end
=
MIN
(
c
->
buffer
->
len
,
c
->
buffer
->
i
+
c
->
context_length
);
if
(
unlikely
(
c
->
buffer
->
i
n_pos
+
count
>
end
))
if
(
unlikely
(
c
->
buffer
->
i
+
count
>
end
))
return
false
;
return
false
;
for
(
i
=
1
,
j
=
c
->
buffer
->
i
n_pos
+
1
;
i
<
count
;
i
++
,
j
++
)
for
(
i
=
1
,
j
=
c
->
buffer
->
i
+
1
;
i
<
count
;
i
++
,
j
++
)
{
{
unsigned
int
property
;
unsigned
int
property
;
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
info
[
j
],
c
->
lookup_flag
,
&
property
))
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
info
[
j
],
c
->
lookup_flag
,
&
property
))
...
@@ -393,13 +393,13 @@ struct Ligature
...
@@ -393,13 +393,13 @@ struct Ligature
is_mark
?
HB_OT_LAYOUT_GLYPH_CLASS_MARK
is_mark
?
HB_OT_LAYOUT_GLYPH_CLASS_MARK
:
HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE
);
:
HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE
);
if
(
j
==
c
->
buffer
->
i
n_pos
+
i
)
/* No input glyphs skipped */
if
(
j
==
c
->
buffer
->
i
+
i
)
/* No input glyphs skipped */
/* We don't use a new ligature ID if there are no skipped
/* We don't use a new ligature ID if there are no skipped
glyphs and the ligature already has an ID. */
glyphs and the ligature already has an ID. */
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
->
info
[
c
->
buffer
->
i
n_pos
].
lig_id
&&
!
c
->
buffer
->
info
[
c
->
buffer
->
in_pos
].
component
?
c
->
buffer
->
info
[
c
->
buffer
->
i
].
lig_id
&&
!
c
->
buffer
->
info
[
c
->
buffer
->
i
].
component
?
0xFFFF
:
c
->
buffer
->
allocate_lig_id
());
0xFFFF
:
c
->
buffer
->
allocate_lig_id
());
else
else
{
{
...
@@ -415,10 +415,10 @@ struct Ligature
...
@@ -415,10 +415,10 @@ 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
->
info
[
c
->
buffer
->
i
n_pos
],
c
->
lookup_flag
,
NULL
))
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
info
[
c
->
buffer
->
i
],
c
->
lookup_flag
,
NULL
))
c
->
buffer
->
add_output_glyph
(
c
->
buffer
->
info
[
c
->
buffer
->
i
n_pos
].
codepoint
,
i
,
lig_id
);
c
->
buffer
->
add_output_glyph
(
c
->
buffer
->
info
[
c
->
buffer
->
i
].
codepoint
,
i
,
lig_id
);
(
c
->
buffer
->
i
n_pos
)
++
;
(
c
->
buffer
->
i
)
++
;
}
}
}
}
...
@@ -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
->
info
[
c
->
buffer
->
i
n_pos
].
codepoint
;
hb_codepoint_t
glyph_id
=
c
->
buffer
->
info
[
c
->
buffer
->
i
].
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
->
info
[
c
->
buffer
->
i
n_pos
].
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
i
].
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
if
(
likely
(
index
==
NOT_COVERED
))
return
false
;
return
false
;
...
@@ -619,8 +619,8 @@ struct ReverseChainSingleSubstFormat1
...
@@ -619,8 +619,8 @@ struct ReverseChainSingleSubstFormat1
match_coverage
,
this
,
match_coverage
,
this
,
1
))
1
))
{
{
c
->
buffer
->
info
[
c
->
buffer
->
i
n_pos
].
codepoint
=
substitute
[
index
];
c
->
buffer
->
info
[
c
->
buffer
->
i
].
codepoint
=
substitute
[
index
];
c
->
buffer
->
i
n_pos
--
;
/* Reverse! */
c
->
buffer
->
i
--
;
/* 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
->
info
[
c
->
buffer
->
i
n_pos
],
c
->
lookup_flag
,
&
c
->
property
))
if
(
!
_hb_ot_layout_check_glyph_property
(
c
->
layout
->
face
,
&
c
->
buffer
->
info
[
c
->
buffer
->
i
],
c
->
lookup_flag
,
&
c
->
property
))
return
false
;
return
false
;
if
(
unlikely
(
lookup_type
==
SubstLookupSubTable
::
Extension
))
if
(
unlikely
(
lookup_type
==
SubstLookupSubTable
::
Extension
))
...
@@ -827,10 +827,10 @@ struct SubstLookup : Lookup
...
@@ -827,10 +827,10 @@ struct SubstLookup : Lookup
{
{
/* in/out forward substitution */
/* in/out forward substitution */
buffer
->
clear_output
();
buffer
->
clear_output
();
buffer
->
i
n_pos
=
0
;
buffer
->
i
=
0
;
while
(
buffer
->
i
n_pos
<
buffer
->
len
)
while
(
buffer
->
i
<
buffer
->
len
)
{
{
if
((
~
buffer
->
info
[
buffer
->
i
n_pos
].
mask
&
mask
)
&&
if
((
~
buffer
->
info
[
buffer
->
i
].
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
...
@@ -843,17 +843,17 @@ struct SubstLookup : Lookup
...
@@ -843,17 +843,17 @@ struct SubstLookup : Lookup
else
else
{
{
/* in-place backward substitution */
/* in-place backward substitution */
buffer
->
i
n_pos
=
buffer
->
len
-
1
;
buffer
->
i
=
buffer
->
len
-
1
;
do
do
{
{
if
((
~
buffer
->
info
[
buffer
->
i
n_pos
].
mask
&
mask
)
&&
if
((
~
buffer
->
info
[
buffer
->
i
].
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
buffer
->
i
n_pos
--
;
buffer
->
i
--
;
}
}
while
((
int
)
buffer
->
i
n_pos
>=
0
);
while
((
int
)
buffer
->
i
>=
0
);
}
}
return
ret
;
return
ret
;
...
...
src/hb-ot-layout-gsubgpos-private.hh
浏览文件 @
36b73c80
...
@@ -88,11 +88,11 @@ static inline bool match_input (hb_apply_context_t *c,
...
@@ -88,11 +88,11 @@ static inline bool match_input (hb_apply_context_t *c,
unsigned
int
*
context_length_out
)
unsigned
int
*
context_length_out
)
{
{
unsigned
int
i
,
j
;
unsigned
int
i
,
j
;
unsigned
int
end
=
MIN
(
c
->
buffer
->
len
,
c
->
buffer
->
i
n_pos
+
c
->
context_length
);
unsigned
int
end
=
MIN
(
c
->
buffer
->
len
,
c
->
buffer
->
i
+
c
->
context_length
);
if
(
unlikely
(
c
->
buffer
->
i
n_pos
+
count
>
end
))
if
(
unlikely
(
c
->
buffer
->
i
+
count
>
end
))
return
false
;
return
false
;
for
(
i
=
1
,
j
=
c
->
buffer
->
i
n_pos
+
1
;
i
<
count
;
i
++
,
j
++
)
for
(
i
=
1
,
j
=
c
->
buffer
->
i
+
1
;
i
<
count
;
i
++
,
j
++
)
{
{
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
info
[
j
],
c
->
lookup_flag
,
NULL
))
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
info
[
j
],
c
->
lookup_flag
,
NULL
))
{
{
...
@@ -105,7 +105,7 @@ static inline bool match_input (hb_apply_context_t *c,
...
@@ -105,7 +105,7 @@ static inline bool match_input (hb_apply_context_t *c,
return
false
;
return
false
;
}
}
*
context_length_out
=
j
-
c
->
buffer
->
i
n_pos
;
*
context_length_out
=
j
-
c
->
buffer
->
i
;
return
true
;
return
true
;
}
}
...
@@ -143,11 +143,11 @@ static inline bool match_lookahead (hb_apply_context_t *c,
...
@@ -143,11 +143,11 @@ static inline bool match_lookahead (hb_apply_context_t *c,
unsigned
int
offset
)
unsigned
int
offset
)
{
{
unsigned
int
i
,
j
;
unsigned
int
i
,
j
;
unsigned
int
end
=
MIN
(
c
->
buffer
->
len
,
c
->
buffer
->
i
n_pos
+
c
->
context_length
);
unsigned
int
end
=
MIN
(
c
->
buffer
->
len
,
c
->
buffer
->
i
+
c
->
context_length
);
if
(
unlikely
(
c
->
buffer
->
i
n_pos
+
offset
+
count
>
end
))
if
(
unlikely
(
c
->
buffer
->
i
+
offset
+
count
>
end
))
return
false
;
return
false
;
for
(
i
=
0
,
j
=
c
->
buffer
->
i
n_pos
+
offset
;
i
<
count
;
i
++
,
j
++
)
for
(
i
=
0
,
j
=
c
->
buffer
->
i
+
offset
;
i
<
count
;
i
++
,
j
++
)
{
{
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
info
[
j
],
c
->
lookup_flag
,
NULL
))
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
info
[
j
],
c
->
lookup_flag
,
NULL
))
{
{
...
@@ -185,8 +185,8 @@ static inline bool apply_lookup (hb_apply_context_t *c,
...
@@ -185,8 +185,8 @@ static inline bool apply_lookup (hb_apply_context_t *c,
const
LookupRecord
lookupRecord
[],
/* Array of LookupRecords--in design order */
const
LookupRecord
lookupRecord
[],
/* Array of LookupRecords--in design order */
apply_lookup_func_t
apply_func
)
apply_lookup_func_t
apply_func
)
{
{
unsigned
int
end
=
MIN
(
c
->
buffer
->
len
,
c
->
buffer
->
i
n_pos
+
c
->
context_length
);
unsigned
int
end
=
MIN
(
c
->
buffer
->
len
,
c
->
buffer
->
i
+
c
->
context_length
);
if
(
unlikely
(
c
->
buffer
->
i
n_pos
+
count
>
end
))
if
(
unlikely
(
c
->
buffer
->
i
+
count
>
end
))
return
false
;
return
false
;
/* TODO We don't support lookupRecord arrays that are not increasing:
/* TODO We don't support lookupRecord arrays that are not increasing:
...
@@ -198,9 +198,9 @@ static inline bool apply_lookup (hb_apply_context_t *c,
...
@@ -198,9 +198,9 @@ 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
->
info
[
c
->
buffer
->
i
n_pos
],
c
->
lookup_flag
,
NULL
))
while
(
_hb_ot_layout_skip_mark
(
c
->
layout
->
face
,
&
c
->
buffer
->
info
[
c
->
buffer
->
i
],
c
->
lookup_flag
,
NULL
))
{
{
if
(
unlikely
(
c
->
buffer
->
i
n_pos
==
end
))
if
(
unlikely
(
c
->
buffer
->
i
==
end
))
return
true
;
return
true
;
/* No lookup applied for this index */
/* No lookup applied for this index */
c
->
buffer
->
next_glyph
();
c
->
buffer
->
next_glyph
();
...
@@ -208,7 +208,7 @@ static inline bool apply_lookup (hb_apply_context_t *c,
...
@@ -208,7 +208,7 @@ static inline bool apply_lookup (hb_apply_context_t *c,
if
(
lookupCount
&&
i
==
lookupRecord
->
sequenceIndex
)
if
(
lookupCount
&&
i
==
lookupRecord
->
sequenceIndex
)
{
{
unsigned
int
old_pos
=
c
->
buffer
->
i
n_pos
;
unsigned
int
old_pos
=
c
->
buffer
->
i
;
/* Apply a lookup */
/* Apply a lookup */
bool
done
=
apply_func
(
c
,
lookupRecord
->
lookupListIndex
);
bool
done
=
apply_func
(
c
,
lookupRecord
->
lookupListIndex
);
...
@@ -216,8 +216,8 @@ static inline bool apply_lookup (hb_apply_context_t *c,
...
@@ -216,8 +216,8 @@ static inline bool apply_lookup (hb_apply_context_t *c,
lookupRecord
++
;
lookupRecord
++
;
lookupCount
--
;
lookupCount
--
;
/* Err, this is wrong if the lookup jumped over some glyphs */
/* Err, this is wrong if the lookup jumped over some glyphs */
i
+=
c
->
buffer
->
i
n_pos
-
old_pos
;
i
+=
c
->
buffer
->
i
-
old_pos
;
if
(
unlikely
(
c
->
buffer
->
i
n_pos
==
end
))
if
(
unlikely
(
c
->
buffer
->
i
==
end
))
return
true
;
return
true
;
if
(
!
done
)
if
(
!
done
)
...
@@ -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
->
info
[
c
->
buffer
->
i
n_pos
].
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
i
].
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
->
info
[
c
->
buffer
->
i
n_pos
].
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
i
].
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
->
info
[
c
->
buffer
->
i
n_pos
].
codepoint
);
index
=
class_def
(
c
->
buffer
->
info
[
c
->
buffer
->
i
].
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
->
info
[
c
->
buffer
->
i
n_pos
].
codepoint
);
unsigned
int
index
=
(
this
+
coverage
[
0
])
(
c
->
buffer
->
info
[
c
->
buffer
->
i
].
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
if
(
likely
(
index
==
NOT_COVERED
))
return
false
;
return
false
;
...
@@ -520,7 +520,7 @@ static inline bool chain_context_lookup (hb_apply_context_t *c,
...
@@ -520,7 +520,7 @@ static inline bool chain_context_lookup (hb_apply_context_t *c,
{
{
/* First guess */
/* First guess */
if
(
unlikely
(
c
->
buffer
->
out_len
<
backtrackCount
||
if
(
unlikely
(
c
->
buffer
->
out_len
<
backtrackCount
||
c
->
buffer
->
i
n_pos
+
inputCount
+
lookaheadCount
>
c
->
buffer
->
len
||
c
->
buffer
->
i
+
inputCount
+
lookaheadCount
>
c
->
buffer
->
len
||
inputCount
+
lookaheadCount
>
c
->
context_length
))
inputCount
+
lookaheadCount
>
c
->
context_length
))
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
->
info
[
c
->
buffer
->
i
n_pos
].
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
i
].
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
->
info
[
c
->
buffer
->
i
n_pos
].
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
i
].
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
->
info
[
c
->
buffer
->
i
n_pos
].
codepoint
);
index
=
input_class_def
(
c
->
buffer
->
info
[
c
->
buffer
->
i
].
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
->
info
[
c
->
buffer
->
i
n_pos
].
codepoint
);
unsigned
int
index
=
(
this
+
input
[
0
])
(
c
->
buffer
->
info
[
c
->
buffer
->
i
].
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
if
(
likely
(
index
==
NOT_COVERED
))
return
false
;
return
false
;
...
...
src/hb-shape.cc
浏览文件 @
36b73c80
...
@@ -49,9 +49,9 @@ hb_form_clusters (hb_buffer_t *buffer)
...
@@ -49,9 +49,9 @@ hb_form_clusters (hb_buffer_t *buffer)
unsigned
int
count
;
unsigned
int
count
;
count
=
buffer
->
len
;
count
=
buffer
->
len
;
for
(
buffer
->
i
n_pos
=
1
;
buffer
->
in_pos
<
count
;
buffer
->
in_pos
++
)
for
(
buffer
->
i
=
1
;
buffer
->
i
<
count
;
buffer
->
i
++
)
if
(
buffer
->
unicode
->
get_general_category
(
buffer
->
info
[
buffer
->
i
n_pos
].
codepoint
)
==
HB_CATEGORY_NON_SPACING_MARK
)
if
(
buffer
->
unicode
->
get_general_category
(
buffer
->
info
[
buffer
->
i
].
codepoint
)
==
HB_CATEGORY_NON_SPACING_MARK
)
buffer
->
info
[
buffer
->
i
n_pos
].
cluster
=
buffer
->
info
[
buffer
->
in_pos
-
1
].
cluster
;
buffer
->
info
[
buffer
->
i
].
cluster
=
buffer
->
info
[
buffer
->
i
-
1
].
cluster
;
}
}
static
hb_direction_t
static
hb_direction_t
...
@@ -83,8 +83,8 @@ hb_mirror_chars (hb_buffer_t *buffer)
...
@@ -83,8 +83,8 @@ hb_mirror_chars (hb_buffer_t *buffer)
return
;
return
;
count
=
buffer
->
len
;
count
=
buffer
->
len
;
for
(
buffer
->
i
n_pos
=
0
;
buffer
->
in_pos
<
count
;
buffer
->
in_pos
++
)
{
for
(
buffer
->
i
=
0
;
buffer
->
i
<
count
;
buffer
->
i
++
)
{
buffer
->
info
[
buffer
->
i
n_pos
].
codepoint
=
get_mirroring
(
buffer
->
info
[
buffer
->
in_pos
].
codepoint
);
buffer
->
info
[
buffer
->
i
].
codepoint
=
get_mirroring
(
buffer
->
info
[
buffer
->
i
].
codepoint
);
}
}
}
}
...
@@ -98,15 +98,15 @@ hb_map_glyphs (hb_font_t *font,
...
@@ -98,15 +98,15 @@ hb_map_glyphs (hb_font_t *font,
if
(
unlikely
(
!
buffer
->
len
))
if
(
unlikely
(
!
buffer
->
len
))
return
;
return
;
count
=
buffer
->
len
-
1
;
count
=
buffer
->
len
-
1
;
for
(
buffer
->
i
n_pos
=
0
;
buffer
->
in_pos
<
count
;
buffer
->
in_pos
++
)
{
for
(
buffer
->
i
=
0
;
buffer
->
i
<
count
;
buffer
->
i
++
)
{
if
(
unlikely
(
is_variation_selector
(
buffer
->
info
[
buffer
->
i
n_pos
+
1
].
codepoint
)))
{
if
(
unlikely
(
is_variation_selector
(
buffer
->
info
[
buffer
->
i
+
1
].
codepoint
)))
{
buffer
->
info
[
buffer
->
i
n_pos
].
codepoint
=
hb_font_get_glyph
(
font
,
face
,
buffer
->
info
[
buffer
->
in_pos
].
codepoint
,
buffer
->
info
[
buffer
->
in_pos
+
1
].
codepoint
);
buffer
->
info
[
buffer
->
i
].
codepoint
=
hb_font_get_glyph
(
font
,
face
,
buffer
->
info
[
buffer
->
i
].
codepoint
,
buffer
->
info
[
buffer
->
i
+
1
].
codepoint
);
buffer
->
i
n_pos
++
;
buffer
->
i
++
;
}
else
{
}
else
{
buffer
->
info
[
buffer
->
i
n_pos
].
codepoint
=
hb_font_get_glyph
(
font
,
face
,
buffer
->
info
[
buffer
->
in_pos
].
codepoint
,
0
);
buffer
->
info
[
buffer
->
i
].
codepoint
=
hb_font_get_glyph
(
font
,
face
,
buffer
->
info
[
buffer
->
i
].
codepoint
,
0
);
}
}
}
}
buffer
->
info
[
buffer
->
i
n_pos
].
codepoint
=
hb_font_get_glyph
(
font
,
face
,
buffer
->
info
[
buffer
->
in_pos
].
codepoint
,
0
);
buffer
->
info
[
buffer
->
i
].
codepoint
=
hb_font_get_glyph
(
font
,
face
,
buffer
->
info
[
buffer
->
i
].
codepoint
,
0
);
}
}
static
void
static
void
...
@@ -155,11 +155,11 @@ hb_position_default (hb_font_t *font,
...
@@ -155,11 +155,11 @@ hb_position_default (hb_font_t *font,
hb_buffer_clear_positions
(
buffer
);
hb_buffer_clear_positions
(
buffer
);
count
=
buffer
->
len
;
count
=
buffer
->
len
;
for
(
buffer
->
i
n_pos
=
0
;
buffer
->
in_pos
<
count
;
buffer
->
in_pos
++
)
{
for
(
buffer
->
i
=
0
;
buffer
->
i
<
count
;
buffer
->
i
++
)
{
hb_glyph_metrics_t
metrics
;
hb_glyph_metrics_t
metrics
;
hb_font_get_glyph_metrics
(
font
,
face
,
buffer
->
info
[
buffer
->
i
n_pos
].
codepoint
,
&
metrics
);
hb_font_get_glyph_metrics
(
font
,
face
,
buffer
->
info
[
buffer
->
i
].
codepoint
,
&
metrics
);
buffer
->
pos
[
buffer
->
i
n_pos
].
x_advance
=
metrics
.
x_advance
;
buffer
->
pos
[
buffer
->
i
].
x_advance
=
metrics
.
x_advance
;
buffer
->
pos
[
buffer
->
i
n_pos
].
y_advance
=
metrics
.
y_advance
;
buffer
->
pos
[
buffer
->
i
].
y_advance
=
metrics
.
y_advance
;
}
}
}
}
...
@@ -194,14 +194,14 @@ hb_truetype_kern (hb_font_t *font,
...
@@ -194,14 +194,14 @@ hb_truetype_kern (hb_font_t *font,
/* TODO Check for kern=0 */
/* TODO Check for kern=0 */
count
=
buffer
->
len
;
count
=
buffer
->
len
;
for
(
buffer
->
i
n_pos
=
1
;
buffer
->
in_pos
<
count
;
buffer
->
in_pos
++
)
{
for
(
buffer
->
i
=
1
;
buffer
->
i
<
count
;
buffer
->
i
++
)
{
hb_position_t
kern
,
kern1
,
kern2
;
hb_position_t
kern
,
kern1
,
kern2
;
kern
=
hb_font_get_kerning
(
font
,
face
,
buffer
->
info
[
buffer
->
i
n_pos
-
1
].
codepoint
,
buffer
->
info
[
buffer
->
in_pos
].
codepoint
);
kern
=
hb_font_get_kerning
(
font
,
face
,
buffer
->
info
[
buffer
->
i
-
1
].
codepoint
,
buffer
->
info
[
buffer
->
i
].
codepoint
);
kern1
=
kern
>>
1
;
kern1
=
kern
>>
1
;
kern2
=
kern
-
kern1
;
kern2
=
kern
-
kern1
;
buffer
->
pos
[
buffer
->
i
n_pos
-
1
].
x_advance
+=
kern1
;
buffer
->
pos
[
buffer
->
i
-
1
].
x_advance
+=
kern1
;
buffer
->
pos
[
buffer
->
i
n_pos
].
x_advance
+=
kern2
;
buffer
->
pos
[
buffer
->
i
].
x_advance
+=
kern2
;
buffer
->
pos
[
buffer
->
i
n_pos
].
x_offset
+=
kern2
;
buffer
->
pos
[
buffer
->
i
].
x_offset
+=
kern2
;
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录