Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
cdd756b9
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
1 年多 前同步成功
通知
0
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看板
提交
cdd756b9
编写于
11月 24, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[OTLayout] Implement GPOS collect_glyphs()
上级
4c4e8f0e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
99 addition
and
5 deletion
+99
-5
src/hb-ot-layout-gpos-table.hh
src/hb-ot-layout-gpos-table.hh
+94
-1
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+5
-4
未找到文件。
src/hb-ot-layout-gpos-table.hh
浏览文件 @
cdd756b9
...
...
@@ -419,6 +419,12 @@ struct MarkArray : ArrayOf<MarkRecord> /* Array of MarkRecords--in Coverage orde
struct
SinglePosFormat1
{
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
{
TRACE_COLLECT_GLYPHS
(
this
);
(
this
+
coverage
).
add_coverage
(
&
c
->
input
);
}
inline
const
Coverage
&
get_coverage
(
void
)
const
{
return
this
+
coverage
;
...
...
@@ -458,6 +464,12 @@ struct SinglePosFormat1
struct
SinglePosFormat2
{
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
{
TRACE_COLLECT_GLYPHS
(
this
);
(
this
+
coverage
).
add_coverage
(
&
c
->
input
);
}
inline
const
Coverage
&
get_coverage
(
void
)
const
{
return
this
+
coverage
;
...
...
@@ -548,6 +560,23 @@ struct PairSet
{
friend
struct
PairPosFormat1
;
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
,
const
ValueFormat
*
valueFormats
)
const
{
TRACE_COLLECT_GLYPHS
(
this
);
unsigned
int
len1
=
valueFormats
[
0
].
get_len
();
unsigned
int
len2
=
valueFormats
[
1
].
get_len
();
unsigned
int
record_size
=
USHORT
::
static_size
*
(
1
+
len1
+
len2
);
const
PairValueRecord
*
record
=
CastP
<
PairValueRecord
>
(
array
);
unsigned
int
count
=
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
c
->
input
.
add
(
record
->
secondGlyph
);
record
=
&
StructAtOffset
<
PairValueRecord
>
(
record
,
record_size
);
}
}
inline
bool
apply
(
hb_apply_context_t
*
c
,
const
ValueFormat
*
valueFormats
,
unsigned
int
pos
)
const
...
...
@@ -557,8 +586,8 @@ struct PairSet
unsigned
int
len2
=
valueFormats
[
1
].
get_len
();
unsigned
int
record_size
=
USHORT
::
static_size
*
(
1
+
len1
+
len2
);
unsigned
int
count
=
len
;
const
PairValueRecord
*
record
=
CastP
<
PairValueRecord
>
(
array
);
unsigned
int
count
=
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
if
(
c
->
buffer
->
info
[
pos
].
codepoint
==
record
->
secondGlyph
)
...
...
@@ -606,6 +635,15 @@ struct PairSet
struct
PairPosFormat1
{
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
{
TRACE_COLLECT_GLYPHS
(
this
);
(
this
+
coverage
).
add_coverage
(
&
c
->
input
);
unsigned
int
count
=
pairSet
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
(
this
+
pairSet
[
i
]).
collect_glyphs
(
c
,
&
valueFormat1
);
}
inline
const
Coverage
&
get_coverage
(
void
)
const
{
return
this
+
coverage
;
...
...
@@ -660,6 +698,24 @@ struct PairPosFormat1
struct
PairPosFormat2
{
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
{
TRACE_COLLECT_GLYPHS
(
this
);
/* (this+coverage).add_coverage (&c->input); // Don't need this. */
/* TODO only add values for pairs that have nonzero adjustments. */
unsigned
int
count1
=
class1Count
;
const
ClassDef
&
klass1
=
this
+
classDef1
;
for
(
unsigned
int
i
=
0
;
i
<
count1
;
i
++
)
klass1
.
add_class
(
&
c
->
input
,
i
);
unsigned
int
count2
=
class2Count
;
const
ClassDef
&
klass2
=
this
+
classDef2
;
for
(
unsigned
int
i
=
0
;
i
<
count2
;
i
++
)
klass2
.
add_class
(
&
c
->
input
,
i
);
}
inline
const
Coverage
&
get_coverage
(
void
)
const
{
return
this
+
coverage
;
...
...
@@ -800,6 +856,12 @@ struct EntryExitRecord
struct
CursivePosFormat1
{
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
{
TRACE_COLLECT_GLYPHS
(
this
);
(
this
+
coverage
).
add_coverage
(
&
c
->
input
);
}
inline
const
Coverage
&
get_coverage
(
void
)
const
{
return
this
+
coverage
;
...
...
@@ -940,6 +1002,14 @@ typedef AnchorMatrix BaseArray; /* base-major--
struct
MarkBasePosFormat1
{
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
{
TRACE_COLLECT_GLYPHS
(
this
);
(
this
+
markCoverage
).
add_coverage
(
&
c
->
input
);
(
this
+
baseCoverage
).
add_coverage
(
&
c
->
input
);
/* TODO only add combinations that have nonzero adjustment. */
}
inline
const
Coverage
&
get_coverage
(
void
)
const
{
return
this
+
markCoverage
;
...
...
@@ -1036,6 +1106,14 @@ typedef OffsetListOf<LigatureAttach> LigatureArray;
struct
MarkLigPosFormat1
{
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
{
TRACE_COLLECT_GLYPHS
(
this
);
(
this
+
markCoverage
).
add_coverage
(
&
c
->
input
);
(
this
+
ligatureCoverage
).
add_coverage
(
&
c
->
input
);
/* TODO only add combinations that have nonzero adjustment. */
}
inline
const
Coverage
&
get_coverage
(
void
)
const
{
return
this
+
markCoverage
;
...
...
@@ -1144,6 +1222,14 @@ typedef AnchorMatrix Mark2Array; /* mark2-major--
struct
MarkMarkPosFormat1
{
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
{
TRACE_COLLECT_GLYPHS
(
this
);
(
this
+
mark1Coverage
).
add_coverage
(
&
c
->
input
);
(
this
+
mark2Coverage
).
add_coverage
(
&
c
->
input
);
/* TODO only add combinations that have nonzero adjustment. */
}
inline
const
Coverage
&
get_coverage
(
void
)
const
{
return
this
+
mark1Coverage
;
...
...
@@ -1357,6 +1443,13 @@ struct PosLookup : Lookup
template
<
typename
context_t
>
static
inline
typename
context_t
::
return_t
process_recurse_func
(
context_t
*
c
,
unsigned
int
lookup_index
);
inline
hb_collect_glyphs_context_t
::
return_t
collect_glyphs_lookup
(
hb_collect_glyphs_context_t
*
c
)
const
{
TRACE_COLLECT_GLYPHS
(
this
);
c
->
set_recurse_func
(
process_recurse_func
<
hb_collect_glyphs_context_t
>
);
return
TRACE_RETURN
(
process
(
c
));
}
template
<
typename
set_t
>
inline
void
add_coverage
(
set_t
*
glyphs
)
const
{
...
...
src/hb-ot-layout.cc
浏览文件 @
cdd756b9
...
...
@@ -412,18 +412,19 @@ hb_ot_layout_lookup_collect_glyphs (hb_face_t *face,
{
if
(
unlikely
(
!
hb_ot_shaper_face_data_ensure
(
face
)))
return
;
//
OT::hb_collect_glyphs_context_t c (face, glyphs_before, glyphs_input, glyphs_after, glyphs_output);
OT
::
hb_collect_glyphs_context_t
c
(
face
,
glyphs_before
,
glyphs_input
,
glyphs_after
,
glyphs_output
);
switch
(
table_tag
)
{
case
HB_OT_TAG_GSUB
:
{
// hb_ot_layout_from_face (face)->gsub->collect_glyphs_lookup (&c, lookup_index);
const
OT
::
SubstLookup
&
l
=
hb_ot_layout_from_face
(
face
)
->
gsub
->
get_lookup
(
lookup_index
);
l
.
collect_glyphs_lookup
(
&
c
);
return
;
}
case
HB_OT_TAG_GPOS
:
{
// hb_ot_layout_from_face (face)->gpos->collect_glyphs_lookup (&c,
lookup_index);
//
l.collect_glyphs_lookup (&c);
const
OT
::
PosLookup
&
l
=
hb_ot_layout_from_face
(
face
)
->
gpos
->
get_lookup
(
lookup_index
);
l
.
collect_glyphs_lookup
(
&
c
);
return
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录