Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
3aff3f82
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看板
提交
3aff3f82
编写于
11月 01, 2018
作者:
E
Ebrahim Byagowi
提交者:
Behdad Esfahbod
11月 25, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[feat] Apply @drott and @jfkthame comments
上级
b791bbba
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
20 addition
and
20 deletion
+20
-20
src/hb-aat-layout-feat-table.hh
src/hb-aat-layout-feat-table.hh
+6
-8
src/hb-aat-layout.cc
src/hb-aat-layout.cc
+7
-5
src/hb-aat-layout.h
src/hb-aat-layout.h
+5
-5
test/api/test-aat-layout.c
test/api/test-aat-layout.c
+2
-2
未找到文件。
src/hb-aat-layout-feat-table.hh
浏览文件 @
3aff3f82
...
@@ -87,7 +87,7 @@ struct FeatureName
...
@@ -87,7 +87,7 @@ struct FeatureName
hb_aat_feature_setting_t
*
default_setting
,
hb_aat_feature_setting_t
*
default_setting
,
unsigned
int
start_offset
,
unsigned
int
start_offset
,
unsigned
int
*
records_count
,
unsigned
int
*
records_count
,
hb_aat_feature_
option_record
_t
*
records_buffer
)
const
hb_aat_feature_
type_selector
_t
*
records_buffer
)
const
{
{
bool
exclusive
=
featureFlags
&
Exclusive
;
bool
exclusive
=
featureFlags
&
Exclusive
;
bool
not_default
=
featureFlags
&
NotDefault
;
bool
not_default
=
featureFlags
&
NotDefault
;
...
@@ -105,12 +105,10 @@ struct FeatureName
...
@@ -105,12 +105,10 @@ struct FeatureName
}
}
if
(
default_setting
)
if
(
default_setting
)
{
{
if
(
exclusive
)
unsigned
int
index
=
not_default
?
featureFlags
&
IndexMask
:
0
;
{
if
(
exclusive
&&
index
<
settings_count
)
if
(
settings_count
&&
!
not_default
)
*
default_setting
=
settings
[
0
].
setting
;
*
default_setting
=
settings
[
index
].
setting
;
else
if
(
not_default
)
*
default_setting
=
featureFlags
&
IndexMask
;
else
*
default_setting
=
HB_AAT_FEATURE_NO_DEFAULT_SETTING
;
}
else
*
default_setting
=
HB_AAT_FEATURE_NO_DEFAULT_INDEX
;
}
}
if
(
records_count
)
*
records_count
=
len
;
if
(
records_count
)
*
records_count
=
len
;
return
settings_count
;
return
settings_count
;
...
@@ -158,7 +156,7 @@ struct feat
...
@@ -158,7 +156,7 @@ struct feat
hb_aat_feature_setting_t
*
default_setting
,
/* OUT. May be NULL. */
hb_aat_feature_setting_t
*
default_setting
,
/* OUT. May be NULL. */
unsigned
int
start_offset
,
unsigned
int
start_offset
,
unsigned
int
*
records_count
,
/* IN/OUT. May be NULL. */
unsigned
int
*
records_count
,
/* IN/OUT. May be NULL. */
hb_aat_feature_
option_record
_t
*
records_buffer
)
const
hb_aat_feature_
type_selector
_t
*
records_buffer
)
const
{
{
return
get_feature
(
type
).
get_settings
(
this
,
default_setting
,
return
get_feature
(
type
).
get_settings
(
this
,
default_setting
,
start_offset
,
records_count
,
records_buffer
);
start_offset
,
records_count
,
records_buffer
);
...
...
src/hb-aat-layout.cc
浏览文件 @
3aff3f82
...
@@ -309,14 +309,16 @@ _hb_aat_language_get (hb_face_t *face,
...
@@ -309,14 +309,16 @@ _hb_aat_language_get (hb_face_t *face,
/**
/**
* hb_aat_get_feature_settings:
* hb_aat_get_feature_settings:
* @face: a font face.
* @face: a font face.
* @identifier: aat feature id you are querying.
* @identifier: AAT feature id you are querying, for example 1 for
* @default_setting: (out): default value for the type. If it is HB_AAT_FEATURE_NO_DEFAULT_INDEX
* "Ligatures" feature, 37 for the "Lower Case" feature,
* means non is default and it is not exclusive also.
* 38 for the "Upper Case" feature, etc.
* @default_setting: (out): default value for the type. If it is HB_AAT_FEATURE_NO_DEFAULT_SETTING
* means none is selected as default and the feature is not exclusive.
* @start_offset: start offset, if you are iterating
* @start_offset: start offset, if you are iterating
* @records_count: (inout): gets input buffer size, puts number of filled one
* @records_count: (inout): gets input buffer size, puts number of filled one
* @records_buffer: (out): buffer of records
* @records_buffer: (out): buffer of records
*
*
* Returns: Total number of records available for the feature.
* Returns: Total number of
feature selector
records available for the feature.
*
*
* Since: REPLACEME
* Since: REPLACEME
*/
*/
...
@@ -326,7 +328,7 @@ hb_aat_get_feature_settings (hb_face_t *face,
...
@@ -326,7 +328,7 @@ hb_aat_get_feature_settings (hb_face_t *face,
hb_aat_feature_setting_t
*
default_setting
,
/* OUT. May be NULL. */
hb_aat_feature_setting_t
*
default_setting
,
/* OUT. May be NULL. */
unsigned
int
start_offset
,
unsigned
int
start_offset
,
unsigned
int
*
records_count
,
/* IN/OUT. May be NULL. */
unsigned
int
*
records_count
,
/* IN/OUT. May be NULL. */
hb_aat_feature_
option_record
_t
*
records_buffer
/* OUT. May be NULL. */
)
hb_aat_feature_
type_selector
_t
*
records_buffer
/* OUT. May be NULL. */
)
{
{
return
_get_feat
(
face
).
get_settings
(
identifier
,
default_setting
,
return
_get_feat
(
face
).
get_settings
(
identifier
,
default_setting
,
start_offset
,
records_count
,
records_buffer
);
start_offset
,
records_count
,
records_buffer
);
...
...
src/hb-aat-layout.h
浏览文件 @
3aff3f82
...
@@ -49,22 +49,22 @@ typedef uint16_t hb_aat_feature_type_t;
...
@@ -49,22 +49,22 @@ typedef uint16_t hb_aat_feature_type_t;
typedef
uint16_t
hb_aat_feature_setting_t
;
typedef
uint16_t
hb_aat_feature_setting_t
;
/**
/**
* hb_aat_feature_
option_record
_t:
* hb_aat_feature_
type_selector
_t:
*
*
* Feature type record
* Feature type record
*
*
* Since: REPLACEME
* Since: REPLACEME
**/
**/
typedef
struct
hb_aat_feature_
option_record
_t
typedef
struct
hb_aat_feature_
type_selector
_t
{
{
hb_aat_feature_setting_t
setting
;
hb_aat_feature_setting_t
setting
;
hb_ot_name_id_t
name_id
;
hb_ot_name_id_t
name_id
;
}
hb_aat_feature_
option_record
_t
;
}
hb_aat_feature_
type_selector
_t
;
/*
/*
* Since: REPLACEME
* Since: REPLACEME
*/
*/
#define HB_AAT_FEATURE_NO_DEFAULT_
INDEX
((hb_aat_feature_setting_t) -1)
#define HB_AAT_FEATURE_NO_DEFAULT_
SETTING
((hb_aat_feature_setting_t) -1)
HB_EXTERN
unsigned
int
HB_EXTERN
unsigned
int
hb_aat_get_feature_settings
(
hb_face_t
*
face
,
hb_aat_get_feature_settings
(
hb_face_t
*
face
,
...
@@ -72,7 +72,7 @@ hb_aat_get_feature_settings (hb_face_t *face,
...
@@ -72,7 +72,7 @@ hb_aat_get_feature_settings (hb_face_t *face,
hb_aat_feature_setting_t
*
default_setting
,
/* OUT. May be NULL. */
hb_aat_feature_setting_t
*
default_setting
,
/* OUT. May be NULL. */
unsigned
int
start_offset
,
unsigned
int
start_offset
,
unsigned
int
*
records_count
,
/* IN/OUT. May be NULL. */
unsigned
int
*
records_count
,
/* IN/OUT. May be NULL. */
hb_aat_feature_
option_record
_t
*
records_buffer
/* OUT. May be NULL. */
);
hb_aat_feature_
type_selector
_t
*
records_buffer
/* OUT. May be NULL. */
);
HB_END_DECLS
HB_END_DECLS
...
...
test/api/test-aat-layout.c
浏览文件 @
3aff3f82
...
@@ -32,7 +32,7 @@ static void
...
@@ -32,7 +32,7 @@ static void
test_aat_get_feature_settings
(
void
)
test_aat_get_feature_settings
(
void
)
{
{
hb_aat_feature_setting_t
default_setting
;
hb_aat_feature_setting_t
default_setting
;
hb_aat_feature_
option_record
_t
records
[
3
];
hb_aat_feature_
type_selector
_t
records
[
3
];
unsigned
int
count
=
3
;
unsigned
int
count
=
3
;
hb_face_t
*
face
=
hb_test_open_font_file
(
"fonts/aat-feat.ttf"
);
hb_face_t
*
face
=
hb_test_open_font_file
(
"fonts/aat-feat.ttf"
);
...
@@ -65,7 +65,7 @@ test_aat_get_feature_settings (void)
...
@@ -65,7 +65,7 @@ test_aat_get_feature_settings (void)
g_assert_cmpuint
(
1
,
==
,
hb_aat_get_feature_settings
(
face
,
14
,
&
default_setting
,
g_assert_cmpuint
(
1
,
==
,
hb_aat_get_feature_settings
(
face
,
14
,
&
default_setting
,
0
,
&
count
,
records
));
0
,
&
count
,
records
));
g_assert_cmpuint
(
1
,
==
,
count
);
g_assert_cmpuint
(
1
,
==
,
count
);
g_assert_cmpuint
(
HB_AAT_FEATURE_NO_DEFAULT_
INDEX
,
==
,
default_setting
);
g_assert_cmpuint
(
HB_AAT_FEATURE_NO_DEFAULT_
SETTING
,
==
,
default_setting
);
g_assert_cmpuint
(
8
,
==
,
records
[
0
].
setting
);
g_assert_cmpuint
(
8
,
==
,
records
[
0
].
setting
);
g_assert_cmpuint
(
308
,
==
,
records
[
0
].
name_id
);
g_assert_cmpuint
(
308
,
==
,
records
[
0
].
name_id
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录