Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
b24ecbad
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,发现更多精彩内容 >>
提交
b24ecbad
编写于
5月 19, 2009
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[GPOS] PairPosFormat1
上级
056c7ec1
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
73 addition
and
18 deletion
+73
-18
src/hb-ot-layout-gpos-private.h
src/hb-ot-layout-gpos-private.h
+73
-18
未找到文件。
src/hb-ot-layout-gpos-private.h
浏览文件 @
b24ecbad
...
@@ -40,9 +40,6 @@ typedef Value ValueRecord[];
...
@@ -40,9 +40,6 @@ typedef Value ValueRecord[];
#if 0
#if 0
struct ValueRecord {
struct ValueRecord {
/* TODO */
private:
SHORT xPlacement; /* Horizontal adjustment for
SHORT xPlacement; /* Horizontal adjustment for
* placement--in design units */
* placement--in design units */
SHORT yPlacement; /* Vertical adjustment for
SHORT yPlacement; /* Vertical adjustment for
...
@@ -66,7 +63,6 @@ struct ValueRecord {
...
@@ -66,7 +63,6 @@ struct ValueRecord {
* advance--measured from beginning of
* advance--measured from beginning of
* PosTable (may be NULL) */
* PosTable (may be NULL) */
};
};
ASSERT_SIZE (ValueRecord, 16);
#endif
#endif
struct
ValueFormat
:
USHORT
{
struct
ValueFormat
:
USHORT
{
...
@@ -146,7 +142,8 @@ struct AnchorFormat1 {
...
@@ -146,7 +142,8 @@ struct AnchorFormat1 {
private:
private:
inline
void
get_anchor
(
hb_ot_layout_t
*
layout
,
hb_codepoint_t
glyph_id
,
inline
void
get_anchor
(
hb_ot_layout_t
*
layout
,
hb_codepoint_t
glyph_id
,
hb_position_t
*
x
,
hb_position_t
*
y
)
const
{
hb_position_t
*
x
,
hb_position_t
*
y
)
const
{
*
x
=
layout
->
gpos_info
.
x_scale
*
xCoordinate
/
0x10000
;
*
x
=
layout
->
gpos_info
.
x_scale
*
xCoordinate
/
0x10000
;
*
y
=
layout
->
gpos_info
.
y_scale
*
yCoordinate
/
0x10000
;
*
y
=
layout
->
gpos_info
.
y_scale
*
yCoordinate
/
0x10000
;
}
}
...
@@ -164,7 +161,8 @@ struct AnchorFormat2 {
...
@@ -164,7 +161,8 @@ struct AnchorFormat2 {
private:
private:
inline
void
get_anchor
(
hb_ot_layout_t
*
layout
,
hb_codepoint_t
glyph_id
,
inline
void
get_anchor
(
hb_ot_layout_t
*
layout
,
hb_codepoint_t
glyph_id
,
hb_position_t
*
x
,
hb_position_t
*
y
)
const
{
hb_position_t
*
x
,
hb_position_t
*
y
)
const
{
/* TODO Contour */
/* TODO Contour */
*
x
=
layout
->
gpos_info
.
x_scale
*
xCoordinate
/
0x10000
;
*
x
=
layout
->
gpos_info
.
x_scale
*
xCoordinate
/
0x10000
;
*
y
=
layout
->
gpos_info
.
y_scale
*
yCoordinate
/
0x10000
;
*
y
=
layout
->
gpos_info
.
y_scale
*
yCoordinate
/
0x10000
;
...
@@ -184,7 +182,8 @@ struct AnchorFormat3 {
...
@@ -184,7 +182,8 @@ struct AnchorFormat3 {
private:
private:
inline
void
get_anchor
(
hb_ot_layout_t
*
layout
,
hb_codepoint_t
glyph_id
,
inline
void
get_anchor
(
hb_ot_layout_t
*
layout
,
hb_codepoint_t
glyph_id
,
hb_position_t
*
x
,
hb_position_t
*
y
)
const
{
hb_position_t
*
x
,
hb_position_t
*
y
)
const
{
/* TODO Device */
/* TODO Device */
*
x
+=
layout
->
gpos_info
.
x_scale
*
xCoordinate
/
0x10000
;
*
x
+=
layout
->
gpos_info
.
x_scale
*
xCoordinate
/
0x10000
;
*
y
+=
layout
->
gpos_info
.
y_scale
*
yCoordinate
/
0x10000
;
*
y
+=
layout
->
gpos_info
.
y_scale
*
yCoordinate
/
0x10000
;
...
@@ -208,7 +207,8 @@ ASSERT_SIZE (AnchorFormat3, 10);
...
@@ -208,7 +207,8 @@ ASSERT_SIZE (AnchorFormat3, 10);
struct
Anchor
{
struct
Anchor
{
inline
void
get_anchor
(
hb_ot_layout_t
*
layout
,
hb_codepoint_t
glyph_id
,
inline
void
get_anchor
(
hb_ot_layout_t
*
layout
,
hb_codepoint_t
glyph_id
,
hb_position_t
*
x
,
hb_position_t
*
y
)
const
{
hb_position_t
*
x
,
hb_position_t
*
y
)
const
{
*
x
=
*
y
=
0
;
*
x
=
*
y
=
0
;
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
u
.
format1
->
get_anchor
(
layout
,
glyph_id
,
x
,
y
);
return
;
case
1
:
u
.
format1
->
get_anchor
(
layout
,
glyph_id
,
x
,
y
);
return
;
...
@@ -257,8 +257,8 @@ struct SinglePosFormat1 {
...
@@ -257,8 +257,8 @@ struct SinglePosFormat1 {
friend
struct
SinglePos
;
friend
struct
SinglePos
;
private:
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
unsigned
int
index
=
(
this
+
coverage
)
(
IN_CURGLYPH
());
unsigned
int
index
=
(
this
+
coverage
)
(
IN_CURGLYPH
());
if
(
HB_LIKELY
(
index
==
NOT_COVERED
))
if
(
HB_LIKELY
(
index
==
NOT_COVERED
))
return
false
;
return
false
;
...
@@ -285,8 +285,8 @@ struct SinglePosFormat2 {
...
@@ -285,8 +285,8 @@ struct SinglePosFormat2 {
friend
struct
SinglePos
;
friend
struct
SinglePos
;
private:
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
unsigned
int
index
=
(
this
+
coverage
)
(
IN_CURGLYPH
());
unsigned
int
index
=
(
this
+
coverage
)
(
IN_CURGLYPH
());
if
(
HB_LIKELY
(
index
==
NOT_COVERED
))
if
(
HB_LIKELY
(
index
==
NOT_COVERED
))
return
false
;
return
false
;
...
@@ -319,7 +319,8 @@ struct SinglePos {
...
@@ -319,7 +319,8 @@ struct SinglePos {
private:
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
apply
(
APPLY_ARG
);
case
1
:
return
u
.
format1
->
apply
(
APPLY_ARG
);
case
2
:
return
u
.
format2
->
apply
(
APPLY_ARG
);
case
2
:
return
u
.
format2
->
apply
(
APPLY_ARG
);
...
@@ -338,7 +339,8 @@ ASSERT_SIZE (SinglePos, 2);
...
@@ -338,7 +339,8 @@ ASSERT_SIZE (SinglePos, 2);
struct
PairValueRecord
{
struct
PairValueRecord
{
/* TODO */
friend
struct
PairPosFormat1
;
private:
private:
GlyphID
secondGlyph
;
/* GlyphID of second glyph in the
GlyphID
secondGlyph
;
/* GlyphID of second glyph in the
...
@@ -349,8 +351,26 @@ struct PairValueRecord {
...
@@ -349,8 +351,26 @@ struct PairValueRecord {
};
};
ASSERT_SIZE
(
PairValueRecord
,
2
);
ASSERT_SIZE
(
PairValueRecord
,
2
);
/* XXXXXXXXXXXXXXXXXXXX */
struct
PairSet
{
typedef
ArrayOf
<
PairValueRecord
>
PairSet
;
friend
struct
PairPosFormat1
;
private:
inline
bool
apply
(
APPLY_ARG_DEF
,
ValueFormat
&
f1
,
ValueFormat
&
f2
,
unsigned
int
next_pos
)
const
{
return
true
;
}
private:
USHORT
len
;
/* Number of PairValueRecords */
/* XXX */
PairValueRecord
array
[];
/* Array of PairValueRecords--ordered
* by GlyphID of the second glyph */
};
ASSERT_SIZE
(
PairSet
,
2
);
ASSERT_SIZE
(
PairSet
,
2
);
struct
PairPosFormat1
{
struct
PairPosFormat1
{
...
@@ -358,8 +378,43 @@ struct PairPosFormat1 {
...
@@ -358,8 +378,43 @@ struct PairPosFormat1 {
friend
struct
PairPos
;
friend
struct
PairPos
;
private:
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG_DEF
)
const
/* TODO */
{
unsigned
int
end
=
MIN
(
buffer
->
in_length
,
buffer
->
in_pos
+
context_length
);
if
(
HB_UNLIKELY
(
buffer
->
in_pos
+
2
>
end
))
return
false
;
unsigned
int
index
=
(
this
+
coverage
)
(
IN_CURGLYPH
());
if
(
HB_LIKELY
(
index
==
NOT_COVERED
))
return
false
;
unsigned
int
j
=
buffer
->
in_pos
+
1
;
while
(
!
_hb_ot_layout_check_glyph_property
(
layout
,
IN_ITEM
(
j
),
lookup_flag
,
&
property
))
{
if
(
HB_UNLIKELY
(
j
==
end
))
return
false
;
j
++
;
}
const
PairSet
&
pair_set
=
this
+
pairSet
[
index
];
unsigned
int
len1
=
valueFormat1
.
get_len
(),
len2
=
valueFormat2
.
get_len
();
unsigned
int
record_len
=
1
+
len1
+
len2
;
unsigned
int
count
=
pair_set
.
len
;
const
PairValueRecord
*
record
=
pair_set
.
array
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
if
(
IN_GLYPH
(
j
)
==
record
->
secondGlyph
)
{
valueFormat1
.
apply_value
(
layout
,
(
const
char
*
)
this
,
record
->
values
,
CURPOSITION
());
valueFormat2
.
apply_value
(
layout
,
(
const
char
*
)
this
,
record
->
values
+
len1
,
POSITION
(
j
));
if
(
len2
)
j
++
;
buffer
->
in_pos
=
j
;
return
true
;
}
record
+=
record_len
;
}
return
false
;
return
false
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录