Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
a7aba99b
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,发现更多精彩内容 >>
提交
a7aba99b
编写于
10月 30, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[name] Rename hb_name_id_t to hb_ot_name_id_t
https://github.com/harfbuzz/harfbuzz/pull/1254
上级
881e1054
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
139 addition
and
138 deletion
+139
-138
docs/harfbuzz-sections.txt
docs/harfbuzz-sections.txt
+2
-1
src/hb-ot-color-cpal-table.hh
src/hb-ot-color-cpal-table.hh
+6
-6
src/hb-ot-color.cc
src/hb-ot-color.cc
+3
-3
src/hb-ot-color.h
src/hb-ot-color.h
+2
-2
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+22
-22
src/hb-ot-layout.h
src/hb-ot-layout.h
+14
-14
src/hb-ot-name-table.hh
src/hb-ot-name-table.hh
+3
-3
src/hb-ot-name.cc
src/hb-ot-name.cc
+19
-19
src/hb-ot-name.h
src/hb-ot-name.h
+49
-49
test/api/test-ot-color.c
test/api/test-ot-color.c
+15
-15
test/api/test-ot-name.c
test/api/test-ot-name.c
+4
-4
未找到文件。
docs/harfbuzz-sections.txt
浏览文件 @
a7aba99b
...
...
@@ -481,7 +481,8 @@ hb_ot_font_set_funcs
<SECTION>
<FILE>hb-ot-name</FILE>
hb_name_id_t
hb_ot_name_id_t
HB_OT_NAME_ID_INVALID
hb_ot_name_entry_t
hb_ot_name_list_names
hb_ot_name_get_utf16
...
...
src/hb-ot-color-cpal-table.hh
浏览文件 @
a7aba99b
...
...
@@ -58,21 +58,21 @@ struct CPALV1Tail
hb_array
(
base
+
paletteFlagsZ
,
palette_count
)[
palette_index
];
}
inline
hb_name_id_t
inline
hb_
ot_
name_id_t
get_palette_name_id
(
const
void
*
base
,
unsigned
int
palette_index
,
unsigned
int
palette_count
)
const
{
if
(
!
paletteLabelsZ
)
return
HB_NAME_ID_INVALID
;
if
(
!
paletteLabelsZ
)
return
HB_
OT_
NAME_ID_INVALID
;
return
hb_array
(
base
+
paletteLabelsZ
,
palette_count
)[
palette_index
];
}
inline
hb_name_id_t
inline
hb_
ot_
name_id_t
get_color_name_id
(
const
void
*
base
,
unsigned
int
color_index
,
unsigned
int
color_count
)
const
{
if
(
!
colorLabelsZ
)
return
HB_NAME_ID_INVALID
;
if
(
!
colorLabelsZ
)
return
HB_
OT_
NAME_ID_INVALID
;
return
hb_array
(
base
+
colorLabelsZ
,
color_count
)[
color_index
];
}
...
...
@@ -123,10 +123,10 @@ struct CPAL
inline
hb_ot_color_palette_flags_t
get_palette_flags
(
unsigned
int
palette_index
)
const
{
return
v1
().
get_palette_flags
(
this
,
palette_index
,
numPalettes
);
}
inline
hb_name_id_t
get_palette_name_id
(
unsigned
int
palette_index
)
const
inline
hb_
ot_
name_id_t
get_palette_name_id
(
unsigned
int
palette_index
)
const
{
return
v1
().
get_palette_name_id
(
this
,
palette_index
,
numPalettes
);
}
inline
hb_name_id_t
get_color_name_id
(
unsigned
int
color_index
)
const
inline
hb_
ot_
name_id_t
get_color_name_id
(
unsigned
int
color_index
)
const
{
return
v1
().
get_color_name_id
(
this
,
color_index
,
numColors
);
}
inline
unsigned
int
get_palette_colors
(
unsigned
int
palette_index
,
...
...
src/hb-ot-color.cc
浏览文件 @
a7aba99b
...
...
@@ -129,11 +129,11 @@ hb_ot_color_palette_get_count (hb_face_t *face)
* have themed palettes like "Spring", "Summer", "Fall", and "Winter".
*
* Returns: an identifier within @face's `name` table.
* If the requested palette has no name the result is #HB_NAME_ID_INVALID.
* If the requested palette has no name the result is #HB_
OT_
NAME_ID_INVALID.
*
* Since: 2.1.0
*/
hb_name_id_t
hb_
ot_
name_id_t
hb_ot_color_palette_get_name_id
(
hb_face_t
*
face
,
unsigned
int
palette_index
)
{
...
...
@@ -149,7 +149,7 @@ hb_ot_color_palette_get_name_id (hb_face_t *face,
*
* Since: 2.1.0
*/
hb_name_id_t
hb_
ot_
name_id_t
hb_ot_color_palette_color_get_name_id
(
hb_face_t
*
face
,
unsigned
int
color_index
)
{
...
...
src/hb-ot-color.h
浏览文件 @
a7aba99b
...
...
@@ -49,11 +49,11 @@ hb_ot_color_has_palettes (hb_face_t *face);
HB_EXTERN
unsigned
int
hb_ot_color_palette_get_count
(
hb_face_t
*
face
);
HB_EXTERN
hb_name_id_t
HB_EXTERN
hb_
ot_
name_id_t
hb_ot_color_palette_get_name_id
(
hb_face_t
*
face
,
unsigned
int
palette_index
);
HB_EXTERN
hb_name_id_t
HB_EXTERN
hb_
ot_
name_id_t
hb_ot_color_palette_color_get_name_id
(
hb_face_t
*
face
,
unsigned
int
color_index
);
...
...
src/hb-ot-layout.cc
浏览文件 @
a7aba99b
...
...
@@ -1053,12 +1053,12 @@ hb_ot_layout_position_finish_offsets (hb_font_t *font, hb_buffer_t *buffer)
* Since: 0.9.10
**/
hb_bool_t
hb_ot_layout_get_size_params
(
hb_face_t
*
face
,
unsigned
int
*
design_size
,
/* OUT. May be NULL */
unsigned
int
*
subfamily_id
,
/* OUT. May be NULL */
hb_name_id_t
*
subfamily_name_id
,
/* OUT. May be NULL */
unsigned
int
*
range_start
,
/* OUT. May be NULL */
unsigned
int
*
range_end
/* OUT. May be NULL */
)
hb_ot_layout_get_size_params
(
hb_face_t
*
face
,
unsigned
int
*
design_size
,
/* OUT. May be NULL */
unsigned
int
*
subfamily_id
,
/* OUT. May be NULL */
hb_
ot_
name_id_t
*
subfamily_name_id
,
/* OUT. May be NULL */
unsigned
int
*
range_start
,
/* OUT. May be NULL */
unsigned
int
*
range_end
/* OUT. May be NULL */
)
{
const
OT
::
GPOS
&
gpos
=
_get_gpos
(
face
);
const
hb_tag_t
tag
=
HB_TAG
(
's'
,
'i'
,
'z'
,
'e'
);
...
...
@@ -1086,7 +1086,7 @@ hb_ot_layout_get_size_params (hb_face_t *face,
if
(
design_size
)
*
design_size
=
0
;
if
(
subfamily_id
)
*
subfamily_id
=
0
;
if
(
subfamily_name_id
)
*
subfamily_name_id
=
HB_NAME_ID_INVALID
;
if
(
subfamily_name_id
)
*
subfamily_name_id
=
HB_
OT_
NAME_ID_INVALID
;
if
(
range_start
)
*
range_start
=
0
;
if
(
range_end
)
*
range_end
=
0
;
...
...
@@ -1118,14 +1118,14 @@ hb_ot_layout_get_size_params (hb_face_t *face,
* Since: 2.0.0
**/
hb_bool_t
hb_ot_layout_feature_get_name_ids
(
hb_face_t
*
face
,
hb_tag_t
table_tag
,
unsigned
int
feature_index
,
hb_name_id_t
*
label_id
,
/* OUT. May be NULL */
hb_name_id_t
*
tooltip_id
,
/* OUT. May be NULL */
hb_name_id_t
*
sample_id
,
/* OUT. May be NULL */
unsigned
int
*
num_named_parameters
,
/* OUT. May be NULL */
hb_name_id_t
*
first_param_id
/* OUT. May be NULL */
)
hb_ot_layout_feature_get_name_ids
(
hb_face_t
*
face
,
hb_tag_t
table_tag
,
unsigned
int
feature_index
,
hb_
ot_
name_id_t
*
label_id
,
/* OUT. May be NULL */
hb_
ot_
name_id_t
*
tooltip_id
,
/* OUT. May be NULL */
hb_
ot_
name_id_t
*
sample_id
,
/* OUT. May be NULL */
unsigned
int
*
num_named_parameters
,
/* OUT. May be NULL */
hb_
ot_
name_id_t
*
first_param_id
/* OUT. May be NULL */
)
{
const
OT
::
GSUBGPOS
&
g
=
get_gsubgpos_table
(
face
,
table_tag
);
...
...
@@ -1141,10 +1141,10 @@ hb_ot_layout_feature_get_name_ids (hb_face_t *face,
{
if
(
label_id
)
*
label_id
=
ss_params
.
uiNameID
;
// ssXX features don't have the rest
if
(
tooltip_id
)
*
tooltip_id
=
HB_NAME_ID_INVALID
;
if
(
sample_id
)
*
sample_id
=
HB_NAME_ID_INVALID
;
if
(
tooltip_id
)
*
tooltip_id
=
HB_
OT_
NAME_ID_INVALID
;
if
(
sample_id
)
*
sample_id
=
HB_
OT_
NAME_ID_INVALID
;
if
(
num_named_parameters
)
*
num_named_parameters
=
0
;
if
(
first_param_id
)
*
first_param_id
=
HB_NAME_ID_INVALID
;
if
(
first_param_id
)
*
first_param_id
=
HB_
OT_
NAME_ID_INVALID
;
return
true
;
}
const
OT
::
FeatureParamsCharacterVariants
&
cv_params
=
...
...
@@ -1160,11 +1160,11 @@ hb_ot_layout_feature_get_name_ids (hb_face_t *face,
}
}
if
(
label_id
)
*
label_id
=
HB_NAME_ID_INVALID
;
if
(
tooltip_id
)
*
tooltip_id
=
HB_NAME_ID_INVALID
;
if
(
sample_id
)
*
sample_id
=
HB_NAME_ID_INVALID
;
if
(
label_id
)
*
label_id
=
HB_
OT_
NAME_ID_INVALID
;
if
(
tooltip_id
)
*
tooltip_id
=
HB_
OT_
NAME_ID_INVALID
;
if
(
sample_id
)
*
sample_id
=
HB_
OT_
NAME_ID_INVALID
;
if
(
num_named_parameters
)
*
num_named_parameters
=
0
;
if
(
first_param_id
)
*
first_param_id
=
HB_NAME_ID_INVALID
;
if
(
first_param_id
)
*
first_param_id
=
HB_
OT_
NAME_ID_INVALID
;
return
false
;
}
...
...
src/hb-ot-layout.h
浏览文件 @
a7aba99b
...
...
@@ -364,23 +364,23 @@ Xhb_ot_layout_lookup_position (hb_font_t *font,
/* Optical 'size' feature info. Returns true if found.
* https://docs.microsoft.com/en-us/typography/opentype/spec/features_pt#size */
HB_EXTERN
hb_bool_t
hb_ot_layout_get_size_params
(
hb_face_t
*
face
,
unsigned
int
*
design_size
,
/* OUT. May be NULL */
unsigned
int
*
subfamily_id
,
/* OUT. May be NULL */
hb_name_id_t
*
subfamily_name_id
,
/* OUT. May be NULL */
unsigned
int
*
range_start
,
/* OUT. May be NULL */
unsigned
int
*
range_end
/* OUT. May be NULL */
);
hb_ot_layout_get_size_params
(
hb_face_t
*
face
,
unsigned
int
*
design_size
,
/* OUT. May be NULL */
unsigned
int
*
subfamily_id
,
/* OUT. May be NULL */
hb_
ot_
name_id_t
*
subfamily_name_id
,
/* OUT. May be NULL */
unsigned
int
*
range_start
,
/* OUT. May be NULL */
unsigned
int
*
range_end
/* OUT. May be NULL */
);
HB_EXTERN
hb_bool_t
hb_ot_layout_feature_get_name_ids
(
hb_face_t
*
face
,
hb_tag_t
table_tag
,
unsigned
int
feature_index
,
hb_name_id_t
*
label_id
/* OUT. May be NULL */
,
hb_name_id_t
*
tooltip_id
/* OUT. May be NULL */
,
hb_name_id_t
*
sample_id
/* OUT. May be NULL */
,
unsigned
int
*
num_named_parameters
/* OUT. May be NULL */
,
hb_name_id_t
*
first_param_id
/* OUT. May be NULL */
);
hb_ot_layout_feature_get_name_ids
(
hb_face_t
*
face
,
hb_tag_t
table_tag
,
unsigned
int
feature_index
,
hb_
ot_
name_id_t
*
label_id
/* OUT. May be NULL */
,
hb_
ot_
name_id_t
*
tooltip_id
/* OUT. May be NULL */
,
hb_
ot_
name_id_t
*
sample_id
/* OUT. May be NULL */
,
unsigned
int
*
num_named_parameters
/* OUT. May be NULL */
,
hb_
ot_
name_id_t
*
first_param_id
/* OUT. May be NULL */
);
HB_EXTERN
unsigned
int
...
...
src/hb-ot-name-table.hh
浏览文件 @
a7aba99b
...
...
@@ -224,9 +224,9 @@ struct name
hb_blob_destroy
(
this
->
blob
);
}
inline
int
get_index
(
hb_name_id_t
name_id
,
hb_language_t
language
,
unsigned
int
*
width
=
nullptr
)
const
inline
int
get_index
(
hb_
ot_
name_id_t
name_id
,
hb_language_t
language
,
unsigned
int
*
width
=
nullptr
)
const
{
const
hb_ot_name_entry_t
key
=
{
name_id
,
{
0
},
language
};
const
hb_ot_name_entry_t
*
entry
=
(
const
hb_ot_name_entry_t
*
)
...
...
src/hb-ot-name.cc
浏览文件 @
a7aba99b
...
...
@@ -118,10 +118,10 @@ hb_ot_name_convert_utf (const hb_bytes_t *bytes,
template
<
typename
utf_t
>
static
inline
unsigned
int
hb_ot_name_get_utf
(
hb_face_t
*
face
,
hb_
name_id_t
name_id
,
hb_language_t
language
,
unsigned
int
*
text_size
/* IN/OUT */
,
hb_ot_name_get_utf
(
hb_face_t
*
face
,
hb_
ot_name_id_t
name_id
,
hb_language_t
language
,
unsigned
int
*
text_size
/* IN/OUT */
,
typename
utf_t
::
codepoint_t
*
text
/* OUT */
)
{
const
OT
::
name_accelerator_t
&
name
=
_get_name
(
face
);
...
...
@@ -168,11 +168,11 @@ hb_ot_name_get_utf (hb_face_t *face,
* Since: 2.1.0
**/
unsigned
int
hb_ot_name_get_utf8
(
hb_face_t
*
face
,
hb_
name_id_t
name_id
,
hb_language_t
language
,
unsigned
int
*
text_size
/* IN/OUT */
,
char
*
text
/* OUT */
)
hb_ot_name_get_utf8
(
hb_face_t
*
face
,
hb_
ot_name_id_t
name_id
,
hb_language_t
language
,
unsigned
int
*
text_size
/* IN/OUT */
,
char
*
text
/* OUT */
)
{
return
hb_ot_name_get_utf
<
hb_utf8_t
>
(
face
,
name_id
,
language
,
text_size
,
(
hb_utf8_t
::
codepoint_t
*
)
text
);
...
...
@@ -195,11 +195,11 @@ hb_ot_name_get_utf8 (hb_face_t *face,
* Since: 2.1.0
**/
unsigned
int
hb_ot_name_get_utf16
(
hb_face_t
*
face
,
hb_
name_id_t
name_id
,
hb_language_t
language
,
unsigned
int
*
text_size
/* IN/OUT */
,
uint16_t
*
text
/* OUT */
)
hb_ot_name_get_utf16
(
hb_face_t
*
face
,
hb_
ot_name_id_t
name_id
,
hb_language_t
language
,
unsigned
int
*
text_size
/* IN/OUT */
,
uint16_t
*
text
/* OUT */
)
{
return
hb_ot_name_get_utf
<
hb_utf16_t
>
(
face
,
name_id
,
language
,
text_size
,
text
);
}
...
...
@@ -221,11 +221,11 @@ hb_ot_name_get_utf16 (hb_face_t *face,
* Since: 2.1.0
**/
unsigned
int
hb_ot_name_get_utf32
(
hb_face_t
*
face
,
hb_
name_id_t
name_id
,
hb_language_t
language
,
unsigned
int
*
text_size
/* IN/OUT */
,
uint32_t
*
text
/* OUT */
)
hb_ot_name_get_utf32
(
hb_face_t
*
face
,
hb_
ot_name_id_t
name_id
,
hb_language_t
language
,
unsigned
int
*
text_size
/* IN/OUT */
,
uint32_t
*
text
/* OUT */
)
{
return
hb_ot_name_get_utf
<
hb_utf32_t
>
(
face
,
name_id
,
language
,
text_size
,
text
);
}
src/hb-ot-name.h
浏览文件 @
a7aba99b
...
...
@@ -35,8 +35,8 @@ HB_BEGIN_DECLS
/**
* hb_name_id_t:
* @HB_NAME_ID_INVALID: Value to represent a nonexistent name ID.
* hb_
ot_
name_id_t:
* @HB_
OT_
NAME_ID_INVALID: Value to represent a nonexistent name ID.
*
* An integral type representing an OpenType 'name' table name identifier.
* There are predefined name IDs, as well as name IDs return from other
...
...
@@ -46,37 +46,37 @@ HB_BEGIN_DECLS
**/
enum
{
HB_
NAME_ID_COPYRIGHT
=
0
,
HB_NAME_ID_FONT_FAMILY
=
1
,
HB_NAME_ID_FONT_SUBFAMILY
=
2
,
HB_
NAME_ID_UNIQUE_ID
=
3
,
HB_
NAME_ID_FULL_NAME
=
4
,
HB_NAME_ID_VERSION_STRING
=
5
,
HB_NAME_ID_POSTSCRIPT_NAME
=
6
,
HB_
NAME_ID_TRADEMARK
=
7
,
HB_NAME_ID_MANUFACTURER
=
8
,
HB_
NAME_ID_DESIGNER
=
9
,
HB_NAME_ID_DESCRIPTION
=
10
,
HB_
NAME_ID_VENDOR_URL
=
11
,
HB_NAME_ID_DESIGNER_URL
=
12
,
HB_NAME_ID_LICENSE
=
13
,
HB_NAME_ID_LICENSE_URL
=
14
,
/*HB_
NAME_ID_RESERVED
= 15,*/
HB_
NAME_ID_TYPOGRAPHIC_FAMILY
=
16
,
HB_NAME_ID_TYPOGRAPHIC_SUBFAMILY
=
17
,
HB_NAME_ID_MAC_FULL_NAME
=
18
,
HB_NAME_ID_SAMPLE_TEXT
=
19
,
HB_
NAME_ID_CID_FINDFONT_NAME
=
20
,
HB_
NAME_ID_WWS_FAMILY
=
21
,
HB_NAME_ID_WWS_SUBFAMILY
=
22
,
HB_
NAME_ID_LIGHT_BACKGROUND
=
23
,
HB_NAME_ID_DARK_BACKGROUND
=
24
,
HB_NAME_ID_VARIATIONS_PS_PREFIX
=
25
,
HB_NAME_ID_INVALID
=
0xFFFF
,
HB_
OT_NAME_ID_COPYRIGHT
=
0
,
HB_
OT_
NAME_ID_FONT_FAMILY
=
1
,
HB_
OT_
NAME_ID_FONT_SUBFAMILY
=
2
,
HB_
OT_NAME_ID_UNIQUE_ID
=
3
,
HB_
OT_NAME_ID_FULL_NAME
=
4
,
HB_
OT_
NAME_ID_VERSION_STRING
=
5
,
HB_
OT_
NAME_ID_POSTSCRIPT_NAME
=
6
,
HB_
OT_NAME_ID_TRADEMARK
=
7
,
HB_
OT_
NAME_ID_MANUFACTURER
=
8
,
HB_
OT_NAME_ID_DESIGNER
=
9
,
HB_
OT_
NAME_ID_DESCRIPTION
=
10
,
HB_
OT_NAME_ID_VENDOR_URL
=
11
,
HB_
OT_
NAME_ID_DESIGNER_URL
=
12
,
HB_
OT_
NAME_ID_LICENSE
=
13
,
HB_
OT_
NAME_ID_LICENSE_URL
=
14
,
/*HB_
OT_NAME_ID_RESERVED
= 15,*/
HB_
OT_NAME_ID_TYPOGRAPHIC_FAMILY
=
16
,
HB_
OT_
NAME_ID_TYPOGRAPHIC_SUBFAMILY
=
17
,
HB_
OT_
NAME_ID_MAC_FULL_NAME
=
18
,
HB_
OT_
NAME_ID_SAMPLE_TEXT
=
19
,
HB_
OT_NAME_ID_CID_FINDFONT_NAME
=
20
,
HB_
OT_NAME_ID_WWS_FAMILY
=
21
,
HB_
OT_
NAME_ID_WWS_SUBFAMILY
=
22
,
HB_
OT_NAME_ID_LIGHT_BACKGROUND
=
23
,
HB_
OT_
NAME_ID_DARK_BACKGROUND
=
24
,
HB_
OT_
NAME_ID_VARIATIONS_PS_PREFIX
=
25
,
HB_
OT_
NAME_ID_INVALID
=
0xFFFF
,
};
typedef
unsigned
int
hb_name_id_t
;
typedef
unsigned
int
hb_
ot_
name_id_t
;
/**
...
...
@@ -90,11 +90,11 @@ typedef unsigned int hb_name_id_t;
**/
typedef
struct
hb_ot_name_entry_t
{
hb_
name_id_t
name_id
;
hb_
ot_name_id_t
name_id
;
/*< private >*/
hb_var_int_t
var
;
hb_var_int_t
var
;
/*< public >*/
hb_language_t
language
;
hb_language_t
language
;
}
hb_ot_name_entry_t
;
HB_EXTERN
const
hb_ot_name_entry_t
*
...
...
@@ -103,25 +103,25 @@ hb_ot_name_list_names (hb_face_t *face,
HB_EXTERN
unsigned
int
hb_ot_name_get_utf8
(
hb_face_t
*
face
,
hb_
name_id_t
name_id
,
hb_language_t
language
,
unsigned
int
*
text_size
/* IN/OUT */
,
char
*
text
/* OUT */
);
hb_ot_name_get_utf8
(
hb_face_t
*
face
,
hb_
ot_name_id_t
name_id
,
hb_language_t
language
,
unsigned
int
*
text_size
/* IN/OUT */
,
char
*
text
/* OUT */
);
HB_EXTERN
unsigned
int
hb_ot_name_get_utf16
(
hb_face_t
*
face
,
hb_
name_id_t
name_id
,
hb_language_t
language
,
unsigned
int
*
text_size
/* IN/OUT */
,
uint16_t
*
text
/* OUT */
);
hb_ot_name_get_utf16
(
hb_face_t
*
face
,
hb_
ot_name_id_t
name_id
,
hb_language_t
language
,
unsigned
int
*
text_size
/* IN/OUT */
,
uint16_t
*
text
/* OUT */
);
HB_EXTERN
unsigned
int
hb_ot_name_get_utf32
(
hb_face_t
*
face
,
hb_
name_id_t
name_id
,
hb_language_t
language
,
unsigned
int
*
text_size
/* IN/OUT */
,
uint32_t
*
text
/* OUT */
);
hb_ot_name_get_utf32
(
hb_face_t
*
face
,
hb_
ot_name_id_t
name_id
,
hb_language_t
language
,
unsigned
int
*
text_size
/* IN/OUT */
,
uint32_t
*
text
/* OUT */
);
HB_END_DECLS
...
...
test/api/test-ot-color.c
浏览文件 @
a7aba99b
...
...
@@ -141,19 +141,19 @@ static void
test_hb_ot_color_palette_get_name_id_empty
(
void
)
{
/* numPalettes=0, so all calls are for out-of-bounds palette indices */
g_assert_cmpint
(
hb_ot_color_palette_get_name_id
(
hb_face_get_empty
(),
0
),
==
,
HB_NAME_ID_INVALID
);
g_assert_cmpint
(
hb_ot_color_palette_get_name_id
(
hb_face_get_empty
(),
1
),
==
,
HB_NAME_ID_INVALID
);
g_assert_cmpint
(
hb_ot_color_palette_get_name_id
(
hb_face_get_empty
(),
0
),
==
,
HB_
OT_
NAME_ID_INVALID
);
g_assert_cmpint
(
hb_ot_color_palette_get_name_id
(
hb_face_get_empty
(),
1
),
==
,
HB_
OT_
NAME_ID_INVALID
);
}
static
void
test_hb_ot_color_palette_get_name_id_v0
(
void
)
{
g_assert_cmpint
(
hb_ot_color_palette_get_name_id
(
cpal_v0
,
0
),
==
,
HB_NAME_ID_INVALID
);
g_assert_cmpint
(
hb_ot_color_palette_get_name_id
(
cpal_v0
,
1
),
==
,
HB_NAME_ID_INVALID
);
g_assert_cmpint
(
hb_ot_color_palette_get_name_id
(
cpal_v0
,
0
),
==
,
HB_
OT_
NAME_ID_INVALID
);
g_assert_cmpint
(
hb_ot_color_palette_get_name_id
(
cpal_v0
,
1
),
==
,
HB_
OT_
NAME_ID_INVALID
);
/* numPalettes=2, so palette #2 is out of bounds */
g_assert_cmpint
(
hb_ot_color_palette_get_name_id
(
cpal_v0
,
2
),
==
,
HB_NAME_ID_INVALID
);
g_assert_cmpint
(
hb_ot_color_palette_get_name_id
(
cpal_v0
,
2
),
==
,
HB_
OT_
NAME_ID_INVALID
);
}
...
...
@@ -161,11 +161,11 @@ static void
test_hb_ot_color_palette_get_name_id_v1
(
void
)
{
g_assert_cmpint
(
hb_ot_color_palette_get_name_id
(
cpal_v1
,
0
),
==
,
257
);
g_assert_cmpint
(
hb_ot_color_palette_get_name_id
(
cpal_v1
,
1
),
==
,
HB_NAME_ID_INVALID
);
g_assert_cmpint
(
hb_ot_color_palette_get_name_id
(
cpal_v1
,
1
),
==
,
HB_
OT_
NAME_ID_INVALID
);
g_assert_cmpint
(
hb_ot_color_palette_get_name_id
(
cpal_v1
,
2
),
==
,
258
);
/* numPalettes=3, so palette #3 is out of bounds */
g_assert_cmpint
(
hb_ot_color_palette_get_name_id
(
cpal_v1
,
3
),
==
,
HB_NAME_ID_INVALID
);
g_assert_cmpint
(
hb_ot_color_palette_get_name_id
(
cpal_v1
,
3
),
==
,
HB_
OT_
NAME_ID_INVALID
);
}
...
...
@@ -302,15 +302,15 @@ test_hb_ot_color_palette_get_colors_v1 (void)
static
void
test_hb_ot_color_palette_color_get_name_id
(
void
)
{
g_assert_cmpuint
(
hb_ot_color_palette_color_get_name_id
(
empty
,
0
),
==
,
HB_NAME_ID_INVALID
);
g_assert_cmpuint
(
hb_ot_color_palette_color_get_name_id
(
empty
,
1
),
==
,
HB_NAME_ID_INVALID
);
g_assert_cmpuint
(
hb_ot_color_palette_color_get_name_id
(
empty
,
2
),
==
,
HB_NAME_ID_INVALID
);
g_assert_cmpuint
(
hb_ot_color_palette_color_get_name_id
(
cpal_v0
,
0
),
==
,
HB_NAME_ID_INVALID
);
g_assert_cmpuint
(
hb_ot_color_palette_color_get_name_id
(
cpal_v0
,
1
),
==
,
HB_NAME_ID_INVALID
);
g_assert_cmpuint
(
hb_ot_color_palette_color_get_name_id
(
cpal_v0
,
2
),
==
,
HB_NAME_ID_INVALID
);
g_assert_cmpuint
(
hb_ot_color_palette_color_get_name_id
(
cpal_v1
,
0
),
==
,
HB_NAME_ID_INVALID
);
g_assert_cmpuint
(
hb_ot_color_palette_color_get_name_id
(
empty
,
0
),
==
,
HB_
OT_
NAME_ID_INVALID
);
g_assert_cmpuint
(
hb_ot_color_palette_color_get_name_id
(
empty
,
1
),
==
,
HB_
OT_
NAME_ID_INVALID
);
g_assert_cmpuint
(
hb_ot_color_palette_color_get_name_id
(
empty
,
2
),
==
,
HB_
OT_
NAME_ID_INVALID
);
g_assert_cmpuint
(
hb_ot_color_palette_color_get_name_id
(
cpal_v0
,
0
),
==
,
HB_
OT_
NAME_ID_INVALID
);
g_assert_cmpuint
(
hb_ot_color_palette_color_get_name_id
(
cpal_v0
,
1
),
==
,
HB_
OT_
NAME_ID_INVALID
);
g_assert_cmpuint
(
hb_ot_color_palette_color_get_name_id
(
cpal_v0
,
2
),
==
,
HB_
OT_
NAME_ID_INVALID
);
g_assert_cmpuint
(
hb_ot_color_palette_color_get_name_id
(
cpal_v1
,
0
),
==
,
HB_
OT_
NAME_ID_INVALID
);
g_assert_cmpuint
(
hb_ot_color_palette_color_get_name_id
(
cpal_v1
,
1
),
==
,
256
);
g_assert_cmpuint
(
hb_ot_color_palette_color_get_name_id
(
cpal_v1
,
2
),
==
,
HB_NAME_ID_INVALID
);
g_assert_cmpuint
(
hb_ot_color_palette_color_get_name_id
(
cpal_v1
,
2
),
==
,
HB_
OT_
NAME_ID_INVALID
);
}
...
...
test/api/test-ot-name.c
浏览文件 @
a7aba99b
...
...
@@ -41,11 +41,11 @@ test_ot_layout_feature_get_name_ids_and_characters (void)
&
feature_index
))
g_error
(
"Failed to find feature index"
);
hb_name_id_t
label_id
;
hb_name_id_t
tooltip_id
;
hb_name_id_t
sample_id
;
hb_
ot_
name_id_t
label_id
;
hb_
ot_
name_id_t
tooltip_id
;
hb_
ot_
name_id_t
sample_id
;
unsigned
int
num_named_parameters
;
hb_name_id_t
first_param_id
;
hb_
ot_
name_id_t
first_param_id
;
if
(
!
hb_ot_layout_feature_get_name_ids
(
face
,
HB_OT_TAG_GSUB
,
feature_index
,
&
label_id
,
&
tooltip_id
,
&
sample_id
,
&
num_named_parameters
,
&
first_param_id
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录