Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
fe550f4d
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,发现更多精彩内容 >>
提交
fe550f4d
编写于
5月 21, 2009
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[GPOS] MarkMarkPosFormat1
Still not quite working.
上级
357ccde3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
79 addition
and
30 deletion
+79
-30
src/TODO
src/TODO
+3
-1
src/hb-ot-layout-gpos-private.h
src/hb-ot-layout-gpos-private.h
+76
-29
未找到文件。
src/TODO
浏览文件 @
fe550f4d
...
@@ -3,4 +3,6 @@
...
@@ -3,4 +3,6 @@
- Implement is_simple()
- Implement is_simple()
- Static assert PangoOTGlyph vs hb */
- Static assert PangoOTGlyph vs hb */
- Face index > 0 and dfont fonts
- Face index > 0 and dfont fonts
- assert static HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH
- HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH vs LookupType::... mess
- Rename LookupFlag::MarkAttachmentType to LookupFlag:IgnoreSpecialMarks
- Skip forward/backward should only skip marks, not whatever lookupflags say!
src/hb-ot-layout-gpos-private.h
浏览文件 @
fe550f4d
...
@@ -782,26 +782,26 @@ struct MarkBasePosFormat1
...
@@ -782,26 +782,26 @@ struct MarkBasePosFormat1
return
false
;
return
false
;
/* now we search backwards for a non-mark glyph */
/* now we search backwards for a non-mark glyph */
unsigned
int
count
=
buffer
->
in_pos
;
unsigned
int
count
=
buffer
->
in_pos
;
unsigned
int
i
=
1
,
j
=
count
-
1
;
unsigned
int
i
=
1
,
j
=
count
-
1
;
while
(
i
<=
count
)
while
(
i
<=
count
)
{
{
property
=
_hb_ot_layout_get_glyph_property
(
layout
,
IN_GLYPH
(
j
));
property
=
_hb_ot_layout_get_glyph_property
(
layout
,
IN_GLYPH
(
j
));
if
(
!
(
property
==
LookupFlag
::
IgnoreMarks
||
property
&
LookupFlag
::
MarkAttachmentType
))
if
(
!
(
property
==
HB_OT_LAYOUT_GLYPH_CLASS_MARK
||
property
&
LookupFlag
::
MarkAttachmentType
))
break
;
break
;
i
++
,
j
--
;
i
++
,
j
--
;
}
}
if
(
HB_UNLIKELY
(
i
>
buffer
->
in_pos
))
if
(
HB_UNLIKELY
(
i
>
buffer
->
in_pos
))
return
false
;
return
false
;
/* The following assertion is too strong -- at least for mangal.ttf. */
/* The following assertion is too strong -- at least for mangal.ttf. */
#if 0
if (property != HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH)
if (property != HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH)
return false;
return false;
#endif
unsigned
int
base_index
=
(
this
+
baseCoverage
)
(
IN_GLYPH
(
j
));
unsigned
int
base_index
=
(
this
+
baseCoverage
)
(
IN_GLYPH
(
j
));
if
(
HB_LIKELY
(
base_index
==
NOT_COVERED
)
)
if
(
base_index
==
NOT_COVERED
)
return
false
;
return
false
;
const
MarkArray
&
mark_array
=
this
+
markArray
;
const
MarkArray
&
mark_array
=
this
+
markArray
;
...
@@ -819,7 +819,6 @@ struct MarkBasePosFormat1
...
@@ -819,7 +819,6 @@ struct MarkBasePosFormat1
unsigned
int
index
=
base_index
*
classCount
+
mark_class
;
unsigned
int
index
=
base_index
*
classCount
+
mark_class
;
(
&
base_array
+
base_array
.
matrix
[
index
]).
get_anchor
(
layout
,
IN_GLYPH
(
j
),
&
base_x
,
&
base_y
);
(
&
base_array
+
base_array
.
matrix
[
index
]).
get_anchor
(
layout
,
IN_GLYPH
(
j
),
&
base_x
,
&
base_y
);
/* anchor points are not cumulative */
HB_Position
o
=
POSITION
(
buffer
->
in_pos
);
HB_Position
o
=
POSITION
(
buffer
->
in_pos
);
o
->
x_pos
=
base_x
-
mark_x
;
o
->
x_pos
=
base_x
-
mark_x
;
o
->
y_pos
=
base_y
-
mark_y
;
o
->
y_pos
=
base_y
-
mark_y
;
...
@@ -962,25 +961,18 @@ struct MarkLigPos
...
@@ -962,25 +961,18 @@ struct MarkLigPos
ASSERT_SIZE
(
MarkLigPos
,
2
);
ASSERT_SIZE
(
MarkLigPos
,
2
);
struct
Mark2Record
{
/* TODO */
private:
OffsetTo
<
Anchor
>
mark2Anchor
[];
/* Array of offsets (one per class)
* to Anchor tables--from beginning of
* Mark2Array table--zero--based array */
};
struct
Mark2Array
struct
Mark2Array
{
{
/* TODO */
friend
struct
MarkMarkPosFormat1
;
private:
private:
USHORT
mark2Count
;
/* Number of Mark2 records */
USHORT
len
;
/* Number of rows */
Mark2Record
mark2Record
[];
/* Array of Mark2Records--in Coverage
OffsetTo
<
Anchor
>
* order */
matrix
[];
/* Matrix of offsets to Anchor tables--
* from beginning of Mark2Array table--
* mark2-major--in order of
* Mark2Coverage Index--, mark1-minor--
* ordered by class--zero-based. */
};
};
ASSERT_SIZE
(
Mark2Array
,
2
);
ASSERT_SIZE
(
Mark2Array
,
2
);
...
@@ -991,24 +983,79 @@ struct MarkMarkPosFormat1
...
@@ -991,24 +983,79 @@ struct MarkMarkPosFormat1
private:
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
{
/* TODO */
if
(
lookup_flag
&
LookupFlag
::
IgnoreMarks
)
return
false
;
return
false
;
unsigned
int
mark1_index
=
(
this
+
mark1Coverage
)
(
IN_CURGLYPH
());
if
(
HB_LIKELY
(
mark1_index
==
NOT_COVERED
))
return
false
;
/* now we search backwards for a suitable mark glyph until a non-mark glyph */
unsigned
int
count
=
buffer
->
in_pos
;
unsigned
int
i
=
1
,
j
=
count
-
1
;
while
(
i
<=
count
)
{
property
=
_hb_ot_layout_get_glyph_property
(
layout
,
IN_GLYPH
(
j
));
if
(
!
(
property
==
HB_OT_LAYOUT_GLYPH_CLASS_MARK
||
property
&
LookupFlag
::
MarkAttachmentType
))
return
false
;
if
(
!
(
lookup_flag
&
LookupFlag
::
MarkAttachmentType
)
||
(
lookup_flag
&
LookupFlag
::
MarkAttachmentType
)
==
property
)
break
;
i
++
,
j
--
;
}
if
(
HB_UNLIKELY
(
i
>
buffer
->
in_pos
))
return
false
;
unsigned
int
mark2_index
=
(
this
+
mark2Coverage
)
(
IN_GLYPH
(
j
));
if
(
mark2_index
==
NOT_COVERED
)
return
false
;
const
MarkArray
&
mark1_array
=
this
+
mark1Array
;
const
Mark2Array
&
mark2_array
=
this
+
mark2Array
;
unsigned
int
mark1_class
=
mark1_array
.
get_class
(
mark1_index
);
const
Anchor
&
mark1_anchor
=
mark1_array
.
get_anchor
(
mark1_index
);
if
(
HB_UNLIKELY
(
mark1_class
>=
classCount
||
mark2_index
>=
mark2_array
.
len
))
return
false
;
printf
(
"here4
\n
"
);
hb_position_t
mark1_x
,
mark1_y
,
mark2_x
,
mark2_y
;
mark1_anchor
.
get_anchor
(
layout
,
IN_CURGLYPH
(),
&
mark1_x
,
&
mark1_y
);
unsigned
int
index
=
mark2_index
*
classCount
+
mark1_class
;
(
&
mark2_array
+
mark2_array
.
matrix
[
index
]).
get_anchor
(
layout
,
IN_GLYPH
(
j
),
&
mark2_x
,
&
mark2_y
);
HB_Position
o
=
POSITION
(
buffer
->
in_pos
);
o
->
x_pos
=
mark2_x
-
mark1_x
;
o
->
y_pos
=
mark2_y
-
mark1_y
;
o
->
x_advance
=
0
;
o
->
y_advance
=
0
;
o
->
back
=
i
;
buffer
->
in_pos
++
;
return
true
;
}
}
private:
private:
USHORT
format
;
/* Format identifier--format = 1 */
USHORT
format
;
/* Format identifier--format = 1 */
Offset
mark1Coverage
;
/* Offset to Combining Mark Coverage
OffsetTo
<
Coverage
>
mark1Coverage
;
/* Offset to Combining Mark1 Coverage
* table--from beginning of MarkMarkPos
* table--from beginning of MarkMarkPos
* subtable */
* subtable */
Offset
mark2Coverage
;
/* Offset to Base Mark Coverage
OffsetTo
<
Coverage
>
mark2Coverage
;
/* Offset to Combining Mark2 Coverage
* table--from beginning of MarkMarkPos
* table--from beginning of MarkMarkPos
* subtable */
* subtable */
USHORT
offset
;
/* Mark1Array */
USHORT
classCount
;
/* Number of defined mark classes */
Offset
mark2Array
;
/* Offset to Mark2Array table for
OffsetTo
<
MarkArray
>
* Mark2--from beginning of MarkMarkPos
mark1Array
;
/* Offset to Mark1Array table--from
* subtable */
* beginning of MarkMarkPos subtable */
OffsetTo
<
Mark2Array
>
mark2Array
;
/* Offset to Mark2Array table--from
* beginning of MarkMarkPos subtable */
};
};
ASSERT_SIZE
(
MarkMarkPosFormat1
,
1
0
);
ASSERT_SIZE
(
MarkMarkPosFormat1
,
1
2
);
struct
MarkMarkPos
struct
MarkMarkPos
{
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录