Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
99c26957
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看板
提交
99c26957
编写于
5月 13, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add accessort to buffer for current info, current pos, and prev info
上级
6736f3c5
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
76 addition
and
66 deletion
+76
-66
src/hb-buffer-private.hh
src/hb-buffer-private.hh
+9
-0
src/hb-ot-layout-gpos-table.hh
src/hb-ot-layout-gpos-table.hh
+22
-22
src/hb-ot-layout-gsub-table.hh
src/hb-ot-layout-gsub-table.hh
+14
-14
src/hb-ot-layout-gsubgpos-private.hh
src/hb-ot-layout-gsubgpos-private.hh
+14
-14
src/hb-ot-shape-complex-arabic.cc
src/hb-ot-shape-complex-arabic.cc
+2
-2
src/hb-ot-shape-complex-misc.cc
src/hb-ot-shape-complex-misc.cc
+3
-2
src/hb-ot-shape-normalize.cc
src/hb-ot-shape-normalize.cc
+8
-8
src/hb-ot-shape.cc
src/hb-ot-shape.cc
+4
-4
未找到文件。
src/hb-buffer-private.hh
浏览文件 @
99c26957
...
...
@@ -70,6 +70,15 @@ struct _hb_buffer_t {
hb_glyph_info_t
*
out_info
;
hb_glyph_position_t
*
pos
;
inline
hb_glyph_info_t
&
cur
(
unsigned
int
i
=
0
)
{
return
info
[
idx
+
i
];
}
inline
hb_glyph_info_t
cur
(
unsigned
int
i
=
0
)
const
{
return
info
[
idx
+
i
];
}
inline
hb_glyph_position_t
&
cur_pos
(
unsigned
int
i
=
0
)
{
return
pos
[
idx
+
i
];
}
inline
hb_glyph_position_t
cur_pos
(
unsigned
int
i
=
0
)
const
{
return
pos
[
idx
+
i
];
}
inline
hb_glyph_info_t
&
prev
(
void
)
{
return
out_info
[
out_len
-
1
];
}
inline
hb_glyph_info_t
prev
(
void
)
const
{
return
info
[
out_len
-
1
];
}
unsigned
int
serial
;
uint8_t
allocated_var_bytes
[
8
];
const
char
*
allocated_var_owner
[
8
];
...
...
src/hb-ot-layout-gpos-table.hh
浏览文件 @
99c26957
...
...
@@ -403,10 +403,10 @@ struct MarkArray : ArrayOf<MarkRecord> /* Array of MarkRecords--in Coverage orde
hb_position_t
mark_x
,
mark_y
,
base_x
,
base_y
;
mark_anchor
.
get_anchor
(
c
->
font
,
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
codepoint
,
&
mark_x
,
&
mark_y
);
mark_anchor
.
get_anchor
(
c
->
font
,
c
->
buffer
->
cur
()
.
codepoint
,
&
mark_x
,
&
mark_y
);
glyph_anchor
.
get_anchor
(
c
->
font
,
c
->
buffer
->
info
[
glyph_pos
].
codepoint
,
&
base_x
,
&
base_y
);
hb_glyph_position_t
&
o
=
c
->
buffer
->
pos
[
c
->
buffer
->
idx
]
;
hb_glyph_position_t
&
o
=
c
->
buffer
->
cur_pos
()
;
o
.
x_offset
=
base_x
-
mark_x
;
o
.
y_offset
=
base_y
-
mark_y
;
o
.
attach_lookback
()
=
c
->
buffer
->
idx
-
glyph_pos
;
...
...
@@ -432,11 +432,11 @@ struct SinglePosFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
TRACE_APPLY
();
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
cur
()
.
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
valueFormat
.
apply_value
(
c
->
font
,
c
->
direction
,
this
,
values
,
c
->
buffer
->
pos
[
c
->
buffer
->
idx
]
);
values
,
c
->
buffer
->
cur_pos
()
);
c
->
buffer
->
idx
++
;
return
TRACE_RETURN
(
true
);
...
...
@@ -469,14 +469,14 @@ struct SinglePosFormat2
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
TRACE_APPLY
();
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
cur
()
.
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
if
(
likely
(
index
>=
valueCount
))
return
TRACE_RETURN
(
false
);
valueFormat
.
apply_value
(
c
->
font
,
c
->
direction
,
this
,
&
values
[
index
*
valueFormat
.
get_len
()],
c
->
buffer
->
pos
[
c
->
buffer
->
idx
]
);
c
->
buffer
->
cur_pos
()
);
c
->
buffer
->
idx
++
;
return
TRACE_RETURN
(
true
);
...
...
@@ -569,7 +569,7 @@ struct PairSet
if
(
c
->
buffer
->
info
[
pos
].
codepoint
==
record
->
secondGlyph
)
{
valueFormats
[
0
].
apply_value
(
c
->
font
,
c
->
direction
,
this
,
&
record
->
values
[
0
],
c
->
buffer
->
pos
[
c
->
buffer
->
idx
]
);
&
record
->
values
[
0
],
c
->
buffer
->
cur_pos
()
);
valueFormats
[
1
].
apply_value
(
c
->
font
,
c
->
direction
,
this
,
&
record
->
values
[
len1
],
c
->
buffer
->
pos
[
pos
]);
if
(
len2
)
...
...
@@ -620,7 +620,7 @@ struct PairPosFormat1
hb_apply_context_t
::
mark_skipping_forward_iterator_t
skippy_iter
(
c
,
c
->
buffer
->
idx
,
1
);
if
(
skippy_iter
.
has_no_chance
())
return
TRACE_RETURN
(
false
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
cur
()
.
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
if
(
!
skippy_iter
.
next
())
return
TRACE_RETURN
(
false
);
...
...
@@ -672,7 +672,7 @@ struct PairPosFormat2
hb_apply_context_t
::
mark_skipping_forward_iterator_t
skippy_iter
(
c
,
c
->
buffer
->
idx
,
1
);
if
(
skippy_iter
.
has_no_chance
())
return
TRACE_RETURN
(
false
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
cur
()
.
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
if
(
!
skippy_iter
.
next
())
return
TRACE_RETURN
(
false
);
...
...
@@ -681,13 +681,13 @@ struct PairPosFormat2
unsigned
int
len2
=
valueFormat2
.
get_len
();
unsigned
int
record_len
=
len1
+
len2
;
unsigned
int
klass1
=
(
this
+
classDef1
)
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
codepoint
);
unsigned
int
klass1
=
(
this
+
classDef1
)
(
c
->
buffer
->
cur
()
.
codepoint
);
unsigned
int
klass2
=
(
this
+
classDef2
)
(
c
->
buffer
->
info
[
skippy_iter
.
idx
].
codepoint
);
if
(
unlikely
(
klass1
>=
class1Count
||
klass2
>=
class2Count
))
return
TRACE_RETURN
(
false
);
const
Value
*
v
=
&
values
[
record_len
*
(
klass1
*
class2Count
+
klass2
)];
valueFormat1
.
apply_value
(
c
->
font
,
c
->
direction
,
this
,
v
,
c
->
buffer
->
pos
[
c
->
buffer
->
idx
]
);
v
,
c
->
buffer
->
cur_pos
()
);
valueFormat2
.
apply_value
(
c
->
font
,
c
->
direction
,
this
,
v
+
len1
,
c
->
buffer
->
pos
[
skippy_iter
.
idx
]);
...
...
@@ -816,7 +816,7 @@ struct CursivePosFormat1
hb_apply_context_t
::
mark_skipping_forward_iterator_t
skippy_iter
(
c
,
c
->
buffer
->
idx
,
1
);
if
(
skippy_iter
.
has_no_chance
())
return
TRACE_RETURN
(
false
);
const
EntryExitRecord
&
this_record
=
entryExitRecord
[(
this
+
coverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
codepoint
)];
const
EntryExitRecord
&
this_record
=
entryExitRecord
[(
this
+
coverage
)
(
c
->
buffer
->
cur
()
.
codepoint
)];
if
(
!
this_record
.
exitAnchor
)
return
TRACE_RETURN
(
false
);
if
(
!
skippy_iter
.
next
())
return
TRACE_RETURN
(
false
);
...
...
@@ -949,7 +949,7 @@ struct MarkBasePosFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
TRACE_APPLY
();
unsigned
int
mark_index
=
(
this
+
markCoverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
codepoint
);
unsigned
int
mark_index
=
(
this
+
markCoverage
)
(
c
->
buffer
->
cur
()
.
codepoint
);
if
(
likely
(
mark_index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
/* now we search backwards for a non-mark glyph */
...
...
@@ -1040,7 +1040,7 @@ struct MarkLigPosFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
TRACE_APPLY
();
unsigned
int
mark_index
=
(
this
+
markCoverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
codepoint
);
unsigned
int
mark_index
=
(
this
+
markCoverage
)
(
c
->
buffer
->
cur
()
.
codepoint
);
if
(
likely
(
mark_index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
/* now we search backwards for a non-mark glyph */
...
...
@@ -1068,10 +1068,10 @@ struct MarkLigPosFormat1
* can directly use the component index. If not, we attach the mark
* glyph to the last component of the ligature. */
if
(
get_lig_id
(
c
->
buffer
->
info
[
j
])
&&
get_lig_id
(
c
->
buffer
->
info
[
j
])
==
get_lig_id
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
)
&&
get_lig_comp
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
)
>
0
)
get_lig_id
(
c
->
buffer
->
cur
()
)
&&
get_lig_comp
(
c
->
buffer
->
cur
()
)
>
0
)
{
comp_index
=
get_lig_comp
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
)
-
1
;
comp_index
=
get_lig_comp
(
c
->
buffer
->
cur
()
)
-
1
;
if
(
comp_index
>=
comp_count
)
comp_index
=
comp_count
-
1
;
}
...
...
@@ -1151,7 +1151,7 @@ struct MarkMarkPosFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
TRACE_APPLY
();
unsigned
int
mark1_index
=
(
this
+
mark1Coverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
codepoint
);
unsigned
int
mark1_index
=
(
this
+
mark1Coverage
)
(
c
->
buffer
->
cur
()
.
codepoint
);
if
(
likely
(
mark1_index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
/* now we search backwards for a suitable mark glyph until a non-mark glyph */
...
...
@@ -1166,9 +1166,9 @@ struct MarkMarkPosFormat1
/* 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
* if those are non-zero, the ligid number should also match. */
if
((
get_lig_comp
(
c
->
buffer
->
info
[
j
])
!=
get_lig_comp
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
))
||
if
((
get_lig_comp
(
c
->
buffer
->
cur
()
))
||
(
get_lig_comp
(
c
->
buffer
->
info
[
j
])
>
0
&&
get_lig_id
(
c
->
buffer
->
info
[
j
])
!=
get_lig_id
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
)))
get_lig_id
(
c
->
buffer
->
cur
()
)))
return
TRACE_RETURN
(
false
);
unsigned
int
mark2_index
=
(
this
+
mark2Coverage
)
(
c
->
buffer
->
info
[
j
].
codepoint
);
...
...
@@ -1363,7 +1363,7 @@ struct PosLookup : Lookup
{
unsigned
int
lookup_type
=
get_type
();
if
(
!
_hb_ot_layout_check_glyph_property
(
c
->
face
,
&
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
,
c
->
lookup_props
,
&
c
->
property
))
if
(
!
_hb_ot_layout_check_glyph_property
(
c
->
face
,
&
c
->
buffer
->
cur
()
,
c
->
lookup_props
,
&
c
->
property
))
return
false
;
for
(
unsigned
int
i
=
0
;
i
<
get_subtable_count
();
i
++
)
...
...
@@ -1385,7 +1385,7 @@ struct PosLookup : Lookup
c
->
buffer
->
idx
=
0
;
while
(
c
->
buffer
->
idx
<
c
->
buffer
->
len
)
{
if
((
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
mask
&
c
->
lookup_mask
)
&&
apply_once
(
c
))
if
((
c
->
buffer
->
cur
()
.
mask
&
c
->
lookup_mask
)
&&
apply_once
(
c
))
ret
=
true
;
else
c
->
buffer
->
idx
++
;
...
...
src/hb-ot-layout-gsub-table.hh
浏览文件 @
99c26957
...
...
@@ -58,7 +58,7 @@ struct SingleSubstFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
TRACE_APPLY
();
hb_codepoint_t
glyph_id
=
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
codepoint
;
hb_codepoint_t
glyph_id
=
c
->
buffer
->
cur
()
.
codepoint
;
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
...
...
@@ -110,7 +110,7 @@ struct SingleSubstFormat2
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
TRACE_APPLY
();
hb_codepoint_t
glyph_id
=
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
codepoint
;
hb_codepoint_t
glyph_id
=
c
->
buffer
->
cur
()
.
codepoint
;
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
...
...
@@ -257,7 +257,7 @@ struct MultipleSubstFormat1
{
TRACE_APPLY
();
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
cur
()
.
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
return
TRACE_RETURN
((
this
+
sequence
[
index
]).
apply
(
c
));
...
...
@@ -360,7 +360,7 @@ struct AlternateSubstFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
TRACE_APPLY
();
hb_codepoint_t
glyph_id
=
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
codepoint
;
hb_codepoint_t
glyph_id
=
c
->
buffer
->
cur
()
.
codepoint
;
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
...
...
@@ -369,7 +369,7 @@ struct AlternateSubstFormat1
if
(
unlikely
(
!
alt_set
.
len
))
return
TRACE_RETURN
(
false
);
hb_mask_t
glyph_mask
=
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
mask
;
hb_mask_t
glyph_mask
=
c
->
buffer
->
cur
()
.
mask
;
hb_mask_t
lookup_mask
=
c
->
lookup_mask
;
/* Note: This breaks badly if two features enabled this lookup together. */
...
...
@@ -500,7 +500,7 @@ struct Ligature
/* Allocate new ligature id */
unsigned
int
lig_id
=
allocate_lig_id
(
c
->
buffer
);
set_lig_props
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
,
lig_id
,
0
);
set_lig_props
(
c
->
buffer
->
cur
()
,
lig_id
,
0
);
if
(
skippy_iter
.
idx
<
c
->
buffer
->
idx
+
count
)
/* No input glyphs skipped */
{
...
...
@@ -521,8 +521,8 @@ struct Ligature
{
while
(
c
->
should_mark_skip_current_glyph
())
{
set_lig_props
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
,
lig_id
,
i
);
c
->
replace_glyph
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
codepoint
);
set_lig_props
(
c
->
buffer
->
cur
()
,
lig_id
,
i
);
c
->
replace_glyph
(
c
->
buffer
->
cur
()
.
codepoint
);
}
/* Skip the base glyph */
...
...
@@ -628,7 +628,7 @@ struct LigatureSubstFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
TRACE_APPLY
();
hb_codepoint_t
glyph_id
=
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
codepoint
;
hb_codepoint_t
glyph_id
=
c
->
buffer
->
cur
()
.
codepoint
;
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
...
...
@@ -807,7 +807,7 @@ struct ReverseChainSingleSubstFormat1
if
(
unlikely
(
c
->
nesting_level_left
!=
MAX_NESTING_LEVEL
))
return
TRACE_RETURN
(
false
);
/* No chaining to this type */
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
cur
()
.
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
const
OffsetArrayOf
<
Coverage
>
&
lookahead
=
StructAfter
<
OffsetArrayOf
<
Coverage
>
>
(
backtrack
);
...
...
@@ -821,7 +821,7 @@ struct ReverseChainSingleSubstFormat1
match_coverage
,
this
,
1
))
{
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
codepoint
=
substitute
[
index
];
c
->
buffer
->
cur
()
.
codepoint
=
substitute
[
index
];
c
->
buffer
->
idx
--
;
/* Reverse! */
return
TRACE_RETURN
(
true
);
}
...
...
@@ -1055,7 +1055,7 @@ struct SubstLookup : Lookup
{
unsigned
int
lookup_type
=
get_type
();
if
(
!
_hb_ot_layout_check_glyph_property
(
c
->
face
,
&
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
,
c
->
lookup_props
,
&
c
->
property
))
if
(
!
_hb_ot_layout_check_glyph_property
(
c
->
face
,
&
c
->
buffer
->
cur
()
,
c
->
lookup_props
,
&
c
->
property
))
return
false
;
if
(
unlikely
(
lookup_type
==
SubstLookupSubTable
::
Extension
))
...
...
@@ -1096,7 +1096,7 @@ struct SubstLookup : Lookup
c
->
buffer
->
idx
=
0
;
while
(
c
->
buffer
->
idx
<
c
->
buffer
->
len
)
{
if
((
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
mask
&
c
->
lookup_mask
)
&&
apply_once
(
c
))
if
((
c
->
buffer
->
cur
()
.
mask
&
c
->
lookup_mask
)
&&
apply_once
(
c
))
ret
=
true
;
else
c
->
buffer
->
next_glyph
();
...
...
@@ -1111,7 +1111,7 @@ struct SubstLookup : Lookup
c
->
buffer
->
idx
=
c
->
buffer
->
len
-
1
;
do
{
if
((
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
mask
&
c
->
lookup_mask
)
&&
apply_once
(
c
))
if
((
c
->
buffer
->
cur
()
.
mask
&
c
->
lookup_mask
)
&&
apply_once
(
c
))
ret
=
true
;
else
c
->
buffer
->
idx
--
;
...
...
src/hb-ot-layout-gsubgpos-private.hh
浏览文件 @
99c26957
...
...
@@ -95,7 +95,7 @@ struct hb_closure_context_t
#endif
#define TRACE_APPLY() \
hb_auto_trace_t<HB_DEBUG_APPLY> trace (&c->debug_depth, "APPLY", this, HB_FUNC, "idx %d codepoint %u", c->buffer->
idx, c->buffer->info[c->buffer->idx]
.codepoint);
hb_auto_trace_t<HB_DEBUG_APPLY> trace (&c->debug_depth, "APPLY", this, HB_FUNC, "idx %d codepoint %u", c->buffer->
cur()
.codepoint);
...
...
@@ -137,7 +137,7 @@ struct hb_apply_context_t
idx
=
start_index_
;
num_items
=
num_items_
;
mask
=
context_match
?
-
1
:
c
->
lookup_mask
;
syllable
=
context_match
?
0
:
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
syllable
();
syllable
=
context_match
?
0
:
c
->
buffer
->
cur
()
.
syllable
();
end
=
c
->
buffer
->
len
;
}
inline
bool
has_no_chance
(
void
)
const
...
...
@@ -183,7 +183,7 @@ struct hb_apply_context_t
idx
=
start_index_
;
num_items
=
num_items_
;
mask
=
mask_
?
mask_
:
c
->
lookup_mask
;
syllable
=
match_syllable_
?
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
syllable
()
:
0
;
syllable
=
match_syllable_
?
c
->
buffer
->
cur
()
.
syllable
()
:
0
;
}
inline
bool
has_no_chance
(
void
)
const
{
...
...
@@ -217,7 +217,7 @@ struct hb_apply_context_t
inline
bool
should_mark_skip_current_glyph
(
void
)
const
{
return
_hb_ot_layout_skip_mark
(
face
,
&
buffer
->
info
[
buffer
->
idx
]
,
lookup_props
,
NULL
);
return
_hb_ot_layout_skip_mark
(
face
,
&
buffer
->
cur
()
,
lookup_props
,
NULL
);
}
...
...
@@ -238,14 +238,14 @@ struct hb_apply_context_t
inline
void
guess_glyph_class
(
unsigned
int
klass
)
{
/* XXX if ! has gdef */
buffer
->
info
[
buffer
->
idx
]
.
props_cache
()
=
klass
;
buffer
->
cur
()
.
props_cache
()
=
klass
;
}
private:
inline
void
clear_property
(
void
)
const
{
/* XXX if has gdef */
buffer
->
info
[
buffer
->
idx
]
.
props_cache
()
=
0
;
buffer
->
cur
()
.
props_cache
()
=
0
;
}
};
...
...
@@ -625,7 +625,7 @@ struct ContextFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
,
apply_lookup_func_t
apply_func
)
const
{
TRACE_APPLY
();
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
cur
()
.
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
...
...
@@ -685,11 +685,11 @@ struct ContextFormat2
inline
bool
apply
(
hb_apply_context_t
*
c
,
apply_lookup_func_t
apply_func
)
const
{
TRACE_APPLY
();
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
cur
()
.
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
const
ClassDef
&
class_def
=
this
+
classDef
;
index
=
class_def
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
codepoint
);
index
=
class_def
(
c
->
buffer
->
cur
()
.
codepoint
);
const
RuleSet
&
rule_set
=
this
+
ruleSet
[
index
];
struct
ContextApplyLookupContext
lookup_context
=
{
{
match_class
,
apply_func
},
...
...
@@ -745,7 +745,7 @@ struct ContextFormat3
inline
bool
apply
(
hb_apply_context_t
*
c
,
apply_lookup_func_t
apply_func
)
const
{
TRACE_APPLY
();
unsigned
int
index
=
(
this
+
coverage
[
0
])
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
codepoint
);
unsigned
int
index
=
(
this
+
coverage
[
0
])
(
c
->
buffer
->
cur
()
.
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
const
LookupRecord
*
lookupRecord
=
&
StructAtOffset
<
LookupRecord
>
(
coverage
,
coverage
[
0
].
static_size
*
glyphCount
);
...
...
@@ -1020,7 +1020,7 @@ struct ChainContextFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
,
apply_lookup_func_t
apply_func
)
const
{
TRACE_APPLY
();
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
cur
()
.
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
const
ChainRuleSet
&
rule_set
=
this
+
ruleSet
[
index
];
...
...
@@ -1082,14 +1082,14 @@ struct ChainContextFormat2
inline
bool
apply
(
hb_apply_context_t
*
c
,
apply_lookup_func_t
apply_func
)
const
{
TRACE_APPLY
();
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
cur
()
.
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
const
ClassDef
&
backtrack_class_def
=
this
+
backtrackClassDef
;
const
ClassDef
&
input_class_def
=
this
+
inputClassDef
;
const
ClassDef
&
lookahead_class_def
=
this
+
lookaheadClassDef
;
index
=
input_class_def
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
codepoint
);
index
=
input_class_def
(
c
->
buffer
->
cur
()
.
codepoint
);
const
ChainRuleSet
&
rule_set
=
this
+
ruleSet
[
index
];
struct
ChainContextApplyLookupContext
lookup_context
=
{
{
match_class
,
apply_func
},
...
...
@@ -1164,7 +1164,7 @@ struct ChainContextFormat3
TRACE_APPLY
();
const
OffsetArrayOf
<
Coverage
>
&
input
=
StructAfter
<
OffsetArrayOf
<
Coverage
>
>
(
backtrack
);
unsigned
int
index
=
(
this
+
input
[
0
])
(
c
->
buffer
->
info
[
c
->
buffer
->
idx
]
.
codepoint
);
unsigned
int
index
=
(
this
+
input
[
0
])
(
c
->
buffer
->
cur
()
.
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
const
OffsetArrayOf
<
Coverage
>
&
lookahead
=
StructAfter
<
OffsetArrayOf
<
Coverage
>
>
(
input
);
...
...
src/hb-ot-shape-complex-arabic.cc
浏览文件 @
99c26957
...
...
@@ -222,8 +222,8 @@ arabic_fallback_shape (hb_font_t *font, hb_buffer_t *buffer)
/* Mandatory ligatures */
buffer
->
clear_output
();
for
(
buffer
->
idx
=
0
;
buffer
->
idx
+
1
<
count
;)
{
hb_codepoint_t
ligature
=
get_ligature
(
buffer
->
info
[
buffer
->
idx
]
.
codepoint
,
buffer
->
info
[
buffer
->
idx
+
1
]
.
codepoint
);
hb_codepoint_t
ligature
=
get_ligature
(
buffer
->
cur
()
.
codepoint
,
buffer
->
cur
(
+
1
)
.
codepoint
);
if
(
likely
(
!
ligature
)
||
!
(
hb_font_get_glyph
(
font
,
ligature
,
0
,
&
glyph
)))
{
buffer
->
next_glyph
();
continue
;
...
...
src/hb-ot-shape-complex-misc.cc
浏览文件 @
99c26957
...
...
@@ -141,7 +141,7 @@ _hb_ot_shape_complex_setup_masks_thai (hb_ot_map_t *map, hb_buffer_t *buffer, hb
unsigned
int
count
=
buffer
->
len
;
for
(
buffer
->
idx
=
0
;
buffer
->
idx
<
count
;)
{
hb_codepoint_t
u
=
buffer
->
info
[
buffer
->
idx
]
.
codepoint
;
hb_codepoint_t
u
=
buffer
->
cur
()
.
codepoint
;
if
(
likely
(
!
IS_SARA_AM
(
u
)))
{
buffer
->
next_glyph
();
continue
;
...
...
@@ -167,11 +167,12 @@ _hb_ot_shape_complex_setup_masks_thai (hb_ot_map_t *map, hb_buffer_t *buffer, hb
sizeof
(
buffer
->
out_info
[
0
])
*
(
end
-
start
-
2
));
buffer
->
out_info
[
start
]
=
t
;
/* XXX Make this easier! */
/* Make cluster */
for
(;
start
>
0
&&
buffer
->
out_info
[
start
-
1
].
cluster
==
buffer
->
out_info
[
start
].
cluster
;
start
--
)
;
for
(;
buffer
->
idx
<
count
;)
if
(
buffer
->
info
[
buffer
->
idx
].
cluster
==
buffer
->
out_info
[
buffer
->
out_len
-
1
]
.
cluster
)
if
(
buffer
->
cur
().
cluster
==
buffer
->
prev
()
.
cluster
)
buffer
->
next_glyph
();
else
break
;
...
...
src/hb-ot-shape-normalize.cc
浏览文件 @
99c26957
...
...
@@ -73,7 +73,7 @@ output_glyph (hb_font_t *font, hb_buffer_t *buffer,
hb_codepoint_t
glyph
)
{
buffer
->
output_glyph
(
glyph
);
_hb_glyph_info_set_unicode_props
(
&
buffer
->
out_info
[
buffer
->
out_len
-
1
]
,
buffer
->
unicode
);
_hb_glyph_info_set_unicode_props
(
&
buffer
->
prev
()
,
buffer
->
unicode
);
}
static
bool
...
...
@@ -116,7 +116,7 @@ static void
decompose_current_glyph
(
hb_font_t
*
font
,
hb_buffer_t
*
buffer
,
bool
shortest
)
{
if
(
decompose
(
font
,
buffer
,
shortest
,
buffer
->
info
[
buffer
->
idx
]
.
codepoint
))
if
(
decompose
(
font
,
buffer
,
shortest
,
buffer
->
cur
()
.
codepoint
))
buffer
->
skip_glyph
();
else
buffer
->
next_glyph
();
...
...
@@ -129,7 +129,7 @@ decompose_single_char_cluster (hb_font_t *font, hb_buffer_t *buffer,
hb_codepoint_t
glyph
;
/* If recomposing and font supports this, we're good to go */
if
(
will_recompose
&&
hb_font_get_glyph
(
font
,
buffer
->
info
[
buffer
->
idx
]
.
codepoint
,
0
,
&
glyph
))
{
if
(
will_recompose
&&
hb_font_get_glyph
(
font
,
buffer
->
cur
()
.
codepoint
,
0
,
&
glyph
))
{
buffer
->
next_glyph
();
return
;
}
...
...
@@ -185,7 +185,7 @@ _hb_ot_shape_normalize (hb_font_t *font, hb_buffer_t *buffer,
{
unsigned
int
end
;
for
(
end
=
buffer
->
idx
+
1
;
end
<
count
;
end
++
)
if
(
buffer
->
info
[
buffer
->
idx
]
.
cluster
!=
buffer
->
info
[
end
].
cluster
)
if
(
buffer
->
cur
()
.
cluster
!=
buffer
->
info
[
end
].
cluster
)
break
;
if
(
buffer
->
idx
+
1
==
end
)
...
...
@@ -247,15 +247,15 @@ _hb_ot_shape_normalize (hb_font_t *font, hb_buffer_t *buffer,
if
(
/* If mode is NOT COMPOSED_FULL (ie. it's COMPOSED_DIACRITICS), we don't try to
* compose a CCC=0 character with it's preceding starter. */
(
mode
==
HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_FULL
||
_hb_glyph_info_get_modified_combining_class
(
&
buffer
->
info
[
buffer
->
idx
]
)
!=
0
)
&&
_hb_glyph_info_get_modified_combining_class
(
&
buffer
->
cur
()
)
!=
0
)
&&
/* If there's anything between the starter and this char, they should have CCC
* smaller than this character's. */
(
starter
==
buffer
->
out_len
-
1
||
_hb_glyph_info_get_modified_combining_class
(
&
buffer
->
out_info
[
buffer
->
out_len
-
1
])
<
_hb_glyph_info_get_modified_combining_class
(
&
buffer
->
info
[
buffer
->
idx
]
))
&&
_hb_glyph_info_get_modified_combining_class
(
&
buffer
->
prev
())
<
_hb_glyph_info_get_modified_combining_class
(
&
buffer
->
cur
()
))
&&
/* And compose. */
hb_unicode_compose
(
buffer
->
unicode
,
buffer
->
out_info
[
starter
].
codepoint
,
buffer
->
info
[
buffer
->
idx
]
.
codepoint
,
buffer
->
cur
()
.
codepoint
,
&
composed
)
&&
/* And the font has glyph for the composite. */
hb_font_get_glyph
(
font
,
composed
,
0
,
&
glyph
))
...
...
@@ -272,7 +272,7 @@ _hb_ot_shape_normalize (hb_font_t *font, hb_buffer_t *buffer,
/* Blocked, or doesn't compose. */
buffer
->
next_glyph
();
if
(
_hb_glyph_info_get_modified_combining_class
(
&
buffer
->
out_info
[
buffer
->
out_len
-
1
]
)
==
0
)
if
(
_hb_glyph_info_get_modified_combining_class
(
&
buffer
->
prev
()
)
==
0
)
starter
=
buffer
->
out_len
-
1
;
}
buffer
->
swap_buffers
();
...
...
src/hb-ot-shape.cc
浏览文件 @
99c26957
...
...
@@ -244,16 +244,16 @@ hb_map_glyphs (hb_font_t *font,
unsigned
int
count
=
buffer
->
len
-
1
;
for
(
buffer
->
idx
=
0
;
buffer
->
idx
<
count
;)
{
if
(
unlikely
(
_hb_unicode_is_variation_selector
(
buffer
->
info
[
buffer
->
idx
+
1
]
.
codepoint
)))
{
hb_font_get_glyph
(
font
,
buffer
->
info
[
buffer
->
idx
].
codepoint
,
buffer
->
info
[
buffer
->
idx
+
1
]
.
codepoint
,
&
glyph
);
if
(
unlikely
(
_hb_unicode_is_variation_selector
(
buffer
->
cur
(
+
1
)
.
codepoint
)))
{
hb_font_get_glyph
(
font
,
buffer
->
cur
().
codepoint
,
buffer
->
cur
(
+
1
)
.
codepoint
,
&
glyph
);
buffer
->
replace_glyphs
(
2
,
1
,
&
glyph
);
}
else
{
hb_font_get_glyph
(
font
,
buffer
->
info
[
buffer
->
idx
]
.
codepoint
,
0
,
&
glyph
);
hb_font_get_glyph
(
font
,
buffer
->
cur
()
.
codepoint
,
0
,
&
glyph
);
buffer
->
replace_glyph
(
glyph
);
}
}
if
(
likely
(
buffer
->
idx
<
buffer
->
len
))
{
hb_font_get_glyph
(
font
,
buffer
->
info
[
buffer
->
idx
]
.
codepoint
,
0
,
&
glyph
);
hb_font_get_glyph
(
font
,
buffer
->
cur
()
.
codepoint
,
0
,
&
glyph
);
buffer
->
replace_glyph
(
glyph
);
}
buffer
->
swap_buffers
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录