Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
79420ad9
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,发现更多精彩内容 >>
提交
79420ad9
编写于
5月 26, 2009
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[HB] Add get_attach_points()
上级
855720ca
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
62 addition
and
66 deletion
+62
-66
src/Makefile.am
src/Makefile.am
+1
-1
src/hb-ot-layout-gdef-private.h
src/hb-ot-layout-gdef-private.h
+25
-10
src/hb-ot-layout-gpos-private.h
src/hb-ot-layout-gpos-private.h
+7
-21
src/hb-ot-layout-gsub-private.h
src/hb-ot-layout-gsub-private.h
+7
-21
src/hb-ot-layout-open-private.h
src/hb-ot-layout-open-private.h
+3
-9
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+9
-0
src/hb-ot-layout.h
src/hb-ot-layout.h
+6
-0
src/main.cc
src/main.cc
+4
-4
未找到文件。
src/Makefile.am
浏览文件 @
79420ad9
...
...
@@ -6,7 +6,7 @@ INCLUDES = \
-I
$(srcdir)
\
$(FREETYPE_CFLAGS)
\
$(GLIB_CFLAGS)
CXX
=
gcc
$(GCCOPTS)
-g
-fno-rtti
-fno-exceptions
-Wabi
-Wpadded
-Wcast-align
CXX
=
gcc
-g
-O2
-fno-rtti
-fno-exceptions
-Wabi
-Wpadded
-Wcast-align
noinst_LTLIBRARIES
=
libharfbuzz-1.la
...
...
src/hb-ot-layout-gdef-private.h
浏览文件 @
79420ad9
...
...
@@ -50,10 +50,18 @@ ASSERT_SIZE (AttachPoint, 2);
struct
AttachList
{
/* XXX We need enumeration API here */
inline
const
AttachPoint
&
get_attach_points
(
hb_codepoint_t
glyph
)
inline
void
get_attach_points
(
hb_codepoint_t
glyph_id
,
unsigned
int
*
point_count
/* IN/OUT */
,
unsigned
int
*
point_array
/* OUT */
)
const
{
return
this
+
attachPoint
[(
this
+
coverage
)
(
glyph
)];
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
const
AttachPoint
&
points
=
this
+
attachPoint
[
index
];
unsigned
int
count
=
MIN
(
points
.
len
,
*
point_count
);
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
point_array
[
i
]
=
points
[
i
];
*
point_count
=
points
.
len
;
}
private:
...
...
@@ -164,9 +172,10 @@ struct LigCaretList
friend
struct
GDEF
;
private:
inline
const
LigGlyph
&
get_lig_glyph
(
hb_codepoint_t
glyph
)
inline
const
LigGlyph
&
get_lig_glyph
(
hb_codepoint_t
glyph
_id
)
{
return
this
+
ligGlyph
[(
this
+
coverage
)
(
glyph
)];
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
return
this
+
ligGlyph
[
index
];
}
private:
...
...
@@ -198,14 +207,20 @@ 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
{
return
(
this
+
glyphClassDef
).
get_class
(
glyph
);
}
inline
hb_ot_layout_class_t
get_glyph_class
(
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
{
return
(
this
+
markAttachClassDef
).
get_class
(
glyph
);
}
inline
hb_ot_layout_class_t
get_mark_attachment_type
(
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
,
unsigned
int
*
point_count
/* IN/OUT */
,
unsigned
int
*
point_array
/* OUT */
)
const
{
(
this
+
attachList
).
get_attach_points
(
glyph_id
,
point_count
,
point_array
);
}
/* TODO get_attach and get_lig_caret */
inline
bool
has_attach_list
()
const
{
return
attachList
!=
0
;
}
inline
bool
has_lig_caret_list
()
const
{
return
ligCaretList
!=
0
;
}
inline
bool
has_lig_carets
()
const
{
return
ligCaretList
!=
0
;
}
private:
FixedVersion
version
;
/* Version of the GDEF table--initially
...
...
src/hb-ot-layout-gpos-private.h
浏览文件 @
79420ad9
...
...
@@ -52,9 +52,7 @@ struct ValueFormat : USHORT
};
inline
unsigned
int
get_len
()
const
{
return
_hb_popcount32
((
unsigned
int
)
*
this
);
}
{
return
_hb_popcount32
((
unsigned
int
)
*
this
);
}
const
void
apply_value
(
hb_ot_layout_t
*
layout
,
const
char
*
base
,
...
...
@@ -1138,9 +1136,7 @@ struct ContextPos : Context
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
return
Context
::
apply
(
APPLY_ARG
,
position_lookup
);
}
{
return
Context
::
apply
(
APPLY_ARG
,
position_lookup
);
}
};
ASSERT_SIZE
(
ContextPos
,
2
);
...
...
@@ -1150,9 +1146,7 @@ struct ChainContextPos : ChainContext
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
return
ChainContext
::
apply
(
APPLY_ARG
,
position_lookup
);
}
{
return
ChainContext
::
apply
(
APPLY_ARG
,
position_lookup
);
}
};
ASSERT_SIZE
(
ChainContextPos
,
2
);
...
...
@@ -1225,9 +1219,7 @@ ASSERT_SIZE (PosLookupSubTable, 2);
struct
PosLookup
:
Lookup
{
inline
const
PosLookupSubTable
&
get_subtable
(
unsigned
int
i
)
const
{
return
(
const
PosLookupSubTable
&
)
Lookup
::
get_subtable
(
i
);
}
{
return
(
const
PosLookupSubTable
&
)
Lookup
::
get_subtable
(
i
);
}
/* Like get_type(), but looks through extension lookups.
* Never returns Extension */
...
...
@@ -1315,22 +1307,16 @@ struct GPOS : GSUBGPOS
static
const
hb_tag_t
Tag
=
HB_TAG
(
'G'
,
'P'
,
'O'
,
'S'
);
static
inline
const
GPOS
&
get_for_data
(
const
char
*
data
)
{
return
(
const
GPOS
&
)
GSUBGPOS
::
get_for_data
(
data
);
}
{
return
(
const
GPOS
&
)
GSUBGPOS
::
get_for_data
(
data
);
}
inline
const
PosLookup
&
get_lookup
(
unsigned
int
i
)
const
{
return
(
const
PosLookup
&
)
GSUBGPOS
::
get_lookup
(
i
);
}
{
return
(
const
PosLookup
&
)
GSUBGPOS
::
get_lookup
(
i
);
}
inline
bool
position_lookup
(
hb_ot_layout_t
*
layout
,
hb_buffer_t
*
buffer
,
unsigned
int
lookup_index
,
hb_ot_layout_feature_mask_t
mask
)
const
{
return
get_lookup
(
lookup_index
).
apply_string
(
layout
,
buffer
,
mask
);
}
{
return
get_lookup
(
lookup_index
).
apply_string
(
layout
,
buffer
,
mask
);
}
};
ASSERT_SIZE
(
GPOS
,
10
);
...
...
src/hb-ot-layout-gsub-private.h
浏览文件 @
79420ad9
...
...
@@ -455,9 +455,7 @@ struct ContextSubst : Context
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
return
Context
::
apply
(
APPLY_ARG
,
substitute_lookup
);
}
{
return
Context
::
apply
(
APPLY_ARG
,
substitute_lookup
);
}
};
ASSERT_SIZE
(
ContextSubst
,
2
);
...
...
@@ -467,9 +465,7 @@ struct ChainContextSubst : ChainContext
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
return
ChainContext
::
apply
(
APPLY_ARG
,
substitute_lookup
);
}
{
return
ChainContext
::
apply
(
APPLY_ARG
,
substitute_lookup
);
}
};
ASSERT_SIZE
(
ChainContextSubst
,
2
);
...
...
@@ -614,9 +610,7 @@ ASSERT_SIZE (SubstLookupSubTable, 2);
struct
SubstLookup
:
Lookup
{
inline
const
SubstLookupSubTable
&
get_subtable
(
unsigned
int
i
)
const
{
return
(
const
SubstLookupSubTable
&
)
Lookup
::
get_subtable
(
i
);
}
{
return
(
const
SubstLookupSubTable
&
)
Lookup
::
get_subtable
(
i
);
}
/* Like get_type(), but looks through extension lookups.
* Never returns Extension */
...
...
@@ -639,9 +633,7 @@ struct SubstLookup : Lookup
}
inline
bool
is_reverse
(
void
)
const
{
return
HB_UNLIKELY
(
get_effective_type
()
==
SubstLookupSubTable
::
ReverseChainSingle
);
}
{
return
HB_UNLIKELY
(
get_effective_type
()
==
SubstLookupSubTable
::
ReverseChainSingle
);
}
inline
bool
apply_once
(
hb_ot_layout_t
*
layout
,
hb_buffer_t
*
buffer
,
...
...
@@ -721,22 +713,16 @@ struct GSUB : GSUBGPOS
static
const
hb_tag_t
Tag
=
HB_TAG
(
'G'
,
'S'
,
'U'
,
'B'
);
static
inline
const
GSUB
&
get_for_data
(
const
char
*
data
)
{
return
(
const
GSUB
&
)
GSUBGPOS
::
get_for_data
(
data
);
}
{
return
(
const
GSUB
&
)
GSUBGPOS
::
get_for_data
(
data
);
}
inline
const
SubstLookup
&
get_lookup
(
unsigned
int
i
)
const
{
return
(
const
SubstLookup
&
)
GSUBGPOS
::
get_lookup
(
i
);
}
{
return
(
const
SubstLookup
&
)
GSUBGPOS
::
get_lookup
(
i
);
}
inline
bool
substitute_lookup
(
hb_ot_layout_t
*
layout
,
hb_buffer_t
*
buffer
,
unsigned
int
lookup_index
,
hb_ot_layout_feature_mask_t
mask
)
const
{
return
get_lookup
(
lookup_index
).
apply_string
(
layout
,
buffer
,
mask
);
}
{
return
get_lookup
(
lookup_index
).
apply_string
(
layout
,
buffer
,
mask
);
}
};
ASSERT_SIZE
(
GSUB
,
10
);
...
...
src/hb-ot-layout-open-private.h
浏览文件 @
79420ad9
...
...
@@ -322,9 +322,7 @@ struct ArrayOf
return
array
[
i
];
}
inline
unsigned
int
get_size
()
const
{
return
sizeof
(
len
)
+
len
*
sizeof
(
array
[
0
]);
}
{
return
sizeof
(
len
)
+
len
*
sizeof
(
array
[
0
]);
}
USHORT
len
;
Type
array
[];
...
...
@@ -341,9 +339,7 @@ struct HeadlessArrayOf
return
array
[
i
-
1
];
}
inline
unsigned
int
get_size
()
const
{
return
sizeof
(
len
)
+
(
len
?
len
-
1
:
0
)
*
sizeof
(
array
[
0
]);
}
{
return
sizeof
(
len
)
+
(
len
?
len
-
1
:
0
)
*
sizeof
(
array
[
0
]);
}
USHORT
len
;
Type
array
[];
...
...
@@ -359,9 +355,7 @@ struct LongArrayOf
return
array
[
i
];
}
inline
unsigned
int
get_size
()
const
{
return
sizeof
(
len
)
+
len
*
sizeof
(
array
[
0
]);
}
{
return
sizeof
(
len
)
+
len
*
sizeof
(
array
[
0
]);
}
ULONG
len
;
Type
array
[];
...
...
src/hb-ot-layout.cc
浏览文件 @
79420ad9
...
...
@@ -302,6 +302,15 @@ 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_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
);
}
/*
* GSUB/GPOS
*/
...
...
src/hb-ot-layout.h
浏览文件 @
79420ad9
...
...
@@ -99,6 +99,12 @@ hb_ot_layout_build_glyph_classes (hb_ot_layout_t *layout,
unsigned
char
*
klasses
,
uint16_t
count
);
void
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 */
);
/*
* GSUB/GPOS
*/
...
...
src/main.cc
浏览文件 @
79420ad9
...
...
@@ -155,10 +155,10 @@ main (int argc, char **argv)
gdef
.
has_glyph_classes
()
?
""
:
"no "
);
printf
(
" Has %smark attachment types
\n
"
,
gdef
.
has_mark_attachment_types
()
?
""
:
"no "
);
printf
(
" Has %sattach
list
\n
"
,
gdef
.
has_attach_
list
()
?
""
:
"no "
);
printf
(
" Has %slig caret
list
\n
"
,
gdef
.
has_lig_caret
_list
()
?
""
:
"no "
);
printf
(
" Has %sattach
points
\n
"
,
gdef
.
has_attach_
points
()
?
""
:
"no "
);
printf
(
" Has %slig caret
s
\n
"
,
gdef
.
has_lig_caret
s
()
?
""
:
"no "
);
for
(
int
glyph
=
0
;
glyph
<
1
;
glyph
++
)
printf
(
" glyph %d has class %d and mark attachment type %d
\n
"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录