Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
f33ad6d6
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看板
提交
f33ad6d6
编写于
10月 23, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[aat] Fix up previous commit and add files
上级
ffe34784
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
181 addition
and
3 deletion
+181
-3
src/hb-aat-map.cc
src/hb-aat-map.cc
+62
-0
src/hb-aat-map.hh
src/hb-aat-map.hh
+106
-0
src/hb-ot-map.cc
src/hb-ot-map.cc
+1
-0
src/hb-ot-shape.cc
src/hb-ot-shape.cc
+12
-3
未找到文件。
src/hb-aat-map.cc
0 → 100644
浏览文件 @
f33ad6d6
/*
* Copyright © 2009,2010 Red Hat, Inc.
* Copyright © 2010,2011,2013 Google, Inc.
*
* This is part of HarfBuzz, a text shaping library.
*
* Permission is hereby granted, without written agreement and without
* license or royalty fees, to use, copy, modify, and distribute this
* software and its documentation for any purpose, provided that the
* above copyright notice and the following two paragraphs appear in
* all copies of this software.
*
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
* Red Hat Author(s): Behdad Esfahbod
* Google Author(s): Behdad Esfahbod
*/
#include "hb-aat-map.hh"
#include "hb-aat-layout.hh"
void
hb_aat_map_builder_t
::
add_feature
(
hb_tag_t
tag
,
unsigned
int
value
)
{
const
hb_aat_feature_mapping_t
*
mapping
=
hb_aat_layout_find_feature_mapping
(
tag
);
if
(
!
mapping
)
return
;
feature_info_t
*
info
=
features
.
push
();
info
->
type
=
mapping
->
aatFeatureType
;
info
->
setting
=
value
?
mapping
->
selectorToEnable
:
mapping
->
selectorToDisable
;
}
void
hb_aat_map_builder_t
::
compile
(
hb_aat_map_t
&
m
,
const
int
*
coords
HB_UNUSED
,
unsigned
int
num_coords
HB_UNUSED
)
{
/* Sort features and merge duplicates */
if
(
features
.
len
)
{
features
.
qsort
();
unsigned
int
j
=
0
;
for
(
unsigned
int
i
=
1
;
i
<
features
.
len
;
i
++
)
if
(
features
[
i
].
type
!=
features
[
j
].
type
)
features
[
++
j
]
=
features
[
i
];
features
.
shrink
(
j
+
1
);
}
hb_aat_layout_compile_map
(
this
,
&
m
);
}
src/hb-aat-map.hh
0 → 100644
浏览文件 @
f33ad6d6
/*
* Copyright © 2018 Google, Inc.
*
* This is part of HarfBuzz, a text shaping library.
*
* Permission is hereby granted, without written agreement and without
* license or royalty fees, to use, copy, modify, and distribute this
* software and its documentation for any purpose, provided that the
* above copyright notice and the following two paragraphs appear in
* all copies of this software.
*
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
* Google Author(s): Behdad Esfahbod
*/
#ifndef HB_AAT_MAP_HH
#define HB_AAT_MAP_HH
#include "hb.hh"
struct
hb_ot_shape_plan_t
;
struct
hb_aat_map_t
{
friend
struct
hb_aat_map_builder_t
;
public:
inline
void
init
(
void
)
{
memset
(
this
,
0
,
sizeof
(
*
this
));
chain_flags
.
init
();
}
inline
void
fini
(
void
)
{
chain_flags
.
fini
();
}
public:
hb_vector_t
<
hb_mask_t
,
1
>
chain_flags
;
};
struct
hb_aat_map_builder_t
{
public:
HB_INTERNAL
hb_aat_map_builder_t
(
hb_face_t
*
face_
,
const
hb_segment_properties_t
*
props_
HB_UNUSED
)
:
face
(
face_
)
{
features
.
init
();
}
~
hb_aat_map_builder_t
(
void
)
{
features
.
fini
();
}
HB_INTERNAL
void
add_feature
(
hb_tag_t
tag
,
unsigned
int
value
=
1
);
HB_INTERNAL
void
compile
(
hb_aat_map_t
&
m
,
const
int
*
coords
,
unsigned
int
num_coords
);
public:
struct
feature_info_t
{
uint16_t
type
;
uint16_t
setting
;
unsigned
seq
;
/* For stable sorting only. */
static
int
cmp
(
const
void
*
pa
,
const
void
*
pb
)
{
const
feature_info_t
*
a
=
(
const
feature_info_t
*
)
pa
;
const
feature_info_t
*
b
=
(
const
feature_info_t
*
)
pb
;
return
(
a
->
type
!=
b
->
type
)
?
(
a
->
type
<
b
->
type
?
-
1
:
1
)
:
(
a
->
seq
<
b
->
seq
?
-
1
:
a
->
seq
>
b
->
seq
?
1
:
0
);
}
int
cmp
(
const
short
unsigned
int
*
ty
)
const
{
return
(
type
!=
*
ty
)
?
(
type
<
*
ty
?
-
1
:
1
)
:
0
;
}
};
public:
hb_face_t
*
face
;
public:
hb_vector_t
<
feature_info_t
,
32
>
features
;
};
#endif
/* HB_AAT_MAP_HH */
src/hb-ot-map.cc
浏览文件 @
f33ad6d6
...
...
@@ -175,6 +175,7 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m,
}
/* Sort features and merge duplicates */
if
(
feature_infos
.
len
)
{
feature_infos
.
qsort
();
unsigned
int
j
=
0
;
...
...
src/hb-ot-shape.cc
浏览文件 @
f33ad6d6
...
...
@@ -71,7 +71,8 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan,
plan
.
props
=
props
;
plan
.
shaper
=
shaper
;
map
.
compile
(
plan
.
map
,
coords
,
num_coords
);
aat_map
.
compile
(
plan
.
aat_map
,
coords
,
num_coords
);
if
(
apply_morx
)
aat_map
.
compile
(
plan
.
aat_map
,
coords
,
num_coords
);
plan
.
frac_mask
=
plan
.
map
.
get_1_mask
(
HB_TAG
(
'f'
,
'r'
,
'a'
,
'c'
));
plan
.
numr_mask
=
plan
.
map
.
get_1_mask
(
HB_TAG
(
'n'
,
'u'
,
'm'
,
'r'
));
...
...
@@ -162,7 +163,6 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner,
unsigned
int
num_user_features
)
{
hb_ot_map_builder_t
*
map
=
&
planner
->
map
;
hb_aat_map_builder_t
*
aat_map
=
&
planner
->
aat_map
;
map
->
enable_feature
(
HB_TAG
(
'r'
,
'v'
,
'r'
,
'n'
));
map
->
add_gsub_pause
(
nullptr
);
...
...
@@ -228,7 +228,16 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner,
(
feature
->
start
==
HB_FEATURE_GLOBAL_START
&&
feature
->
end
==
HB_FEATURE_GLOBAL_END
)
?
F_GLOBAL
:
F_NONE
,
feature
->
value
);
aat_map
->
add_feature
(
feature
->
tag
,
feature
->
value
);
}
if
(
planner
->
apply_morx
)
{
hb_aat_map_builder_t
*
aat_map
=
&
planner
->
aat_map
;
for
(
unsigned
int
i
=
0
;
i
<
num_user_features
;
i
++
)
{
const
hb_feature_t
*
feature
=
&
user_features
[
i
];
aat_map
->
add_feature
(
feature
->
tag
,
feature
->
value
);
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录