Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
c2527a1b
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看板
提交
c2527a1b
编写于
10月 30, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[mort] Make it compile / hook it up
Untested.
上级
933babdc
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
36 addition
and
24 deletion
+36
-24
src/hb-aat-layout-common.hh
src/hb-aat-layout-common.hh
+5
-6
src/hb-aat-layout-morx-table.hh
src/hb-aat-layout-morx-table.hh
+1
-1
src/hb-aat-layout.cc
src/hb-aat-layout.cc
+30
-17
未找到文件。
src/hb-aat-layout-common.hh
浏览文件 @
c2527a1b
...
@@ -433,8 +433,7 @@ struct StateTable
...
@@ -433,8 +433,7 @@ struct StateTable
inline
unsigned
int
get_class
(
hb_codepoint_t
glyph_id
,
unsigned
int
num_glyphs
)
const
inline
unsigned
int
get_class
(
hb_codepoint_t
glyph_id
,
unsigned
int
num_glyphs
)
const
{
{
if
(
unlikely
(
glyph_id
==
DELETED_GLYPH
))
return
CLASS_DELETED_GLYPH
;
if
(
unlikely
(
glyph_id
==
DELETED_GLYPH
))
return
CLASS_DELETED_GLYPH
;
const
HBUINT16
*
v
=
(
this
+
classTable
).
get_value
(
glyph_id
,
num_glyphs
);
return
(
this
+
classTable
).
get_class
(
glyph_id
,
num_glyphs
);
return
v
?
(
unsigned
)
*
v
:
(
unsigned
)
CLASS_OUT_OF_BOUNDS
;
}
}
inline
const
Entry
<
Extra
>
*
get_entries
()
const
inline
const
Entry
<
Extra
>
*
get_entries
()
const
...
@@ -446,7 +445,7 @@ struct StateTable
...
@@ -446,7 +445,7 @@ struct StateTable
{
{
if
(
unlikely
(
klass
>=
nClasses
))
return
nullptr
;
if
(
unlikely
(
klass
>=
nClasses
))
return
nullptr
;
const
HBU
INT16
*
states
=
(
this
+
stateArrayTable
).
arrayZ
;
const
HBU
SHORT
*
states
=
(
this
+
stateArrayTable
).
arrayZ
;
const
Entry
<
Extra
>
*
entries
=
(
this
+
entryTable
).
arrayZ
;
const
Entry
<
Extra
>
*
entries
=
(
this
+
entryTable
).
arrayZ
;
unsigned
int
entry
=
states
[
state
*
nClasses
+
klass
];
unsigned
int
entry
=
states
[
state
*
nClasses
+
klass
];
...
@@ -461,7 +460,7 @@ struct StateTable
...
@@ -461,7 +460,7 @@ struct StateTable
if
(
unlikely
(
!
(
c
->
check_struct
(
this
)
&&
if
(
unlikely
(
!
(
c
->
check_struct
(
this
)
&&
classTable
.
sanitize
(
c
,
this
))))
return_trace
(
false
);
classTable
.
sanitize
(
c
,
this
))))
return_trace
(
false
);
const
HBU
INT16
*
states
=
(
this
+
stateArrayTable
).
arrayZ
;
const
HBU
SHORT
*
states
=
(
this
+
stateArrayTable
).
arrayZ
;
const
Entry
<
Extra
>
*
entries
=
(
this
+
entryTable
).
arrayZ
;
const
Entry
<
Extra
>
*
entries
=
(
this
+
entryTable
).
arrayZ
;
unsigned
int
num_classes
=
nClasses
;
unsigned
int
num_classes
=
nClasses
;
...
@@ -483,8 +482,8 @@ struct StateTable
...
@@ -483,8 +482,8 @@ struct StateTable
if
((
c
->
max_ops
-=
num_states
-
state
)
<
0
)
if
((
c
->
max_ops
-=
num_states
-
state
)
<
0
)
return_trace
(
false
);
return_trace
(
false
);
{
/* Sweep new states. */
{
/* Sweep new states. */
const
HBU
INT16
*
stop
=
&
states
[
num_states
*
num_classes
];
const
HBU
SHORT
*
stop
=
&
states
[
num_states
*
num_classes
];
for
(
const
HBU
INT16
*
p
=
&
states
[
state
*
num_classes
];
p
<
stop
;
p
++
)
for
(
const
HBU
SHORT
*
p
=
&
states
[
state
*
num_classes
];
p
<
stop
;
p
++
)
num_entries
=
MAX
<
unsigned
int
>
(
num_entries
,
*
p
+
1
);
num_entries
=
MAX
<
unsigned
int
>
(
num_entries
,
*
p
+
1
);
state
=
num_states
;
state
=
num_states
;
}
}
...
...
src/hb-aat-layout-morx-table.hh
浏览文件 @
c2527a1b
...
@@ -278,7 +278,7 @@ struct ContextualSubtable
...
@@ -278,7 +278,7 @@ struct ContextualSubtable
private:
private:
bool
mark_set
;
bool
mark_set
;
unsigned
int
mark
;
unsigned
int
mark
;
const
UnsizedOffsetListOf
<
Lookup
<
GlyphID
>
,
HBUINT
32
,
false
>
&
subs
;
const
UnsizedOffsetListOf
<
Lookup
<
GlyphID
>
,
HBUINT
,
false
>
&
subs
;
};
};
inline
bool
apply
(
hb_aat_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_aat_apply_context_t
*
c
)
const
...
...
src/hb-aat-layout.cc
浏览文件 @
c2527a1b
...
@@ -133,20 +133,20 @@ hb_aat_layout_find_feature_mapping (hb_tag_t tag)
...
@@ -133,20 +133,20 @@ hb_aat_layout_find_feature_mapping (hb_tag_t tag)
* mort/morx/kerx/trak
* mort/morx/kerx/trak
*/
*/
//
static inline const AAT::mort&
static
inline
const
AAT
::
mort
&
//
_get_mort (hb_face_t *face, hb_blob_t **blob = nullptr)
_get_mort
(
hb_face_t
*
face
,
hb_blob_t
**
blob
=
nullptr
)
//
{
{
//
if (unlikely (!hb_ot_shaper_face_data_ensure (face)))
if
(
unlikely
(
!
hb_ot_shaper_face_data_ensure
(
face
)))
//
{
{
//
if (blob)
if
(
blob
)
//
*blob = hb_blob_get_empty ();
*
blob
=
hb_blob_get_empty
();
//
return Null(AAT::mort);
return
Null
(
AAT
::
mort
);
//
}
}
// const AAT::morx
& mort = *(hb_ot_face_data (face)->mort.get ());
const
AAT
::
mort
&
mort
=
*
(
hb_ot_face_data
(
face
)
->
mort
.
get
());
//
if (blob)
if
(
blob
)
//
*blob = hb_ot_face_data (face)->mort.get_blob ();
*
blob
=
hb_ot_face_data
(
face
)
->
mort
.
get_blob
();
//
return mort;
return
mort
;
//
}
}
static
inline
const
AAT
::
morx
&
static
inline
const
AAT
::
morx
&
_get_morx
(
hb_face_t
*
face
,
hb_blob_t
**
blob
=
nullptr
)
_get_morx
(
hb_face_t
*
face
,
hb_blob_t
**
blob
=
nullptr
)
{
{
...
@@ -214,7 +214,8 @@ hb_aat_layout_compile_map (const hb_aat_map_builder_t *mapper,
...
@@ -214,7 +214,8 @@ hb_aat_layout_compile_map (const hb_aat_map_builder_t *mapper,
hb_bool_t
hb_bool_t
hb_aat_layout_has_substitution
(
hb_face_t
*
face
)
hb_aat_layout_has_substitution
(
hb_face_t
*
face
)
{
{
return
_get_morx
(
face
).
has_data
();
return
_get_morx
(
face
).
has_data
()
||
_get_mort
(
face
).
has_data
();
}
}
void
void
...
@@ -223,10 +224,22 @@ hb_aat_layout_substitute (hb_ot_shape_plan_t *plan,
...
@@ -223,10 +224,22 @@ hb_aat_layout_substitute (hb_ot_shape_plan_t *plan,
hb_buffer_t
*
buffer
)
hb_buffer_t
*
buffer
)
{
{
hb_blob_t
*
blob
;
hb_blob_t
*
blob
;
const
AAT
::
morx
&
morx
=
_get_morx
(
font
->
face
,
&
blob
);
const
AAT
::
morx
&
morx
=
_get_morx
(
font
->
face
,
&
blob
);
if
(
morx
.
has_data
())
{
AAT
::
hb_aat_apply_context_t
c
(
plan
,
font
,
buffer
,
blob
);
morx
.
apply
(
&
c
);
return
;
}
AAT
::
hb_aat_apply_context_t
c
(
plan
,
font
,
buffer
,
blob
);
const
AAT
::
mort
&
mort
=
_get_mort
(
font
->
face
,
&
blob
);
morx
.
apply
(
&
c
);
if
(
mort
.
has_data
())
{
AAT
::
hb_aat_apply_context_t
c
(
plan
,
font
,
buffer
,
blob
);
mort
.
apply
(
&
c
);
return
;
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录