Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
62964afc
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
62964afc
编写于
5月 26, 2009
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[HB] Implement get_lig_carets()
上级
79420ad9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
66 addition
and
25 deletion
+66
-25
src/hb-ot-layout-gdef-private.h
src/hb-ot-layout-gdef-private.h
+45
-12
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+13
-4
src/hb-ot-layout.h
src/hb-ot-layout.h
+7
-1
src/main.cc
src/main.cc
+1
-8
未找到文件。
src/hb-ot-layout-gdef-private.h
浏览文件 @
62964afc
...
...
@@ -50,11 +50,16 @@ ASSERT_SIZE (AttachPoint, 2);
struct
AttachList
{
inline
void
get_attach_points
(
hb_codepoint_t
glyph_id
,
inline
bool
get_attach_points
(
hb_codepoint_t
glyph_id
,
unsigned
int
*
point_count
/* IN/OUT */
,
unsigned
int
*
point_array
/* OUT */
)
const
{
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
if
(
index
==
NOT_COVERED
)
{
*
point_count
=
0
;
return
false
;
}
const
AttachPoint
&
points
=
this
+
attachPoint
[
index
];
unsigned
int
count
=
MIN
(
points
.
len
,
*
point_count
);
...
...
@@ -62,6 +67,8 @@ struct AttachList
point_array
[
i
]
=
points
[
i
];
*
point_count
=
points
.
len
;
return
true
;
}
private:
...
...
@@ -157,11 +164,22 @@ ASSERT_SIZE (CaretValue, 2);
struct
LigGlyph
{
friend
struct
LigCaretList
;
inline
void
get_lig_carets
(
hb_ot_layout_t
*
layout
,
hb_codepoint_t
glyph_id
,
unsigned
int
*
caret_count
/* IN/OUT */
,
int
*
caret_array
/* OUT */
)
const
{
unsigned
int
count
=
MIN
(
carets
.
len
,
*
caret_count
);
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
caret_array
[
i
]
=
(
this
+
carets
[
i
]).
get_caret_value
(
layout
,
glyph_id
);
*
caret_count
=
carets
.
len
;
}
private:
OffsetArrayOf
<
CaretValue
>
caret
;
/* Offset rrray of CaretValue tables
caret
s
;
/* Offset rrray of CaretValue tables
* --from beginning of LigGlyph table
* --in increasing coordinate order */
};
...
...
@@ -169,13 +187,20 @@ ASSERT_SIZE (LigGlyph, 2);
struct
LigCaretList
{
friend
struct
GDEF
;
private:
inline
const
LigGlyph
&
get_lig_glyph
(
hb_codepoint_t
glyph_id
)
inline
bool
get_lig_carets
(
hb_ot_layout_t
*
layout
,
hb_codepoint_t
glyph_id
,
unsigned
int
*
caret_count
/* IN/OUT */
,
int
*
caret_array
/* OUT */
)
const
{
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
return
this
+
ligGlyph
[
index
];
if
(
index
==
NOT_COVERED
)
{
*
caret_count
=
0
;
return
false
;
}
const
LigGlyph
&
lig_glyph
=
this
+
ligGlyph
[
index
];
lig_glyph
.
get_lig_carets
(
layout
,
glyph_id
,
caret_count
,
caret_array
);
return
true
;
}
private:
...
...
@@ -207,20 +232,28 @@ struct GDEF
STATIC_DEFINE_GET_FOR_DATA_CHECK_MAJOR_VERSION
(
GDEF
,
1
);
inline
bool
has_glyph_classes
()
const
{
return
glyphClassDef
!=
0
;
}
inline
hb_ot_layout_class_t
get_glyph_class
(
hb_codepoint_t
glyph
)
const
inline
hb_ot_layout_class_t
get_glyph_class
(
hb_ot_layout_t
*
layout
,
hb_codepoint_t
glyph
)
const
{
return
(
this
+
glyphClassDef
).
get_class
(
glyph
);
}
inline
bool
has_mark_attachment_types
()
const
{
return
markAttachClassDef
!=
0
;
}
inline
hb_ot_layout_class_t
get_mark_attachment_type
(
hb_codepoint_t
glyph
)
const
inline
hb_ot_layout_class_t
get_mark_attachment_type
(
hb_ot_layout_t
*
layout
,
hb_codepoint_t
glyph
)
const
{
return
(
this
+
markAttachClassDef
).
get_class
(
glyph
);
}
inline
bool
has_attach_points
()
const
{
return
attachList
!=
0
;
}
inline
void
get_attach_points
(
hb_codepoint_t
glyph_id
,
inline
bool
get_attach_points
(
hb_ot_layout_t
*
layout
,
hb_codepoint_t
glyph_id
,
unsigned
int
*
point_count
/* IN/OUT */
,
unsigned
int
*
point_array
/* OUT */
)
const
{
(
this
+
attachList
).
get_attach_points
(
glyph_id
,
point_count
,
point_array
);
}
{
return
(
this
+
attachList
).
get_attach_points
(
glyph_id
,
point_count
,
point_array
);
}
inline
bool
has_lig_carets
()
const
{
return
ligCaretList
!=
0
;
}
inline
bool
get_lig_carets
(
hb_ot_layout_t
*
layout
,
hb_codepoint_t
glyph_id
,
unsigned
int
*
caret_count
/* IN/OUT */
,
int
*
caret_array
/* OUT */
)
const
{
return
(
this
+
ligCaretList
).
get_lig_carets
(
layout
,
glyph_id
,
caret_count
,
caret_array
);
}
private:
FixedVersion
version
;
/* Version of the GDEF table--initially
...
...
src/hb-ot-layout.cc
浏览文件 @
62964afc
...
...
@@ -140,11 +140,11 @@ _hb_ot_layout_get_glyph_property (hb_ot_layout_t *layout,
/* TODO old harfbuzz doesn't always parse mark attachments as it says it was
* introduced without a version bump, so it may not be safe */
klass
=
layout
->
gdef
->
get_mark_attachment_type
(
glyph
);
klass
=
layout
->
gdef
->
get_mark_attachment_type
(
layout
,
glyph
);
if
(
klass
)
return
klass
<<
8
;
klass
=
layout
->
gdef
->
get_glyph_class
(
glyph
);
klass
=
layout
->
gdef
->
get_glyph_class
(
layout
,
glyph
);
if
(
!
klass
&&
glyph
<
layout
->
new_gdef
.
len
)
klass
=
layout
->
new_gdef
.
klasses
[
glyph
];
...
...
@@ -302,13 +302,22 @@ hb_ot_layout_build_glyph_classes (hb_ot_layout_t *layout,
hb_ot_layout_set_glyph_class
(
layout
,
glyphs
[
i
],
(
hb_ot_layout_glyph_class_t
)
klasses
[
i
]);
}
void
hb_bool_t
hb_ot_layout_get_attach_points
(
hb_ot_layout_t
*
layout
,
hb_codepoint_t
glyph
,
unsigned
int
*
point_count
/* IN/OUT */
,
unsigned
int
*
point_array
/* OUT */
)
{
layout
->
gdef
->
get_attach_points
(
glyph
,
point_count
,
point_array
);
return
layout
->
gdef
->
get_attach_points
(
layout
,
glyph
,
point_count
,
point_array
);
}
hb_bool_t
hb_ot_layout_get_lig_carets
(
hb_ot_layout_t
*
layout
,
hb_codepoint_t
glyph
,
unsigned
int
*
caret_count
/* IN/OUT */
,
int
*
caret_array
/* OUT */
)
{
return
layout
->
gdef
->
get_lig_carets
(
layout
,
glyph
,
caret_count
,
caret_array
);
}
/*
...
...
src/hb-ot-layout.h
浏览文件 @
62964afc
...
...
@@ -99,12 +99,18 @@ hb_ot_layout_build_glyph_classes (hb_ot_layout_t *layout,
unsigned
char
*
klasses
,
uint16_t
count
);
void
hb_bool_t
hb_ot_layout_get_attach_points
(
hb_ot_layout_t
*
layout
,
hb_codepoint_t
glyph
,
unsigned
int
*
point_count
/* IN/OUT */
,
unsigned
int
*
point_array
/* OUT */
);
hb_bool_t
hb_ot_layout_get_lig_carets
(
hb_ot_layout_t
*
layout
,
hb_codepoint_t
glyph
,
unsigned
int
*
caret_count
/* IN/OUT */
,
int
*
caret_array
/* OUT */
);
/*
* GSUB/GPOS
*/
...
...
src/main.cc
浏览文件 @
62964afc
...
...
@@ -159,15 +159,8 @@ main (int argc, char **argv)
gdef
.
has_attach_points
()
?
""
:
"no "
);
printf
(
" Has %slig carets
\n
"
,
gdef
.
has_lig_carets
()
?
""
:
"no "
);
for
(
int
glyph
=
0
;
glyph
<
1
;
glyph
++
)
printf
(
" glyph %d has class %d and mark attachment type %d
\n
"
,
glyph
,
gdef
.
get_glyph_class
(
glyph
),
gdef
.
get_mark_attachment_type
(
glyph
));
}
break
;
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录