Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
62932c14
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看板
提交
62932c14
编写于
7月 26, 2019
作者:
E
Ebrahim Byagowi
提交者:
Behdad Esfahbod
7月 25, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[meta] Rename ot-metadata to ot-meta per review
上级
821d9e90
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
61 addition
and
60 deletion
+61
-60
docs/harfbuzz-sections.txt
docs/harfbuzz-sections.txt
+4
-3
src/Makefile.am
src/Makefile.am
+4
-4
src/Makefile.sources
src/Makefile.sources
+2
-2
src/harfbuzz.cc
src/harfbuzz.cc
+1
-1
src/hb-ot-meta-table.hh
src/hb-ot-meta-table.hh
+4
-4
src/hb-ot-meta.cc
src/hb-ot-meta.cc
+11
-11
src/hb-ot-meta.h
src/hb-ot-meta.h
+15
-15
src/hb-ot.h
src/hb-ot.h
+1
-1
src/test-ot-meta.cc
src/test-ot-meta.cc
+5
-5
test/api/Makefile.am
test/api/Makefile.am
+1
-1
test/api/test-ot-meta.c
test/api/test-ot-meta.c
+13
-13
未找到文件。
docs/harfbuzz-sections.txt
浏览文件 @
62932c14
...
...
@@ -608,9 +608,10 @@ hb_ot_math_get_glyph_assembly
</SECTION>
<SECTION>
<FILE>hb-ot-metadata</FILE>
hb_ot_metadata_reference_entry
hb_ot_metadata_t
<FILE>hb-ot-meta</FILE>
hb_ot_meta_t
hb_ot_meta_get_entries
hb_ot_meta_reference_entry
</SECTION>
<SECTION>
...
...
src/Makefile.am
浏览文件 @
62932c14
...
...
@@ -332,7 +332,7 @@ noinst_PROGRAMS = \
main
\
test
\
test-buffer-serialize
\
test-ot-meta
data
\
test-ot-meta
\
test-ot-name
\
test-gpos-size-params
\
test-gsub-would-substitute
\
...
...
@@ -351,9 +351,9 @@ test_buffer_serialize_SOURCES = test-buffer-serialize.cc
test_buffer_serialize_CPPFLAGS
=
$(HBCFLAGS)
test_buffer_serialize_LDADD
=
libharfbuzz.la
$(HBLIBS)
test_ot_meta
data_SOURCES
=
test-ot-metada
ta.cc
test_ot_meta
data
_CPPFLAGS
=
$(HBCFLAGS)
test_ot_meta
data
_LDADD
=
libharfbuzz.la
$(HBLIBS)
test_ot_meta
_SOURCES
=
test-ot-me
ta.cc
test_ot_meta_CPPFLAGS
=
$(HBCFLAGS)
test_ot_meta_LDADD
=
libharfbuzz.la
$(HBLIBS)
test_ot_name_SOURCES
=
test-ot-name.cc
test_ot_name_CPPFLAGS
=
$(HBCFLAGS)
...
...
src/Makefile.sources
浏览文件 @
62932c14
...
...
@@ -89,7 +89,7 @@ HB_BASE_sources = \
hb-ot-math.cc
\
hb-ot-maxp-table.hh
\
hb-ot-meta-table.hh
\
hb-ot-meta
data
.cc
\
hb-ot-meta.cc
\
hb-ot-metrics.cc
\
hb-ot-metrics.hh
\
hb-ot-name-language-static.hh
\
...
...
@@ -195,7 +195,7 @@ HB_BASE_headers = \
hb-ot-font.h
\
hb-ot-layout.h
\
hb-ot-math.h
\
hb-ot-meta
data
.h
\
hb-ot-meta.h
\
hb-ot-metrics.h
\
hb-ot-name.h
\
hb-ot-shape.h
\
...
...
src/harfbuzz.cc
浏览文件 @
62932c14
...
...
@@ -16,7 +16,7 @@
#include "hb-ot-layout.cc"
#include "hb-ot-map.cc"
#include "hb-ot-math.cc"
#include "hb-ot-meta
data
.cc"
#include "hb-ot-meta.cc"
#include "hb-ot-metrics.cc"
#include "hb-ot-name.cc"
#include "hb-ot-shape-complex-arabic.cc"
...
...
src/hb-ot-meta-table.hh
浏览文件 @
62932c14
...
...
@@ -78,15 +78,15 @@ struct meta
hb_blob_t
*
reference_entry
(
hb_tag_t
tag
)
const
{
return
table
->
dataMaps
.
lsearch
(
tag
,
Null
(
DataMap
)).
reference_entry
(
table
.
get_blob
());
}
unsigned
int
get_entries
(
unsigned
int
start_offset
,
unsigned
int
*
count
,
hb_ot_meta
data
_t
*
entries
)
const
unsigned
int
get_entries
(
unsigned
int
start_offset
,
unsigned
int
*
count
,
hb_ot_meta_t
*
entries
)
const
{
if
(
count
&&
*
count
)
{
hb_array_t
<
const
DataMap
>
array
=
table
->
dataMaps
.
sub_array
(
start_offset
,
count
);
for
(
unsigned
int
i
=
0
;
i
<
*
count
;
i
++
)
entries
[
i
]
=
(
hb_ot_meta
data
_t
)
array
[
i
].
get_tag
();
entries
[
i
]
=
(
hb_ot_meta_t
)
array
[
i
].
get_tag
();
}
return
table
->
dataMaps
.
len
;
}
...
...
src/hb-ot-meta
data
.cc
→
src/hb-ot-meta.cc
浏览文件 @
62932c14
...
...
@@ -29,8 +29,8 @@
#include "hb-ot-meta-table.hh"
/**
* SECTION:hb-ot-meta
data
* @title: hb-ot-meta
data
* SECTION:hb-ot-meta
* @title: hb-ot-meta
* @short_description: OpenType Metadata
* @include: hb-ot.h
*
...
...
@@ -38,7 +38,7 @@
**/
/**
* hb_ot_meta
data
_reference_entry:
* hb_ot_meta_reference_entry:
* @face: a face object
* @start_offset: iteration's start offset
* @entries_count:(inout) (allow-none): buffer size as input, filled size as output
...
...
@@ -49,18 +49,18 @@
* Since: REPLACEME
**/
unsigned
int
hb_ot_meta
data_get_entries
(
hb_face_t
*
face
,
unsigned
int
start_offset
,
unsigned
int
*
entries_count
,
/* IN/OUT. May be NULL. */
hb_ot_metada
ta_t
*
entries
/* OUT. May be NULL. */
)
hb_ot_meta
_get_entries
(
hb_face_t
*
face
,
unsigned
int
start_offset
,
unsigned
int
*
entries_count
,
/* IN/OUT. May be NULL. */
hb_ot_me
ta_t
*
entries
/* OUT. May be NULL. */
)
{
return
face
->
table
.
meta
->
get_entries
(
start_offset
,
entries_count
,
entries
);
}
/**
* hb_ot_meta
data
_reference_entry:
* hb_ot_meta_reference_entry:
* @face: a #hb_face_t object.
* @meta
data
_tag: tag of metadata you like to have.
* @meta_tag: tag of metadata you like to have.
*
* It fetches metadata entry of a given tag from a font.
*
...
...
@@ -69,9 +69,9 @@ hb_ot_metadata_get_entries (hb_face_t *face,
* Since: REPLACEME
**/
hb_blob_t
*
hb_ot_meta
data_reference_entry
(
hb_face_t
*
face
,
hb_ot_metadata_t
metada
ta_tag
)
hb_ot_meta
_reference_entry
(
hb_face_t
*
face
,
hb_ot_meta_t
me
ta_tag
)
{
return
face
->
table
.
meta
->
reference_entry
(
meta
data
_tag
);
return
face
->
table
.
meta
->
reference_entry
(
meta_tag
);
}
#endif
src/hb-ot-meta
data
.h
→
src/hb-ot-meta.h
浏览文件 @
62932c14
...
...
@@ -26,15 +26,15 @@
#error "Include <hb-ot.h> instead."
#endif
#ifndef HB_OT_META
DATA
_H
#define HB_OT_META
DATA
_H
#ifndef HB_OT_META_H
#define HB_OT_META_H
#include "hb.h"
HB_BEGIN_DECLS
/**
* hb_ot_meta
data
_t:
* hb_ot_meta_t:
*
* From https://docs.microsoft.com/en-us/typography/opentype/spec/meta
*
...
...
@@ -42,24 +42,24 @@ HB_BEGIN_DECLS
**/
typedef
enum
{
/*
HB_OT_META
DATA_APPL
= HB_TAG ('a','p','p','l'),
HB_OT_META
DATA_BILD
= HB_TAG ('b','i','l','d'),
HB_OT_META
_APPL
= HB_TAG ('a','p','p','l'),
HB_OT_META
_BILD
= HB_TAG ('b','i','l','d'),
*/
HB_OT_META
DATA
_DESIGN_LANGUAGES
=
HB_TAG
(
'd'
,
'l'
,
'n'
,
'g'
),
HB_OT_META
DATA_SUPPORTED_LANGUAGES
=
HB_TAG
(
's'
,
'l'
,
'n'
,
'g'
),
HB_OT_META_DESIGN_LANGUAGES
=
HB_TAG
(
'd'
,
'l'
,
'n'
,
'g'
),
HB_OT_META
_SUPPORTED_LANGUAGES
=
HB_TAG
(
's'
,
'l'
,
'n'
,
'g'
),
_HB_OT_META
DATA
_MAX_VALUE
=
HB_TAG_MAX_SIGNED
/*< skip >*/
}
hb_ot_meta
data
_t
;
_HB_OT_META_MAX_VALUE
=
HB_TAG_MAX_SIGNED
/*< skip >*/
}
hb_ot_meta_t
;
HB_EXTERN
unsigned
int
hb_ot_meta
data_get_entries
(
hb_face_t
*
face
,
unsigned
int
start_offset
,
unsigned
int
*
entries_count
,
/* IN/OUT. May be NULL. */
hb_ot_metada
ta_t
*
entries
/* OUT. May be NULL. */
);
hb_ot_meta
_get_entries
(
hb_face_t
*
face
,
unsigned
int
start_offset
,
unsigned
int
*
entries_count
,
/* IN/OUT. May be NULL. */
hb_ot_me
ta_t
*
entries
/* OUT. May be NULL. */
);
HB_EXTERN
hb_blob_t
*
hb_ot_meta
data_reference_entry
(
hb_face_t
*
face
,
hb_ot_metadata_t
metada
ta_tag
);
hb_ot_meta
_reference_entry
(
hb_face_t
*
face
,
hb_ot_meta_t
me
ta_tag
);
HB_END_DECLS
#endif
/* HB_OT_META
DATA
_H */
#endif
/* HB_OT_META_H */
src/hb-ot.h
浏览文件 @
62932c14
...
...
@@ -35,7 +35,7 @@
#include "hb-ot-font.h"
#include "hb-ot-layout.h"
#include "hb-ot-math.h"
#include "hb-ot-meta
data
.h"
#include "hb-ot-meta.h"
#include "hb-ot-metrics.h"
#include "hb-ot-name.h"
#include "hb-ot-shape.h"
...
...
src/test-ot-meta
data
.cc
→
src/test-ot-meta.cc
浏览文件 @
62932c14
...
...
@@ -48,14 +48,14 @@ main (int argc, char **argv)
unsigned
int
count
=
0
;
#ifndef HB_NO_META
count
=
hb_ot_meta
data
_get_entries
(
face
,
0
,
nullptr
,
nullptr
);
count
=
hb_ot_meta_get_entries
(
face
,
0
,
nullptr
,
nullptr
);
hb_ot_meta
data_t
*
tags
=
(
hb_ot_metada
ta_t
*
)
malloc
(
sizeof
(
hb_ot_metada
ta_t
)
*
count
);
hb_ot_meta
data
_get_entries
(
face
,
0
,
&
count
,
tags
);
hb_ot_meta
_t
*
tags
=
(
hb_ot_me
ta_t
*
)
malloc
(
sizeof
(
hb_ot_me
ta_t
)
*
count
);
hb_ot_meta_get_entries
(
face
,
0
,
&
count
,
tags
);
for
(
unsigned
i
=
0
;
i
<
count
;
++
i
)
{
hb_blob_t
*
entry
=
hb_ot_meta
data
_reference_entry
(
face
,
tags
[
i
]);
hb_blob_t
*
entry
=
hb_ot_meta_reference_entry
(
face
,
tags
[
i
]);
printf
(
"%c%c%c%c, size: %d: %.*s
\n
"
,
HB_UNTAG
(
tags
[
i
]),
hb_blob_get_length
(
entry
),
hb_blob_get_length
(
entry
),
hb_blob_get_data
(
entry
,
nullptr
));
...
...
test/api/Makefile.am
浏览文件 @
62932c14
...
...
@@ -84,7 +84,7 @@ TEST_PROGS += \
test-ot-color
\
test-ot-ligature-carets
\
test-ot-name
\
test-ot-meta
data
\
test-ot-meta
\
test-ot-metrics
\
test-ot-tag
\
test-ot-extents-cff
\
...
...
test/api/test-ot-meta
data
.c
→
test/api/test-ot-meta.c
浏览文件 @
62932c14
...
...
@@ -26,27 +26,27 @@
#include <hb-ot.h>
/* Unit tests for hb-ot-meta
data
.h */
/* Unit tests for hb-ot-meta.h */
static
void
test_ot_meta
data
_get_entries
(
void
)
test_ot_meta_get_entries
(
void
)
{
hb_face_t
*
face
=
hb_test_open_font_file
(
"fonts/meta.ttf"
);
hb_ot_meta
data
_t
entries
[
2
];
hb_ot_meta_t
entries
[
2
];
unsigned
int
entries_count
=
2
;
g_assert_cmpint
(
hb_ot_meta
data
_get_entries
(
face
,
0
,
&
entries_count
,
entries
),
==
,
5
);
g_assert_cmpint
(
hb_ot_meta_get_entries
(
face
,
0
,
&
entries_count
,
entries
),
==
,
5
);
g_assert_cmpint
(
entries_count
,
==
,
2
);
g_assert_cmpint
(
entries
[
0
],
==
,
HB_TAG
(
'a'
,
'p'
,
'p'
,
'l'
));
g_assert_cmpint
(
entries
[
1
],
==
,
HB_TAG
(
'b'
,
'i'
,
'l'
,
'd'
));
entries_count
=
1
;
g_assert_cmpint
(
hb_ot_meta
data
_get_entries
(
face
,
2
,
&
entries_count
,
entries
),
==
,
5
);
g_assert_cmpint
(
hb_ot_meta_get_entries
(
face
,
2
,
&
entries_count
,
entries
),
==
,
5
);
g_assert_cmpint
(
entries_count
,
==
,
1
);
g_assert_cmpint
(
entries
[
0
],
==
,
HB_TAG
(
'd'
,
'l'
,
'n'
,
'g'
));
entries_count
=
2
;
g_assert_cmpint
(
hb_ot_meta
data
_get_entries
(
face
,
4
,
&
entries_count
,
entries
),
==
,
5
);
g_assert_cmpint
(
hb_ot_meta_get_entries
(
face
,
4
,
&
entries_count
,
entries
),
==
,
5
);
g_assert_cmpint
(
entries_count
,
==
,
1
);
g_assert_cmpint
(
entries
[
0
],
==
,
HB_TAG
(
's'
,
'l'
,
'n'
,
'g'
));
...
...
@@ -54,20 +54,20 @@ test_ot_metadata_get_entries (void)
}
static
void
test_ot_meta
data
_reference_entry
(
void
)
test_ot_meta_reference_entry
(
void
)
{
hb_face_t
*
face
=
hb_test_open_font_file
(
"fonts/meta.ttf"
);
hb_blob_t
*
dlng
=
hb_ot_meta
data_reference_entry
(
face
,
HB_OT_METADA
TA_DESIGN_LANGUAGES
);
hb_blob_t
*
dlng
=
hb_ot_meta
_reference_entry
(
face
,
HB_OT_ME
TA_DESIGN_LANGUAGES
);
g_assert_cmpint
(
hb_blob_get_length
(
dlng
),
==
,
8
);
g_assert_cmpmem
(
hb_blob_get_data
(
dlng
,
NULL
),
8
,
"ar,de,fa"
,
8
);
hb_blob_destroy
(
dlng
);
hb_blob_t
*
fslf
=
hb_ot_meta
data_reference_entry
(
face
,
(
hb_ot_metada
ta_t
)
HB_TAG
(
'f'
,
's'
,
'l'
,
'f'
));
hb_blob_t
*
fslf
=
hb_ot_meta
_reference_entry
(
face
,
(
hb_ot_me
ta_t
)
HB_TAG
(
'f'
,
's'
,
'l'
,
'f'
));
g_assert_cmpint
(
hb_blob_get_length
(
fslf
),
==
,
12
);
hb_blob_destroy
(
fslf
);
hb_blob_t
*
nacl
=
hb_ot_meta
data_reference_entry
(
face
,
(
hb_ot_metada
ta_t
)
HB_TAG
(
'n'
,
'a'
,
'c'
,
'l'
));
hb_blob_t
*
nacl
=
hb_ot_meta
_reference_entry
(
face
,
(
hb_ot_me
ta_t
)
HB_TAG
(
'n'
,
'a'
,
'c'
,
'l'
));
g_assert_cmpint
(
hb_blob_get_length
(
nacl
),
==
,
0
);
hb_blob_destroy
(
nacl
);
hb_blob_t
*
slng
=
hb_ot_meta
data_reference_entry
(
face
,
HB_OT_METADA
TA_SUPPORTED_LANGUAGES
);
hb_blob_t
*
slng
=
hb_ot_meta
_reference_entry
(
face
,
HB_OT_ME
TA_SUPPORTED_LANGUAGES
);
g_assert_cmpint
(
hb_blob_get_length
(
slng
),
==
,
11
);
g_assert_cmpmem
(
hb_blob_get_data
(
slng
,
NULL
),
11
,
"ar,de,en,fa"
,
11
);
hb_blob_destroy
(
slng
);
...
...
@@ -78,7 +78,7 @@ int
main
(
int
argc
,
char
**
argv
)
{
hb_test_init
(
&
argc
,
&
argv
);
hb_test_add
(
test_ot_meta
data
_get_entries
);
hb_test_add
(
test_ot_meta
data
_reference_entry
);
hb_test_add
(
test_ot_meta_get_entries
);
hb_test_add
(
test_ot_meta_reference_entry
);
return
hb_test_run
();
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录