Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
f5f505b5
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
接近 2 年 前同步成功
通知
1
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看板
提交
f5f505b5
编写于
10月 09, 2018
作者:
M
Michiharu Ariza
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into cff-subset
上级
8b349040
4035158d
变更
24
隐藏空白更改
内联
并排
Showing
24 changed file
with
117 addition
and
93 deletion
+117
-93
CMakeLists.txt
CMakeLists.txt
+6
-1
src/Makefile.am
src/Makefile.am
+1
-1
src/hb-aat-layout-kerx-table.hh
src/hb-aat-layout-kerx-table.hh
+1
-1
src/hb-font.cc
src/hb-font.cc
+5
-5
src/hb-font.h
src/hb-font.h
+4
-4
src/hb-font.hh
src/hb-font.hh
+3
-3
src/hb-ft.cc
src/hb-ft.cc
+1
-1
src/hb-glib.cc
src/hb-glib.cc
+6
-9
src/hb-icu.cc
src/hb-icu.cc
+6
-9
src/hb-ot-font.cc
src/hb-ot-font.cc
+2
-2
src/hb-ot-shape-fallback.cc
src/hb-ot-shape-fallback.cc
+21
-21
src/hb-ucdn.cc
src/hb-ucdn.cc
+6
-9
src/hb.hh
src/hb.hh
+8
-2
test/api/test-collect-unicodes.c
test/api/test-collect-unicodes.c
+6
-3
test/api/test-set.c
test/api/test-set.c
+0
-4
test/api/test-shape.c
test/api/test-shape.c
+2
-2
test/api/test-subset-glyf.c
test/api/test-subset-glyf.c
+13
-6
test/api/test-subset-hdmx.c
test/api/test-subset-hdmx.c
+6
-2
test/api/test-subset-hmtx.c
test/api/test-subset-hmtx.c
+2
-1
test/api/test-subset-post.c
test/api/test-subset-post.c
+2
-1
test/api/test-subset-vmtx.c
test/api/test-subset-vmtx.c
+4
-2
test/api/test-subset.c
test/api/test-subset.c
+9
-3
test/shaping/Makefile.am
test/shaping/Makefile.am
+2
-0
test/subset/Makefile.am
test/subset/Makefile.am
+1
-1
未找到文件。
CMakeLists.txt
浏览文件 @
f5f505b5
...
...
@@ -574,7 +574,7 @@ if (HB_HAVE_GOBJECT)
endif
()
if
(
BUILD_SHARED_LIBS AND WIN32 AND NOT MINGW
)
add_definitions
(
"-DHB_
EXTERN=__declspec(dllexport) extern
"
)
add_definitions
(
"-DHB_
DLL_EXPORT
"
)
endif
()
# On Windows, g-ir-scanner requires a DLL build in order for it to work
...
...
@@ -772,6 +772,11 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
/cmake/harfbuzz
)
if
(
HB_BUILD_UTILS
)
if
(
WIN32 AND BUILD_SHARED_LIBS
)
install
(
TARGETS harfbuzz-subset
RUNTIME DESTINATION
${
CMAKE_INSTALL_BINDIR
}
)
endif
()
install
(
TARGETS hb-view
RUNTIME DESTINATION
${
CMAKE_INSTALL_BINDIR
}
)
...
...
src/Makefile.am
浏览文件 @
f5f505b5
...
...
@@ -13,7 +13,7 @@ TESTS =
check_PROGRAMS
=
# Convenience targets:
lib
:
$(BUILT_SOURCES) libharfbuzz.la
libharfbuzz-subset.la
lib
:
$(BUILT_SOURCES) libharfbuzz.la
libs
:
$(BUILT_SOURCES) $(lib_LTLIBRARIES)
fuzzing
:
$(BUILT_SOURCES) libharfbuzz-fuzzing.la libharfbuzz-subset-fuzzing.la
...
...
src/hb-aat-layout-kerx-table.hh
浏览文件 @
f5f505b5
...
...
@@ -212,7 +212,7 @@ struct KerxSubTableFormat6
struct
KerxTable
{
friend
kerx
;
friend
struct
kerx
;
inline
unsigned
int
get_size
(
void
)
const
{
return
length
;
}
inline
unsigned
int
get_type
(
void
)
const
{
return
coverage
&
SubtableType
;
}
...
...
src/hb-font.cc
浏览文件 @
f5f505b5
...
...
@@ -179,7 +179,7 @@ static void
hb_font_get_glyph_h_advances_default
(
hb_font_t
*
font
,
void
*
font_data
HB_UNUSED
,
unsigned
int
count
,
hb_codepoint_t
*
first_glyph
,
const
hb_codepoint_t
*
first_glyph
,
unsigned
int
glyph_stride
,
hb_position_t
*
first_advance
,
unsigned
int
advance_stride
,
...
...
@@ -211,7 +211,7 @@ static void
hb_font_get_glyph_v_advances_default
(
hb_font_t
*
font
,
void
*
font_data
HB_UNUSED
,
unsigned
int
count
,
hb_codepoint_t
*
first_glyph
,
const
hb_codepoint_t
*
first_glyph
,
unsigned
int
glyph_stride
,
hb_position_t
*
first_advance
,
unsigned
int
advance_stride
,
...
...
@@ -808,7 +808,7 @@ hb_font_get_glyph_v_advance (hb_font_t *font,
void
hb_font_get_glyph_h_advances
(
hb_font_t
*
font
,
unsigned
count
,
hb_codepoint_t
*
first_glyph
,
const
hb_codepoint_t
*
first_glyph
,
unsigned
glyph_stride
,
hb_position_t
*
first_advance
,
unsigned
advance_stride
)
...
...
@@ -826,7 +826,7 @@ hb_font_get_glyph_h_advances (hb_font_t* font,
void
hb_font_get_glyph_v_advances
(
hb_font_t
*
font
,
unsigned
count
,
hb_codepoint_t
*
first_glyph
,
const
hb_codepoint_t
*
first_glyph
,
unsigned
glyph_stride
,
hb_position_t
*
first_advance
,
unsigned
advance_stride
)
...
...
@@ -1053,7 +1053,7 @@ HB_EXTERN void
hb_font_get_glyph_advances_for_direction
(
hb_font_t
*
font
,
hb_direction_t
direction
,
unsigned
count
,
hb_codepoint_t
*
first_glyph
,
const
hb_codepoint_t
*
first_glyph
,
unsigned
glyph_stride
,
hb_position_t
*
first_advance
,
unsigned
advance_stride
)
...
...
src/hb-font.h
浏览文件 @
f5f505b5
...
...
@@ -134,7 +134,7 @@ typedef hb_font_get_glyph_advance_func_t hb_font_get_glyph_v_advance_func_t;
typedef
void
(
*
hb_font_get_glyph_advances_func_t
)
(
hb_font_t
*
font
,
void
*
font_data
,
unsigned
count
,
hb_codepoint_t
*
first_glyph
,
const
hb_codepoint_t
*
first_glyph
,
unsigned
glyph_stride
,
hb_position_t
*
first_advance
,
unsigned
advance_stride
,
...
...
@@ -424,14 +424,14 @@ hb_font_get_glyph_v_advance (hb_font_t *font,
HB_EXTERN
void
hb_font_get_glyph_h_advances
(
hb_font_t
*
font
,
unsigned
count
,
hb_codepoint_t
*
first_glyph
,
const
hb_codepoint_t
*
first_glyph
,
unsigned
glyph_stride
,
hb_position_t
*
first_advance
,
unsigned
advance_stride
);
HB_EXTERN
void
hb_font_get_glyph_v_advances
(
hb_font_t
*
font
,
unsigned
count
,
hb_codepoint_t
*
first_glyph
,
const
hb_codepoint_t
*
first_glyph
,
unsigned
glyph_stride
,
hb_position_t
*
first_advance
,
unsigned
advance_stride
);
...
...
@@ -487,7 +487,7 @@ HB_EXTERN void
hb_font_get_glyph_advances_for_direction
(
hb_font_t
*
font
,
hb_direction_t
direction
,
unsigned
count
,
hb_codepoint_t
*
first_glyph
,
const
hb_codepoint_t
*
first_glyph
,
unsigned
glyph_stride
,
hb_position_t
*
first_advance
,
unsigned
advance_stride
);
...
...
src/hb-font.hh
浏览文件 @
f5f505b5
...
...
@@ -237,7 +237,7 @@ struct hb_font_t
}
inline
void
get_glyph_h_advances
(
unsigned
int
count
,
hb_codepoint_t
*
first_glyph
,
const
hb_codepoint_t
*
first_glyph
,
unsigned
int
glyph_stride
,
hb_position_t
*
first_advance
,
unsigned
int
advance_stride
)
...
...
@@ -250,7 +250,7 @@ struct hb_font_t
}
inline
void
get_glyph_v_advances
(
unsigned
int
count
,
hb_codepoint_t
*
first_glyph
,
const
hb_codepoint_t
*
first_glyph
,
unsigned
int
glyph_stride
,
hb_position_t
*
first_advance
,
unsigned
int
advance_stride
)
...
...
@@ -378,7 +378,7 @@ struct hb_font_t
}
inline
void
get_glyph_advances_for_direction
(
hb_direction_t
direction
,
unsigned
count
,
hb_codepoint_t
*
first_glyph
,
const
hb_codepoint_t
*
first_glyph
,
unsigned
glyph_stride
,
hb_position_t
*
first_advance
,
unsigned
advance_stride
)
...
...
src/hb-ft.cc
浏览文件 @
f5f505b5
...
...
@@ -221,7 +221,7 @@ hb_ft_get_variation_glyph (hb_font_t *font HB_UNUSED,
static
void
hb_ft_get_glyph_h_advances
(
hb_font_t
*
font
,
void
*
font_data
,
unsigned
count
,
hb_codepoint_t
*
first_glyph
,
const
hb_codepoint_t
*
first_glyph
,
unsigned
glyph_stride
,
hb_position_t
*
first_advance
,
unsigned
advance_stride
,
...
...
src/hb-glib.cc
浏览文件 @
f5f505b5
...
...
@@ -30,7 +30,6 @@
#include "hb-glib.h"
#include "hb-unicode.hh"
#include "hb-machinery.hh"
...
...
@@ -202,8 +201,6 @@ hb_glib_unicode_combining_class (hb_unicode_funcs_t *ufuncs HB_UNUSED,
return
(
hb_unicode_combining_class_t
)
g_unichar_combining_class
(
unicode
);
}
#define hb_glib_unicode_eastasian_width nullptr
static
hb_unicode_general_category_t
hb_glib_unicode_general_category
(
hb_unicode_funcs_t
*
ufuncs
HB_UNUSED
,
hb_codepoint_t
unicode
,
...
...
@@ -328,8 +325,6 @@ hb_glib_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
return
ret
;
}
#define hb_glib_unicode_decompose_compatibility nullptr
#ifdef HB_USE_ATEXIT
static
void
free_static_glib_funcs
(
void
);
...
...
@@ -341,10 +336,12 @@ static struct hb_glib_unicode_funcs_lazy_loader_t : hb_unicode_funcs_lazy_loader
{
hb_unicode_funcs_t
*
funcs
=
hb_unicode_funcs_create
(
nullptr
);
#define HB_UNICODE_FUNC_IMPLEMENT(name) \
hb_unicode_funcs_set_##name##_func (funcs, hb_glib_unicode_##name, nullptr, nullptr);
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
#undef HB_UNICODE_FUNC_IMPLEMENT
hb_unicode_funcs_set_combining_class_func
(
funcs
,
hb_glib_unicode_combining_class
,
nullptr
,
nullptr
);
hb_unicode_funcs_set_general_category_func
(
funcs
,
hb_glib_unicode_general_category
,
nullptr
,
nullptr
);
hb_unicode_funcs_set_mirroring_func
(
funcs
,
hb_glib_unicode_mirroring
,
nullptr
,
nullptr
);
hb_unicode_funcs_set_script_func
(
funcs
,
hb_glib_unicode_script
,
nullptr
,
nullptr
);
hb_unicode_funcs_set_compose_func
(
funcs
,
hb_glib_unicode_compose
,
nullptr
,
nullptr
);
hb_unicode_funcs_set_decompose_func
(
funcs
,
hb_glib_unicode_decompose
,
nullptr
,
nullptr
);
hb_unicode_funcs_make_immutable
(
funcs
);
...
...
src/hb-icu.cc
浏览文件 @
f5f505b5
...
...
@@ -31,7 +31,6 @@
#include "hb-icu.h"
#include "hb-unicode.hh"
#include "hb-machinery.hh"
#include <unicode/uchar.h>
...
...
@@ -73,8 +72,6 @@ hb_icu_unicode_combining_class (hb_unicode_funcs_t *ufuncs HB_UNUSED,
return
(
hb_unicode_combining_class_t
)
u_getCombiningClass
(
unicode
);
}
#define hb_icu_unicode_eastasian_width nullptr
static
hb_unicode_general_category_t
hb_icu_unicode_general_category
(
hb_unicode_funcs_t
*
ufuncs
HB_UNUSED
,
hb_codepoint_t
unicode
,
...
...
@@ -292,8 +289,6 @@ hb_icu_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
return
ret
;
}
#define hb_icu_unicode_decompose_compatibility nullptr
#ifdef HB_USE_ATEXIT
static
void
free_static_icu_funcs
(
void
);
...
...
@@ -312,10 +307,12 @@ static struct hb_icu_unicode_funcs_lazy_loader_t : hb_unicode_funcs_lazy_loader_
hb_unicode_funcs_t
*
funcs
=
hb_unicode_funcs_create
(
nullptr
);
#define HB_UNICODE_FUNC_IMPLEMENT(name) \
hb_unicode_funcs_set_##name##_func (funcs, hb_icu_unicode_##name, user_data, nullptr);
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
#undef HB_UNICODE_FUNC_IMPLEMENT
hb_unicode_funcs_set_combining_class_func
(
funcs
,
hb_icu_unicode_combining_class
,
nullptr
,
nullptr
);
hb_unicode_funcs_set_general_category_func
(
funcs
,
hb_icu_unicode_general_category
,
nullptr
,
nullptr
);
hb_unicode_funcs_set_mirroring_func
(
funcs
,
hb_icu_unicode_mirroring
,
nullptr
,
nullptr
);
hb_unicode_funcs_set_script_func
(
funcs
,
hb_icu_unicode_script
,
nullptr
,
nullptr
);
hb_unicode_funcs_set_compose_func
(
funcs
,
hb_icu_unicode_compose
,
user_data
,
nullptr
);
hb_unicode_funcs_set_decompose_func
(
funcs
,
hb_icu_unicode_decompose
,
user_data
,
nullptr
);
hb_unicode_funcs_make_immutable
(
funcs
);
...
...
src/hb-ot-font.cc
浏览文件 @
f5f505b5
...
...
@@ -68,7 +68,7 @@ hb_ot_get_variation_glyph (hb_font_t *font HB_UNUSED,
static
void
hb_ot_get_glyph_h_advances
(
hb_font_t
*
font
,
void
*
font_data
,
unsigned
count
,
hb_codepoint_t
*
first_glyph
,
const
hb_codepoint_t
*
first_glyph
,
unsigned
glyph_stride
,
hb_position_t
*
first_advance
,
unsigned
advance_stride
,
...
...
@@ -88,7 +88,7 @@ hb_ot_get_glyph_h_advances (hb_font_t* font, void* font_data,
static
void
hb_ot_get_glyph_v_advances
(
hb_font_t
*
font
,
void
*
font_data
,
unsigned
count
,
hb_codepoint_t
*
first_glyph
,
const
hb_codepoint_t
*
first_glyph
,
unsigned
glyph_stride
,
hb_position_t
*
first_advance
,
unsigned
advance_stride
,
...
...
src/hb-ot-shape-fallback.cc
浏览文件 @
f5f505b5
...
...
@@ -435,33 +435,33 @@ _hb_ot_shape_fallback_mark_position (const hb_ot_shape_plan_t *plan,
}
struct
hb_ot_shape_fallback_kern_driver_t
{
hb_ot_shape_fallback_kern_driver_t
(
hb_font_t
*
font_
,
hb_buffer_t
*
buffer
)
:
font
(
font_
),
direction
(
buffer
->
props
.
direction
)
{}
hb_position_t
get_kerning
(
hb_codepoint_t
first
,
hb_codepoint_t
second
)
const
{
hb_position_t
kern
=
0
;
font
->
get_glyph_kerning_for_direction
(
first
,
second
,
direction
,
&
kern
,
&
kern
);
return
kern
;
}
hb_font_t
*
font
;
hb_direction_t
direction
;
};
/* Performs font-assisted kerning. */
void
_hb_ot_shape_fallback_kern
(
const
hb_ot_shape_plan_t
*
plan
,
hb_font_t
*
font
,
hb_buffer_t
*
buffer
)
{
struct
driver_t
{
driver_t
(
hb_font_t
*
font_
,
hb_buffer_t
*
buffer
)
:
font
(
font_
),
direction
(
buffer
->
props
.
direction
)
{}
hb_position_t
get_kerning
(
hb_codepoint_t
first
,
hb_codepoint_t
second
)
const
{
hb_position_t
kern
=
0
;
font
->
get_glyph_kerning_for_direction
(
first
,
second
,
direction
,
&
kern
,
&
kern
);
return
kern
;
}
hb_font_t
*
font
;
hb_direction_t
direction
;
}
driver
(
font
,
buffer
);
hb_kern_machine_t
<
driver_t
>
machine
(
driver
);
hb_ot_shape_fallback_kern_driver_t
driver
(
font
,
buffer
);
hb_kern_machine_t
<
hb_ot_shape_fallback_kern_driver_t
>
machine
(
driver
);
machine
.
kern
(
font
,
buffer
,
plan
->
kern_mask
);
}
...
...
src/hb-ucdn.cc
浏览文件 @
f5f505b5
...
...
@@ -16,7 +16,6 @@
#include "hb.hh"
#include "hb-unicode.hh"
#include "hb-machinery.hh"
#include "ucdn.h"
...
...
@@ -182,8 +181,6 @@ hb_ucdn_combining_class(hb_unicode_funcs_t *ufuncs HB_UNUSED,
return
(
hb_unicode_combining_class_t
)
ucdn_get_combining_class
(
unicode
);
}
#define hb_ucdn_eastasian_width nullptr
static
hb_unicode_general_category_t
hb_ucdn_general_category
(
hb_unicode_funcs_t
*
ufuncs
HB_UNUSED
,
hb_codepoint_t
unicode
,
...
...
@@ -224,8 +221,6 @@ hb_ucdn_decompose(hb_unicode_funcs_t *ufuncs HB_UNUSED,
return
ucdn_decompose
(
ab
,
a
,
b
);
}
#define hb_ucdn_decompose_compatibility nullptr
#ifdef HB_USE_ATEXIT
static
void
free_static_ucdn_funcs
(
void
);
...
...
@@ -237,10 +232,12 @@ static struct hb_ucdn_unicode_funcs_lazy_loader_t : hb_unicode_funcs_lazy_loader
{
hb_unicode_funcs_t
*
funcs
=
hb_unicode_funcs_create
(
nullptr
);
#define HB_UNICODE_FUNC_IMPLEMENT(name) \
hb_unicode_funcs_set_##name##_func (funcs, hb_ucdn_##name, nullptr, nullptr);
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
#undef HB_UNICODE_FUNC_IMPLEMENT
hb_unicode_funcs_set_combining_class_func
(
funcs
,
hb_ucdn_combining_class
,
nullptr
,
nullptr
);
hb_unicode_funcs_set_general_category_func
(
funcs
,
hb_ucdn_general_category
,
nullptr
,
nullptr
);
hb_unicode_funcs_set_mirroring_func
(
funcs
,
hb_ucdn_mirroring
,
nullptr
,
nullptr
);
hb_unicode_funcs_set_script_func
(
funcs
,
hb_ucdn_script
,
nullptr
,
nullptr
);
hb_unicode_funcs_set_compose_func
(
funcs
,
hb_ucdn_compose
,
nullptr
,
nullptr
);
hb_unicode_funcs_set_decompose_func
(
funcs
,
hb_ucdn_decompose
,
nullptr
,
nullptr
);
hb_unicode_funcs_make_immutable
(
funcs
);
...
...
src/hb.hh
浏览文件 @
f5f505b5
...
...
@@ -39,6 +39,10 @@
#define _POSIX_C_SOURCE 200809L
#endif
#if defined (_MSC_VER) && defined (HB_DLL_EXPORT)
#define HB_EXTERN __declspec (dllexport) extern
#endif
#include "hb.h"
#define HB_H_IN
#ifdef HAVE_OT
...
...
@@ -178,8 +182,10 @@ struct _hb_alignof
# if !defined(HB_NO_VISIBILITY) && !defined(__MINGW32__) && !defined(__CYGWIN__) && !defined(_MSC_VER) && !defined(__SUNPRO_CC)
# define HB_INTERNAL __attribute__((__visibility__("hidden")))
# elif defined(__MINGW32__)
/* We use -export-symbols on mingw32, since it does not support visibility
* attribute. */
/* We use -export-symbols on mingw32, since it does not support visibility attributes. */
# define HB_INTERNAL
# elif defined (_MSC_VER) && defined (HB_DLL_EXPORT)
/* We do not try to export internal symbols on Visual Studio */
# define HB_INTERNAL
#else
# define HB_INTERNAL
...
...
test/api/test-collect-unicodes.c
浏览文件 @
f5f505b5
...
...
@@ -32,10 +32,11 @@ test_collect_unicodes_format4 (void)
{
hb_face_t
*
face
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.abc.format4.ttf"
);
hb_set_t
*
codepoints
=
hb_set_create
();
hb_codepoint_t
cp
;
hb_face_collect_unicodes
(
face
,
codepoints
);
hb_codepoint_t
cp
=
HB_SET_VALUE_INVALID
;
cp
=
HB_SET_VALUE_INVALID
;
g_assert
(
hb_set_next
(
codepoints
,
&
cp
));
g_assert_cmpuint
(
0x61
,
==
,
cp
);
g_assert
(
hb_set_next
(
codepoints
,
&
cp
));
...
...
@@ -53,10 +54,11 @@ test_collect_unicodes_format12 (void)
{
hb_face_t
*
face
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.abc.format12.ttf"
);
hb_set_t
*
codepoints
=
hb_set_create
();
hb_codepoint_t
cp
;
hb_face_collect_unicodes
(
face
,
codepoints
);
hb_codepoint_t
cp
=
HB_SET_VALUE_INVALID
;
cp
=
HB_SET_VALUE_INVALID
;
g_assert
(
hb_set_next
(
codepoints
,
&
cp
));
g_assert_cmpuint
(
0x61
,
==
,
cp
);
g_assert
(
hb_set_next
(
codepoints
,
&
cp
));
...
...
@@ -74,10 +76,11 @@ test_collect_unicodes (void)
{
hb_face_t
*
face
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.abc.ttf"
);
hb_set_t
*
codepoints
=
hb_set_create
();
hb_codepoint_t
cp
;
hb_face_collect_unicodes
(
face
,
codepoints
);
hb_codepoint_t
cp
=
HB_SET_VALUE_INVALID
;
cp
=
HB_SET_VALUE_INVALID
;
g_assert
(
hb_set_next
(
codepoints
,
&
cp
));
g_assert_cmpuint
(
0x61
,
==
,
cp
);
g_assert
(
hb_set_next
(
codepoints
,
&
cp
));
...
...
test/api/test-set.c
浏览文件 @
f5f505b5
...
...
@@ -381,10 +381,6 @@ test_set_empty (void)
test_empty
(
b
);
hb_set_invert
(
b
);
test_empty
(
b
);
g_assert
(
!
hb_set_allocation_successful
(
b
));
hb_set_clear
(
b
);
...
...
test/api/test-shape.c
浏览文件 @
f5f505b5
...
...
@@ -55,7 +55,7 @@ glyph_h_advance_func (hb_font_t *font HB_UNUSED, void *font_data HB_UNUSED,
static
hb_bool_t
glyph_func
(
hb_font_t
*
font
HB_UNUSED
,
void
*
font_data
HB_UNUSED
,
hb_codepoint_t
unicode
,
hb_codepoint_t
variation_selector
HB_UNUSED
,
hb_codepoint_t
unicode
,
hb_codepoint_t
*
glyph
,
void
*
user_data
HB_UNUSED
)
{
...
...
@@ -101,7 +101,7 @@ test_shape (void)
ffuncs
=
hb_font_funcs_create
();
hb_font_funcs_set_glyph_h_advance_func
(
ffuncs
,
glyph_h_advance_func
,
NULL
,
NULL
);
hb_font_funcs_set_glyph_func
(
ffuncs
,
glyph_func
,
malloc
(
10
),
free
);
hb_font_funcs_set_
nominal_
glyph_func
(
ffuncs
,
glyph_func
,
malloc
(
10
),
free
);
hb_font_funcs_set_glyph_h_kerning_func
(
ffuncs
,
glyph_h_kerning_func
,
NULL
,
NULL
);
hb_font_set_funcs
(
font
,
ffuncs
,
NULL
,
NULL
);
hb_font_funcs_destroy
(
ffuncs
);
...
...
test/api/test-subset-glyf.c
浏览文件 @
f5f505b5
...
...
@@ -105,16 +105,18 @@ test_subset_glyf_with_gsub (void)
{
hb_face_t
*
face_fil
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.gsub.fil.ttf"
);
hb_face_t
*
face_fi
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.gsub.fi.ttf"
);
hb_subset_input_t
*
input
;
hb_face_t
*
face_subset
;
hb_set_t
*
codepoints
=
hb_set_create
();
hb_set_add
(
codepoints
,
102
);
// f
hb_set_add
(
codepoints
,
105
);
// i
hb_subset_input_t
*
input
=
hb_subset_test_create_input
(
codepoints
);
input
=
hb_subset_test_create_input
(
codepoints
);
hb_set_destroy
(
codepoints
);
hb_subset_input_set_drop_layout
(
input
,
false
);
hb_face_t
*
face_subset
=
hb_subset_test_create_subset
(
face_fil
,
input
);
face_subset
=
hb_subset_test_create_subset
(
face_fil
,
input
);
hb_subset_test_check
(
face_fi
,
face_subset
,
HB_TAG
(
'g'
,
'l'
,
'y'
,
'f'
));
hb_subset_test_check
(
face_fi
,
face_subset
,
HB_TAG
(
'l'
,
'o'
,
'c'
,
'a'
));
...
...
@@ -130,16 +132,18 @@ test_subset_glyf_without_gsub (void)
{
hb_face_t
*
face_fil
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.gsub.fil.ttf"
);
hb_face_t
*
face_fi
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.nogsub.fi.ttf"
);
hb_subset_input_t
*
input
;
hb_face_t
*
face_subset
;
hb_set_t
*
codepoints
=
hb_set_create
();
hb_set_add
(
codepoints
,
102
);
// f
hb_set_add
(
codepoints
,
105
);
// i
hb_subset_input_t
*
input
=
hb_subset_test_create_input
(
codepoints
);
input
=
hb_subset_test_create_input
(
codepoints
);
hb_set_destroy
(
codepoints
);
hb_subset_input_set_drop_layout
(
input
,
true
);
hb_face_t
*
face_subset
=
hb_subset_test_create_subset
(
face_fil
,
input
);
face_subset
=
hb_subset_test_create_subset
(
face_fil
,
input
);
hb_subset_test_check
(
face_fi
,
face_subset
,
HB_TAG
(
'g'
,
'l'
,
'y'
,
'f'
));
hb_subset_test_check
(
face_fi
,
face_subset
,
HB_TAG
(
'l'
,
'o'
,
'c'
,
'a'
));
...
...
@@ -233,16 +237,19 @@ test_subset_glyf_strip_hints_invalid (void)
'3'
,
'@'
,
'_'
,
'%'
,
'&'
,
')'
,
'*'
,
'$'
,
'!'
};
unsigned
int
i
;
hb_subset_input_t
*
input
;
hb_face_t
*
face_subset
;
for
(
i
=
0
;
i
<
sizeof
(
text
)
/
sizeof
(
hb_codepoint_t
);
i
++
)
{
hb_set_add
(
codepoints
,
text
[
i
]);
}
hb_subset_input_t
*
input
=
hb_subset_test_create_input
(
codepoints
);
input
=
hb_subset_test_create_input
(
codepoints
);
hb_subset_input_set_drop_hints
(
input
,
true
);
hb_set_destroy
(
codepoints
);
hb_face_t
*
face_subset
=
hb_subset_test_create_subset
(
face
,
input
);
face_subset
=
hb_subset_test_create_subset
(
face
,
input
);
g_assert
(
face_subset
);
g_assert
(
face_subset
==
hb_face_get_empty
());
...
...
test/api/test-subset-hdmx.c
浏览文件 @
f5f505b5
...
...
@@ -76,11 +76,13 @@ test_subset_hdmx_invalid (void)
hb_subset_input_t
*
input
=
hb_subset_input_create_or_fail
();
hb_set_t
*
codepoints
=
hb_subset_input_unicode_set
(
input
);
hb_face_t
*
subset
;
hb_set_add
(
codepoints
,
'a'
);
hb_set_add
(
codepoints
,
'b'
);
hb_set_add
(
codepoints
,
'c'
);
hb_face_t
*
subset
=
hb_subset
(
face
,
input
);
subset
=
hb_subset
(
face
,
input
);
g_assert
(
subset
);
g_assert
(
subset
==
hb_face_get_empty
());
...
...
@@ -96,11 +98,13 @@ test_subset_hdmx_fails_sanitize (void)
hb_subset_input_t
*
input
=
hb_subset_input_create_or_fail
();
hb_set_t
*
codepoints
=
hb_subset_input_unicode_set
(
input
);
hb_face_t
*
subset
;
hb_set_add
(
codepoints
,
'a'
);
hb_set_add
(
codepoints
,
'b'
);
hb_set_add
(
codepoints
,
'c'
);
hb_face_t
*
subset
=
hb_subset
(
face
,
input
);
subset
=
hb_subset
(
face
,
input
);
g_assert
(
subset
);
g_assert
(
subset
==
hb_face_get_empty
());
...
...
test/api/test-subset-hmtx.c
浏览文件 @
f5f505b5
...
...
@@ -154,6 +154,7 @@ static void
test_subset_invalid_hmtx
(
void
)
{
hb_face_t
*
face
=
hb_subset_test_open_font
(
"fonts/crash-e4e0bb1458a91b692eba492c907ae1f94e635480"
);
hb_face_t
*
subset
;
hb_subset_input_t
*
input
=
hb_subset_input_create_or_fail
();
hb_set_t
*
codepoints
=
hb_subset_input_unicode_set
(
input
);
...
...
@@ -161,7 +162,7 @@ test_subset_invalid_hmtx (void)
hb_set_add
(
codepoints
,
'b'
);
hb_set_add
(
codepoints
,
'c'
);
hb_face_t
*
subset
=
hb_subset
(
face
,
input
);
subset
=
hb_subset
(
face
,
input
);
g_assert
(
subset
);
g_assert
(
subset
==
hb_face_get_empty
());
...
...
test/api/test-subset-post.c
浏览文件 @
f5f505b5
...
...
@@ -34,11 +34,12 @@ test_post_drops_glyph_names (void)
{
hb_face_t
*
face_full
=
hb_subset_test_open_font
(
"fonts/Mplus1p-Regular.660E,6975,73E0,5EA6,8F38,6E05.ttf"
);
hb_face_t
*
face_subset
=
hb_subset_test_open_font
(
"fonts/Mplus1p-Regular.660E.ttf"
);
hb_face_t
*
face_full_subset
;
hb_set_t
*
codepoints
=
hb_set_create
();
hb_set_add
(
codepoints
,
0x660E
);
hb_face_t
*
face_full_subset
=
hb_subset_test_create_subset
(
face_full
,
hb_subset_test_create_input
(
codepoints
));
face_full_subset
=
hb_subset_test_create_subset
(
face_full
,
hb_subset_test_create_input
(
codepoints
));
hb_set_destroy
(
codepoints
);
hb_subset_test_check
(
face_subset
,
face_full_subset
,
HB_TAG
(
'p'
,
'o'
,
's'
,
't'
));
...
...
test/api/test-subset-vmtx.c
浏览文件 @
f5f505b5
...
...
@@ -48,11 +48,12 @@ test_subset_vmtx_simple_subset (void)
{
hb_face_t
*
face_full
=
hb_subset_test_open_font
(
"fonts/Mplus1p-Regular.660E,6975,73E0,5EA6,8F38,6E05.ttf"
);
hb_face_t
*
face_subset
=
hb_subset_test_open_font
(
"fonts/Mplus1p-Regular.660E.ttf"
);
hb_face_t
*
face_full_subset
;
hb_set_t
*
codepoints
=
hb_set_create
();
hb_set_add
(
codepoints
,
0x660E
);
hb_face_t
*
face_full_subset
=
hb_subset_test_create_subset
(
face_full
,
hb_subset_test_create_input
(
codepoints
));
face_full_subset
=
hb_subset_test_create_subset
(
face_full
,
hb_subset_test_create_input
(
codepoints
));
hb_set_destroy
(
codepoints
);
check_num_vmetrics
(
face_full_subset
,
1
);
/* nothing has same width */
...
...
@@ -67,6 +68,7 @@ static void
test_subset_vmtx_noop
(
void
)
{
hb_face_t
*
face_full
=
hb_subset_test_open_font
(
"fonts/Mplus1p-Regular.660E,6975,73E0,5EA6,8F38,6E05.ttf"
);
hb_face_t
*
face_full_subset
;
hb_set_t
*
codepoints
=
hb_set_create
();
hb_set_add
(
codepoints
,
0x660E
);
...
...
@@ -75,7 +77,7 @@ test_subset_vmtx_noop (void)
hb_set_add
(
codepoints
,
0x5EA6
);
hb_set_add
(
codepoints
,
0x8F38
);
hb_set_add
(
codepoints
,
0x6E05
);
hb_face_t
*
face_full_subset
=
hb_subset_test_create_subset
(
face_full
,
hb_subset_test_create_input
(
codepoints
));
face_full_subset
=
hb_subset_test_create_subset
(
face_full
,
hb_subset_test_create_input
(
codepoints
));
hb_set_destroy
(
codepoints
);
check_num_vmetrics
(
face_full_subset
,
1
);
/* all have the same width */
...
...
test/api/test-subset.c
浏览文件 @
f5f505b5
...
...
@@ -36,11 +36,13 @@ test_subset_32_tables (void)
hb_subset_input_t
*
input
=
hb_subset_input_create_or_fail
();
hb_set_t
*
codepoints
=
hb_subset_input_unicode_set
(
input
);
hb_face_t
*
subset
;
hb_set_add
(
codepoints
,
'a'
);
hb_set_add
(
codepoints
,
'b'
);
hb_set_add
(
codepoints
,
'c'
);
hb_face_t
*
subset
=
hb_subset
(
face
,
input
);
subset
=
hb_subset
(
face
,
input
);
g_assert
(
subset
);
g_assert
(
subset
!=
hb_face_get_empty
());
...
...
@@ -56,11 +58,13 @@ test_subset_no_inf_loop (void)
hb_subset_input_t
*
input
=
hb_subset_input_create_or_fail
();
hb_set_t
*
codepoints
=
hb_subset_input_unicode_set
(
input
);
hb_face_t
*
subset
;
hb_set_add
(
codepoints
,
'a'
);
hb_set_add
(
codepoints
,
'b'
);
hb_set_add
(
codepoints
,
'c'
);
hb_face_t
*
subset
=
hb_subset
(
face
,
input
);
subset
=
hb_subset
(
face
,
input
);
g_assert
(
subset
);
g_assert
(
subset
==
hb_face_get_empty
());
...
...
@@ -76,11 +80,13 @@ test_subset_crash (void)
hb_subset_input_t
*
input
=
hb_subset_input_create_or_fail
();
hb_set_t
*
codepoints
=
hb_subset_input_unicode_set
(
input
);
hb_face_t
*
subset
;
hb_set_add
(
codepoints
,
'a'
);
hb_set_add
(
codepoints
,
'b'
);
hb_set_add
(
codepoints
,
'c'
);
hb_face_t
*
subset
=
hb_subset
(
face
,
input
);
subset
=
hb_subset
(
face
,
input
);
g_assert
(
subset
);
g_assert
(
subset
==
hb_face_get_empty
());
...
...
test/shaping/Makefile.am
浏览文件 @
f5f505b5
...
...
@@ -8,6 +8,8 @@ SUBDIRS = data
# Convenience targets:
lib
:
@
$(MAKE)
$(AM_MAKEFLAGS)
-C
$(top_builddir)
/src lib
libs
:
@
$(MAKE)
$(AM_MAKEFLAGS)
-C
$(top_builddir)
/src libs
EXTRA_DIST
+=
\
README.md
\
...
...
test/subset/Makefile.am
浏览文件 @
f5f505b5
...
...
@@ -7,7 +7,7 @@ SUBDIRS = data
# Convenience targets:
lib
:
@
$(MAKE)
$(AM_MAKEFLAGS)
-C
$(top_builddir)
/src lib
@
$(MAKE)
$(AM_MAKEFLAGS)
-C
$(top_builddir)
/src lib
s
EXTRA_DIST
+=
\
CMakeLists.txt
\
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录