Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
a12dd6f7
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
未验证
提交
a12dd6f7
编写于
3月 14, 2018
作者:
E
Ebrahim Byagowi
提交者:
GitHub
3月 14, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #877 from fanc999/master.msvc
Fix CMake builds on Windows, MSVC in particular
上级
28f25f32
7c43adab
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
98 addition
and
39 deletion
+98
-39
CMakeLists.txt
CMakeLists.txt
+18
-5
configure.ac
configure.ac
+8
-1
src/hb-private.hh
src/hb-private.hh
+13
-0
test/api/CMakeLists.txt
test/api/CMakeLists.txt
+6
-1
test/api/hb-subset-test.h
test/api/hb-subset-test.h
+15
-2
test/api/test-subset-cmap.c
test/api/test-subset-cmap.c
+4
-4
test/api/test-subset-glyf.c
test/api/test-subset-glyf.c
+14
-9
test/api/test-subset-hdmx.c
test/api/test-subset-hdmx.c
+4
-4
test/api/test-subset-hmtx.c
test/api/test-subset-hmtx.c
+10
-7
test/api/test-subset-os2.c
test/api/test-subset-os2.c
+2
-2
test/fuzzing/CMakeLists.txt
test/fuzzing/CMakeLists.txt
+1
-1
test/shaping/CMakeLists.txt
test/shaping/CMakeLists.txt
+2
-2
test/subset/CMakeLists.txt
test/subset/CMakeLists.txt
+1
-1
未找到文件。
CMakeLists.txt
浏览文件 @
a12dd6f7
...
@@ -90,6 +90,8 @@ include_directories(AFTER
...
@@ -90,6 +90,8 @@ include_directories(AFTER
add_definitions
(
-DHAVE_OT
)
add_definitions
(
-DHAVE_OT
)
add_definitions
(
-DHAVE_FALLBACK
)
add_definitions
(
-DHAVE_FALLBACK
)
# We need PYTHON_EXECUTABLE to be set for running the tests...
include
(
FindPythonInterp
)
## Functions and headers
## Functions and headers
include
(
CheckFunctionExists
)
include
(
CheckFunctionExists
)
...
@@ -103,7 +105,10 @@ macro (check_funcs) # Similar to AC_CHECK_FUNCS of autotools
...
@@ -103,7 +105,10 @@ macro (check_funcs) # Similar to AC_CHECK_FUNCS of autotools
endif
()
endif
()
endforeach
()
endforeach
()
endmacro
()
endmacro
()
check_funcs
(
atexit mprotect sysconf getpagesize mmap isatty newlocale strtod_l
)
if
(
UNIX
)
list
(
APPEND CMAKE_REQUIRED_LIBRARIES m
)
endif
()
check_funcs
(
atexit mprotect sysconf getpagesize mmap isatty newlocale strtod_l round
)
check_include_file
(
unistd.h HAVE_UNISTD_H
)
check_include_file
(
unistd.h HAVE_UNISTD_H
)
if
(
${
HAVE_UNISTD_H
}
)
if
(
${
HAVE_UNISTD_H
}
)
add_definitions
(
-DHAVE_UNISTD_H
)
add_definitions
(
-DHAVE_UNISTD_H
)
...
@@ -116,6 +121,10 @@ check_include_file(xlocale.h HAVE_XLOCALE_H)
...
@@ -116,6 +121,10 @@ check_include_file(xlocale.h HAVE_XLOCALE_H)
if
(
${
HAVE_XLOCALE_H
}
)
if
(
${
HAVE_XLOCALE_H
}
)
add_definitions
(
-DHAVE_XLOCALE_H
)
add_definitions
(
-DHAVE_XLOCALE_H
)
endif
()
endif
()
check_include_file
(
stdbool.h HAVE_STDBOOL_H
)
if
(
${
HAVE_STDBOOL_H
}
)
add_definitions
(
-DHAVE_STDBOOL_H
)
endif
()
if
(
MSVC
)
if
(
MSVC
)
...
@@ -385,7 +394,6 @@ if (WIN32 AND HB_HAVE_DIRECTWRITE)
...
@@ -385,7 +394,6 @@ if (WIN32 AND HB_HAVE_DIRECTWRITE)
endif
()
endif
()
if
(
HB_HAVE_GOBJECT
)
if
(
HB_HAVE_GOBJECT
)
include
(
FindPythonInterp
)
include
(
FindPerl
)
include
(
FindPerl
)
# Use the hints from glib-2.0.pc to find glib-mkenums
# Use the hints from glib-2.0.pc to find glib-mkenums
...
@@ -638,6 +646,11 @@ if (HB_HAVE_INTROSPECTION)
...
@@ -638,6 +646,11 @@ if (HB_HAVE_INTROSPECTION)
endif
()
endif
()
endforeach
()
endforeach
()
file
(
REMOVE
${
CMAKE_CURRENT_BINARY_DIR
}
/src/hb_gir_list
)
foreach
(
s
${
introspected_sources
}
)
file
(
APPEND
${
CMAKE_CURRENT_BINARY_DIR
}
/src/hb_gir_list
"
${
s
}
\n
"
)
endforeach
()
# Finally, build the introspection files...
# Finally, build the introspection files...
add_custom_command
(
add_custom_command
(
TARGET harfbuzz-gobject
TARGET harfbuzz-gobject
...
@@ -667,9 +680,9 @@ if (HB_HAVE_INTROSPECTION)
...
@@ -667,9 +680,9 @@ if (HB_HAVE_INTROSPECTION)
--library=harfbuzz
--library=harfbuzz
-L
${
hb_libpath
}
-L
${
hb_libpath
}
${
extra_libs
}
${
extra_libs
}
${
introspected_sources
}
--filelist
${
CMAKE_CURRENT_BINARY_DIR
}
/src/hb_gir_list
-o
${
hb_libpath
}
/HarfBuzz-0.0.gir
-o
${
hb_libpath
}
/HarfBuzz-0.0.gir
DEPENDS harfbuzz-gobject harfbuzz
DEPENDS harfbuzz-gobject harfbuzz
${
CMAKE_CURRENT_BINARY_DIR
}
/src/hb_gir_list
)
)
add_custom_command
(
add_custom_command
(
...
@@ -749,7 +762,7 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
...
@@ -749,7 +762,7 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
install
(
TARGETS hb-view
install
(
TARGETS hb-view
RUNTIME DESTINATION
${
CMAKE_INSTALL_BINDIR
}
RUNTIME DESTINATION
${
CMAKE_INSTALL_BINDIR
}
)
)
install
(
TARGETS hb-
view
install
(
TARGETS hb-
subset
RUNTIME DESTINATION
${
CMAKE_INSTALL_BINDIR
}
RUNTIME DESTINATION
${
CMAKE_INSTALL_BINDIR
}
)
)
...
...
configure.ac
浏览文件 @
a12dd6f7
...
@@ -78,8 +78,15 @@ GTK_DOC_CHECK([1.15],[--flavour no-tmpl])
...
@@ -78,8 +78,15 @@ GTK_DOC_CHECK([1.15],[--flavour no-tmpl])
])
])
# Functions, and headers
# Functions, and headers
AC_CHECK_FUNCS(atexit mprotect sysconf getpagesize mmap isatty newlocale strtod_l setlinebuf)
AC_CHECK_FUNCS(atexit mprotect sysconf getpagesize mmap isatty newlocale strtod_l setlinebuf)
AC_CHECK_HEADERS(unistd.h sys/mman.h xlocale.h)
save_libs="$LIBS"
LIBS="$LIBS -lm"
AC_CHECK_FUNCS([round], ,[AC_CHECK_DECLS([round], , ,[#include <math.h>])])
LIBS="$save_libs"
AC_CHECK_HEADERS(unistd.h sys/mman.h xlocale.h stdbool.h)
# Compiler flags
# Compiler flags
AC_CANONICAL_HOST
AC_CANONICAL_HOST
...
...
src/hb-private.hh
浏览文件 @
a12dd6f7
...
@@ -1070,4 +1070,17 @@ struct hb_string_t
...
@@ -1070,4 +1070,17 @@ struct hb_string_t
};
};
/* fallback for round() */
#if !defined (HAVE_ROUND) && !defined (HAVE_DECL_ROUND)
static
inline
double
round
(
double
x
)
{
if
(
x
>=
0
)
return
floor
(
x
+
0.5
);
else
return
ceil
(
x
-
0.5
);
}
#endif
#endif
/* HB_PRIVATE_HH */
#endif
/* HB_PRIVATE_HH */
test/api/CMakeLists.txt
浏览文件 @
a12dd6f7
...
@@ -21,7 +21,12 @@ if (HB_HAVE_GLIB)
...
@@ -21,7 +21,12 @@ if (HB_HAVE_GLIB)
message
(
FATAL_ERROR
"No source file found for test
${
test_name
}
"
)
message
(
FATAL_ERROR
"No source file found for test
${
test_name
}
"
)
endif
()
endif
()
target_link_libraries
(
${
test_name
}
harfbuzz harfbuzz-subset
)
target_link_libraries
(
${
test_name
}
harfbuzz harfbuzz-subset
)
add_test
(
${
test_name
}
${
test_name
}
)
if
(
WIN32
)
set_property
(
TARGET
${
test_name
}
PROPERTY RUNTIME_OUTPUT_DIRECTORY
${
CMAKE_BINARY_DIR
}
)
add_test
(
NAME
${
test_name
}
COMMAND
${
test_name
}
)
else
(
WIN32
)
add_test
(
${
test_name
}
${
test_name
}
)
endif
(
WIN32
)
endforeach
()
endforeach
()
set_tests_properties
(
${
TEST_PROGS
}
PROPERTIES ENVIRONMENT
set_tests_properties
(
${
TEST_PROGS
}
PROPERTIES ENVIRONMENT
"G_TEST_SRCDIR=
${
CMAKE_CURRENT_SOURCE_DIR
}
;G_TEST_BUILDDIR=
${
CMAKE_CURRENT_BINARY_DIR
}
"
"G_TEST_SRCDIR=
${
CMAKE_CURRENT_SOURCE_DIR
}
;G_TEST_BUILDDIR=
${
CMAKE_CURRENT_BINARY_DIR
}
"
...
...
test/api/hb-subset-test.h
浏览文件 @
a12dd6f7
...
@@ -32,6 +32,18 @@
...
@@ -32,6 +32,18 @@
#include "hb-test.h"
#include "hb-test.h"
#include "hb-subset.h"
#include "hb-subset.h"
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#else
typedef
short
bool
;
# ifndef true
# define true 1
# endif
# ifndef false
# define false 0
# endif
#endif
HB_BEGIN_DECLS
HB_BEGIN_DECLS
...
@@ -122,9 +134,10 @@ hb_subset_test_check (hb_face_t *expected,
...
@@ -122,9 +134,10 @@ hb_subset_test_check (hb_face_t *expected,
hb_face_t
*
actual
,
hb_face_t
*
actual
,
hb_tag_t
table
)
hb_tag_t
table
)
{
{
hb_blob_t
*
expected_blob
,
*
actual_blob
;
fprintf
(
stderr
,
"compare %c%c%c%c
\n
"
,
HB_UNTAG
(
table
));
fprintf
(
stderr
,
"compare %c%c%c%c
\n
"
,
HB_UNTAG
(
table
));
hb_blob_t
*
expected_blob
=
hb_face_reference_table
(
expected
,
table
);
expected_blob
=
hb_face_reference_table
(
expected
,
table
);
hb_blob_t
*
actual_blob
=
hb_face_reference_table
(
actual
,
table
);
actual_blob
=
hb_face_reference_table
(
actual
,
table
);
hb_test_assert_blobs_equal
(
expected_blob
,
actual_blob
);
hb_test_assert_blobs_equal
(
expected_blob
,
actual_blob
);
hb_blob_destroy
(
expected_blob
);
hb_blob_destroy
(
expected_blob
);
hb_blob_destroy
(
actual_blob
);
hb_blob_destroy
(
actual_blob
);
...
...
test/api/test-subset-cmap.c
浏览文件 @
a12dd6f7
...
@@ -24,8 +24,6 @@
...
@@ -24,8 +24,6 @@
* Google Author(s): Roderick Sheeter
* Google Author(s): Roderick Sheeter
*/
*/
#include <stdbool.h>
#include "hb-test.h"
#include "hb-test.h"
#include "hb-subset-test.h"
#include "hb-subset-test.h"
...
@@ -38,9 +36,10 @@ test_subset_cmap (void)
...
@@ -38,9 +36,10 @@ test_subset_cmap (void)
hb_face_t
*
face_ac
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.ac.cmap-format12-only.ttf"
);
hb_face_t
*
face_ac
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.ac.cmap-format12-only.ttf"
);
hb_set_t
*
codepoints
=
hb_set_create
();
hb_set_t
*
codepoints
=
hb_set_create
();
hb_face_t
*
face_abc_subset
;
hb_set_add
(
codepoints
,
97
);
hb_set_add
(
codepoints
,
97
);
hb_set_add
(
codepoints
,
99
);
hb_set_add
(
codepoints
,
99
);
hb_face_t
*
face_abc_subset
=
hb_subset_test_create_subset
(
face_abc
,
hb_subset_test_create_input
(
codepoints
));
face_abc_subset
=
hb_subset_test_create_subset
(
face_abc
,
hb_subset_test_create_input
(
codepoints
));
hb_set_destroy
(
codepoints
);
hb_set_destroy
(
codepoints
);
hb_subset_test_check
(
face_ac
,
face_abc_subset
,
HB_TAG
(
'c'
,
'm'
,
'a'
,
'p'
));
hb_subset_test_check
(
face_ac
,
face_abc_subset
,
HB_TAG
(
'c'
,
'm'
,
'a'
,
'p'
));
...
@@ -56,10 +55,11 @@ test_subset_cmap_noop (void)
...
@@ -56,10 +55,11 @@ test_subset_cmap_noop (void)
hb_face_t
*
face_abc
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.abc.cmap-format12-only.ttf"
);
hb_face_t
*
face_abc
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.abc.cmap-format12-only.ttf"
);
hb_set_t
*
codepoints
=
hb_set_create
();
hb_set_t
*
codepoints
=
hb_set_create
();
hb_face_t
*
face_abc_subset
;
hb_set_add
(
codepoints
,
97
);
hb_set_add
(
codepoints
,
97
);
hb_set_add
(
codepoints
,
98
);
hb_set_add
(
codepoints
,
98
);
hb_set_add
(
codepoints
,
99
);
hb_set_add
(
codepoints
,
99
);
hb_face_t
*
face_abc_subset
=
hb_subset_test_create_subset
(
face_abc
,
hb_subset_test_create_input
(
codepoints
));
face_abc_subset
=
hb_subset_test_create_subset
(
face_abc
,
hb_subset_test_create_input
(
codepoints
));
hb_set_destroy
(
codepoints
);
hb_set_destroy
(
codepoints
);
hb_subset_test_check
(
face_abc
,
face_abc_subset
,
HB_TAG
(
'c'
,
'm'
,
'a'
,
'p'
));
hb_subset_test_check
(
face_abc
,
face_abc_subset
,
HB_TAG
(
'c'
,
'm'
,
'a'
,
'p'
));
...
...
test/api/test-subset-glyf.c
浏览文件 @
a12dd6f7
...
@@ -24,8 +24,6 @@
...
@@ -24,8 +24,6 @@
* Google Author(s): Garret Rieger
* Google Author(s): Garret Rieger
*/
*/
#include <stdbool.h>
#include "hb-test.h"
#include "hb-test.h"
#include "hb-subset-test.h"
#include "hb-subset-test.h"
...
@@ -66,9 +64,10 @@ test_subset_glyf (void)
...
@@ -66,9 +64,10 @@ test_subset_glyf (void)
hb_face_t
*
face_ac
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.ac.ttf"
);
hb_face_t
*
face_ac
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.ac.ttf"
);
hb_set_t
*
codepoints
=
hb_set_create
();
hb_set_t
*
codepoints
=
hb_set_create
();
hb_face_t
*
face_abc_subset
;
hb_set_add
(
codepoints
,
97
);
hb_set_add
(
codepoints
,
97
);
hb_set_add
(
codepoints
,
99
);
hb_set_add
(
codepoints
,
99
);
hb_face_t
*
face_abc_subset
=
hb_subset_test_create_subset
(
face_abc
,
hb_subset_test_create_input
(
codepoints
));
face_abc_subset
=
hb_subset_test_create_subset
(
face_abc
,
hb_subset_test_create_input
(
codepoints
));
hb_set_destroy
(
codepoints
);
hb_set_destroy
(
codepoints
);
hb_subset_test_check
(
face_ac
,
face_abc_subset
,
HB_TAG
(
'g'
,
'l'
,
'y'
,
'f'
));
hb_subset_test_check
(
face_ac
,
face_abc_subset
,
HB_TAG
(
'g'
,
'l'
,
'y'
,
'f'
));
...
@@ -87,8 +86,9 @@ test_subset_glyf_with_components (void)
...
@@ -87,8 +86,9 @@ test_subset_glyf_with_components (void)
hb_face_t
*
face_subset
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.components.subset.ttf"
);
hb_face_t
*
face_subset
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.components.subset.ttf"
);
hb_set_t
*
codepoints
=
hb_set_create
();
hb_set_t
*
codepoints
=
hb_set_create
();
hb_face_t
*
face_generated_subset
;
hb_set_add
(
codepoints
,
0x1fc
);
hb_set_add
(
codepoints
,
0x1fc
);
hb_face_t
*
face_generated_subset
=
hb_subset_test_create_subset
(
face_components
,
hb_subset_test_create_input
(
codepoints
));
face_generated_subset
=
hb_subset_test_create_subset
(
face_components
,
hb_subset_test_create_input
(
codepoints
));
hb_set_destroy
(
codepoints
);
hb_set_destroy
(
codepoints
);
hb_subset_test_check
(
face_subset
,
face_generated_subset
,
HB_TAG
(
'g'
,
'l'
,
'y'
,
'f'
));
hb_subset_test_check
(
face_subset
,
face_generated_subset
,
HB_TAG
(
'g'
,
'l'
,
'y'
,
'f'
));
...
@@ -106,10 +106,11 @@ test_subset_glyf_noop (void)
...
@@ -106,10 +106,11 @@ test_subset_glyf_noop (void)
hb_face_t
*
face_abc
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.abc.ttf"
);
hb_face_t
*
face_abc
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.abc.ttf"
);
hb_set_t
*
codepoints
=
hb_set_create
();
hb_set_t
*
codepoints
=
hb_set_create
();
hb_face_t
*
face_abc_subset
;
hb_set_add
(
codepoints
,
97
);
hb_set_add
(
codepoints
,
97
);
hb_set_add
(
codepoints
,
98
);
hb_set_add
(
codepoints
,
98
);
hb_set_add
(
codepoints
,
99
);
hb_set_add
(
codepoints
,
99
);
hb_face_t
*
face_abc_subset
=
hb_subset_test_create_subset
(
face_abc
,
hb_subset_test_create_input
(
codepoints
));
face_abc_subset
=
hb_subset_test_create_subset
(
face_abc
,
hb_subset_test_create_input
(
codepoints
));
hb_set_destroy
(
codepoints
);
hb_set_destroy
(
codepoints
);
hb_subset_test_check
(
face_abc
,
face_abc_subset
,
HB_TAG
(
'g'
,
'l'
,
'y'
,
'f'
));
hb_subset_test_check
(
face_abc
,
face_abc_subset
,
HB_TAG
(
'g'
,
'l'
,
'y'
,
'f'
));
...
@@ -127,11 +128,13 @@ test_subset_glyf_strip_hints_simple (void)
...
@@ -127,11 +128,13 @@ test_subset_glyf_strip_hints_simple (void)
hb_face_t
*
face_ac
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.ac.nohints.ttf"
);
hb_face_t
*
face_ac
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.ac.nohints.ttf"
);
hb_set_t
*
codepoints
=
hb_set_create
();
hb_set_t
*
codepoints
=
hb_set_create
();
hb_subset_input_t
*
input
;
hb_face_t
*
face_abc_subset
;
hb_set_add
(
codepoints
,
'a'
);
hb_set_add
(
codepoints
,
'a'
);
hb_set_add
(
codepoints
,
'c'
);
hb_set_add
(
codepoints
,
'c'
);
hb_subset_input_t
*
input
=
hb_subset_test_create_input
(
codepoints
);
input
=
hb_subset_test_create_input
(
codepoints
);
*
hb_subset_input_drop_hints
(
input
)
=
true
;
*
hb_subset_input_drop_hints
(
input
)
=
true
;
hb_face_t
*
face_abc_subset
=
hb_subset_test_create_subset
(
face_abc
,
input
);
face_abc_subset
=
hb_subset_test_create_subset
(
face_abc
,
input
);
hb_set_destroy
(
codepoints
);
hb_set_destroy
(
codepoints
);
hb_subset_test_check
(
face_ac
,
face_abc_subset
,
HB_TAG
(
'l'
,
'o'
,
'c'
,
'a'
));
hb_subset_test_check
(
face_ac
,
face_abc_subset
,
HB_TAG
(
'l'
,
'o'
,
'c'
,
'a'
));
...
@@ -150,11 +153,13 @@ test_subset_glyf_strip_hints_composite (void)
...
@@ -150,11 +153,13 @@ test_subset_glyf_strip_hints_composite (void)
hb_face_t
*
face_subset
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.components.1fc.nohints.ttf"
);
hb_face_t
*
face_subset
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.components.1fc.nohints.ttf"
);
hb_set_t
*
codepoints
=
hb_set_create
();
hb_set_t
*
codepoints
=
hb_set_create
();
hb_subset_input_t
*
input
;
hb_face_t
*
face_generated_subset
;
hb_set_add
(
codepoints
,
0x1fc
);
hb_set_add
(
codepoints
,
0x1fc
);
hb_subset_input_t
*
input
=
hb_subset_test_create_input
(
codepoints
);
input
=
hb_subset_test_create_input
(
codepoints
);
*
hb_subset_input_drop_hints
(
input
)
=
true
;
*
hb_subset_input_drop_hints
(
input
)
=
true
;
hb_face_t
*
face_generated_subset
=
hb_subset_test_create_subset
(
face_components
,
input
);
face_generated_subset
=
hb_subset_test_create_subset
(
face_components
,
input
);
hb_set_destroy
(
codepoints
);
hb_set_destroy
(
codepoints
);
hb_subset_test_check
(
face_subset
,
face_generated_subset
,
HB_TAG
(
'g'
,
'l'
,
'y'
,
'f'
));
hb_subset_test_check
(
face_subset
,
face_generated_subset
,
HB_TAG
(
'g'
,
'l'
,
'y'
,
'f'
));
...
...
test/api/test-subset-hdmx.c
浏览文件 @
a12dd6f7
...
@@ -24,8 +24,6 @@
...
@@ -24,8 +24,6 @@
* Google Author(s): Garret Rieger
* Google Author(s): Garret Rieger
*/
*/
#include <stdbool.h>
#include "hb-test.h"
#include "hb-test.h"
#include "hb-subset-test.h"
#include "hb-subset-test.h"
...
@@ -39,9 +37,10 @@ test_subset_hdmx_simple_subset (void)
...
@@ -39,9 +37,10 @@ test_subset_hdmx_simple_subset (void)
hb_face_t
*
face_ac
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.ac.ttf"
);
hb_face_t
*
face_ac
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.ac.ttf"
);
hb_set_t
*
codepoints
=
hb_set_create
();
hb_set_t
*
codepoints
=
hb_set_create
();
hb_face_t
*
face_abc_subset
;
hb_set_add
(
codepoints
,
'a'
);
hb_set_add
(
codepoints
,
'a'
);
hb_set_add
(
codepoints
,
'c'
);
hb_set_add
(
codepoints
,
'c'
);
hb_face_t
*
face_abc_subset
=
hb_subset_test_create_subset
(
face_abc
,
hb_subset_test_create_input
(
codepoints
));
face_abc_subset
=
hb_subset_test_create_subset
(
face_abc
,
hb_subset_test_create_input
(
codepoints
));
hb_set_destroy
(
codepoints
);
hb_set_destroy
(
codepoints
);
hb_subset_test_check
(
face_ac
,
face_abc_subset
,
HB_TAG
(
'h'
,
'd'
,
'm'
,
'x'
));
hb_subset_test_check
(
face_ac
,
face_abc_subset
,
HB_TAG
(
'h'
,
'd'
,
'm'
,
'x'
));
...
@@ -57,10 +56,11 @@ test_subset_hdmx_noop (void)
...
@@ -57,10 +56,11 @@ test_subset_hdmx_noop (void)
hb_face_t
*
face_abc
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.abc.ttf"
);
hb_face_t
*
face_abc
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.abc.ttf"
);
hb_set_t
*
codepoints
=
hb_set_create
();
hb_set_t
*
codepoints
=
hb_set_create
();
hb_face_t
*
face_abc_subset
;
hb_set_add
(
codepoints
,
'a'
);
hb_set_add
(
codepoints
,
'a'
);
hb_set_add
(
codepoints
,
'b'
);
hb_set_add
(
codepoints
,
'b'
);
hb_set_add
(
codepoints
,
'c'
);
hb_set_add
(
codepoints
,
'c'
);
hb_face_t
*
face_abc_subset
=
hb_subset_test_create_subset
(
face_abc
,
hb_subset_test_create_input
(
codepoints
));
face_abc_subset
=
hb_subset_test_create_subset
(
face_abc
,
hb_subset_test_create_input
(
codepoints
));
hb_set_destroy
(
codepoints
);
hb_set_destroy
(
codepoints
);
hb_subset_test_check
(
face_abc
,
face_abc_subset
,
HB_TAG
(
'h'
,
'd'
,
'm'
,
'x'
));
hb_subset_test_check
(
face_abc
,
face_abc_subset
,
HB_TAG
(
'h'
,
'd'
,
'm'
,
'x'
));
...
...
test/api/test-subset-hmtx.c
浏览文件 @
a12dd6f7
...
@@ -24,8 +24,6 @@
...
@@ -24,8 +24,6 @@
* Google Author(s): Roderick Sheeter
* Google Author(s): Roderick Sheeter
*/
*/
#include <stdbool.h>
#include "hb-test.h"
#include "hb-test.h"
#include "hb-subset-test.h"
#include "hb-subset-test.h"
...
@@ -53,9 +51,10 @@ test_subset_hmtx_simple_subset (void)
...
@@ -53,9 +51,10 @@ test_subset_hmtx_simple_subset (void)
hb_face_t
*
face_ac
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.ac.ttf"
);
hb_face_t
*
face_ac
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.ac.ttf"
);
hb_set_t
*
codepoints
=
hb_set_create
();
hb_set_t
*
codepoints
=
hb_set_create
();
hb_face_t
*
face_abc_subset
;
hb_set_add
(
codepoints
,
'a'
);
hb_set_add
(
codepoints
,
'a'
);
hb_set_add
(
codepoints
,
'c'
);
hb_set_add
(
codepoints
,
'c'
);
hb_face_t
*
face_abc_subset
=
hb_subset_test_create_subset
(
face_abc
,
hb_subset_test_create_input
(
codepoints
));
face_abc_subset
=
hb_subset_test_create_subset
(
face_abc
,
hb_subset_test_create_input
(
codepoints
));
hb_set_destroy
(
codepoints
);
hb_set_destroy
(
codepoints
);
check_num_hmetrics
(
face_abc_subset
,
3
);
/* nothing has same width */
check_num_hmetrics
(
face_abc_subset
,
3
);
/* nothing has same width */
...
@@ -74,9 +73,10 @@ test_subset_hmtx_monospace (void)
...
@@ -74,9 +73,10 @@ test_subset_hmtx_monospace (void)
hb_face_t
*
face_ac
=
hb_subset_test_open_font
(
"fonts/Inconsolata-Regular.ac.ttf"
);
hb_face_t
*
face_ac
=
hb_subset_test_open_font
(
"fonts/Inconsolata-Regular.ac.ttf"
);
hb_set_t
*
codepoints
=
hb_set_create
();
hb_set_t
*
codepoints
=
hb_set_create
();
hb_face_t
*
face_abc_subset
;
hb_set_add
(
codepoints
,
'a'
);
hb_set_add
(
codepoints
,
'a'
);
hb_set_add
(
codepoints
,
'c'
);
hb_set_add
(
codepoints
,
'c'
);
hb_face_t
*
face_abc_subset
=
hb_subset_test_create_subset
(
face_abc
,
hb_subset_test_create_input
(
codepoints
));
face_abc_subset
=
hb_subset_test_create_subset
(
face_abc
,
hb_subset_test_create_input
(
codepoints
));
hb_set_destroy
(
codepoints
);
hb_set_destroy
(
codepoints
);
check_num_hmetrics
(
face_abc_subset
,
1
);
/* everything has same width */
check_num_hmetrics
(
face_abc_subset
,
1
);
/* everything has same width */
...
@@ -95,9 +95,10 @@ test_subset_hmtx_keep_num_metrics (void)
...
@@ -95,9 +95,10 @@ test_subset_hmtx_keep_num_metrics (void)
hb_face_t
*
face_ac
=
hb_subset_test_open_font
(
"fonts/Inconsolata-Regular.ac.widerc.ttf"
);
hb_face_t
*
face_ac
=
hb_subset_test_open_font
(
"fonts/Inconsolata-Regular.ac.widerc.ttf"
);
hb_set_t
*
codepoints
=
hb_set_create
();
hb_set_t
*
codepoints
=
hb_set_create
();
hb_face_t
*
face_abc_subset
;
hb_set_add
(
codepoints
,
'a'
);
hb_set_add
(
codepoints
,
'a'
);
hb_set_add
(
codepoints
,
'c'
);
hb_set_add
(
codepoints
,
'c'
);
hb_face_t
*
face_abc_subset
=
hb_subset_test_create_subset
(
face_abc
,
hb_subset_test_create_input
(
codepoints
));
face_abc_subset
=
hb_subset_test_create_subset
(
face_abc
,
hb_subset_test_create_input
(
codepoints
));
hb_set_destroy
(
codepoints
);
hb_set_destroy
(
codepoints
);
check_num_hmetrics
(
face_abc_subset
,
3
);
/* c is wider */
check_num_hmetrics
(
face_abc_subset
,
3
);
/* c is wider */
...
@@ -115,9 +116,10 @@ test_subset_hmtx_decrease_num_metrics (void)
...
@@ -115,9 +116,10 @@ test_subset_hmtx_decrease_num_metrics (void)
hb_face_t
*
face_ab
=
hb_subset_test_open_font
(
"fonts/Inconsolata-Regular.ab.ttf"
);
hb_face_t
*
face_ab
=
hb_subset_test_open_font
(
"fonts/Inconsolata-Regular.ab.ttf"
);
hb_set_t
*
codepoints
=
hb_set_create
();
hb_set_t
*
codepoints
=
hb_set_create
();
hb_face_t
*
face_abc_subset
;
hb_set_add
(
codepoints
,
'a'
);
hb_set_add
(
codepoints
,
'a'
);
hb_set_add
(
codepoints
,
'b'
);
hb_set_add
(
codepoints
,
'b'
);
hb_face_t
*
face_abc_subset
=
hb_subset_test_create_subset
(
face_abc
,
hb_subset_test_create_input
(
codepoints
));
face_abc_subset
=
hb_subset_test_create_subset
(
face_abc
,
hb_subset_test_create_input
(
codepoints
));
hb_set_destroy
(
codepoints
);
hb_set_destroy
(
codepoints
);
check_num_hmetrics
(
face_abc_subset
,
1
);
/* everything left has same width */
check_num_hmetrics
(
face_abc_subset
,
1
);
/* everything left has same width */
...
@@ -134,10 +136,11 @@ test_subset_hmtx_noop (void)
...
@@ -134,10 +136,11 @@ test_subset_hmtx_noop (void)
hb_face_t
*
face_abc
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.abc.ttf"
);
hb_face_t
*
face_abc
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.abc.ttf"
);
hb_set_t
*
codepoints
=
hb_set_create
();
hb_set_t
*
codepoints
=
hb_set_create
();
hb_face_t
*
face_abc_subset
;
hb_set_add
(
codepoints
,
'a'
);
hb_set_add
(
codepoints
,
'a'
);
hb_set_add
(
codepoints
,
'b'
);
hb_set_add
(
codepoints
,
'b'
);
hb_set_add
(
codepoints
,
'c'
);
hb_set_add
(
codepoints
,
'c'
);
hb_face_t
*
face_abc_subset
=
hb_subset_test_create_subset
(
face_abc
,
hb_subset_test_create_input
(
codepoints
));
face_abc_subset
=
hb_subset_test_create_subset
(
face_abc
,
hb_subset_test_create_input
(
codepoints
));
hb_set_destroy
(
codepoints
);
hb_set_destroy
(
codepoints
);
check_num_hmetrics
(
face_abc_subset
,
4
);
/* nothing has same width */
check_num_hmetrics
(
face_abc_subset
,
4
);
/* nothing has same width */
...
...
test/api/test-subset-os2.c
浏览文件 @
a12dd6f7
...
@@ -24,7 +24,6 @@
...
@@ -24,7 +24,6 @@
* Google Author(s): Garret Rieger
* Google Author(s): Garret Rieger
*/
*/
#include <stdbool.h>
#include "hb-test.h"
#include "hb-test.h"
#include "hb-subset-test.h"
#include "hb-subset-test.h"
...
@@ -36,8 +35,9 @@ test_subset_os2 (void)
...
@@ -36,8 +35,9 @@ test_subset_os2 (void)
hb_face_t
*
face_b
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.b.ttf"
);
hb_face_t
*
face_b
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.b.ttf"
);
hb_set_t
*
codepoints
=
hb_set_create
();
hb_set_t
*
codepoints
=
hb_set_create
();
hb_face_t
*
face_abc_subset
;
hb_set_add
(
codepoints
,
98
);
hb_set_add
(
codepoints
,
98
);
hb_face_t
*
face_abc_subset
=
hb_subset_test_create_subset
(
face_abc
,
hb_subset_test_create_input
(
codepoints
));
face_abc_subset
=
hb_subset_test_create_subset
(
face_abc
,
hb_subset_test_create_input
(
codepoints
));
hb_set_destroy
(
codepoints
);
hb_set_destroy
(
codepoints
);
hb_subset_test_check
(
face_b
,
face_abc_subset
,
HB_TAG
(
'O'
,
'S'
,
'/'
,
'2'
));
hb_subset_test_check
(
face_b
,
face_abc_subset
,
HB_TAG
(
'O'
,
'S'
,
'/'
,
'2'
));
...
...
test/fuzzing/CMakeLists.txt
浏览文件 @
a12dd6f7
...
@@ -13,6 +13,6 @@ if (HB_CHECK)
...
@@ -13,6 +13,6 @@ if (HB_CHECK)
target_compile_definitions
(
hb-fuzzer PUBLIC
${
FUZZING_CPPFLAGS
}
)
target_compile_definitions
(
hb-fuzzer PUBLIC
${
FUZZING_CPPFLAGS
}
)
add_test
(
NAME hb-fuzzer
add_test
(
NAME hb-fuzzer
COMMAND
python
run-fuzzer-tests.py $<TARGET_FILE:hb-fuzzer>
COMMAND
"
${
PYTHON_EXECUTABLE
}
"
run-fuzzer-tests.py $<TARGET_FILE:hb-fuzzer>
WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
)
WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
)
endif
()
endif
()
test/shaping/CMakeLists.txt
浏览文件 @
a12dd6f7
...
@@ -3,7 +3,7 @@ if (HB_BUILD_UTILS)
...
@@ -3,7 +3,7 @@ if (HB_BUILD_UTILS)
extract_make_variable
(
TESTS
${
INHOUSE
}
)
extract_make_variable
(
TESTS
${
INHOUSE
}
)
foreach
(
test IN ITEMS
${
TESTS
}
)
foreach
(
test IN ITEMS
${
TESTS
}
)
add_test
(
NAME
${
test
}
add_test
(
NAME
${
test
}
COMMAND
python
run-tests.py $<TARGET_FILE:hb-shape>
"data/in-house/
${
test
}
"
COMMAND
"
${
PYTHON_EXECUTABLE
}
"
run-tests.py $<TARGET_FILE:hb-shape>
"data/in-house/
${
test
}
"
WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
)
WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
)
endforeach
()
endforeach
()
...
@@ -11,7 +11,7 @@ if (HB_BUILD_UTILS)
...
@@ -11,7 +11,7 @@ if (HB_BUILD_UTILS)
extract_make_variable
(
TESTS
${
TEXTRENDERING
}
)
extract_make_variable
(
TESTS
${
TEXTRENDERING
}
)
foreach
(
test IN ITEMS
${
TESTS
}
)
foreach
(
test IN ITEMS
${
TESTS
}
)
add_test
(
NAME
${
test
}
add_test
(
NAME
${
test
}
COMMAND
python
run-tests.py $<TARGET_FILE:hb-shape>
"data/text-rendering-tests/
${
test
}
"
COMMAND
"
${
PYTHON_EXECUTABLE
}
"
run-tests.py $<TARGET_FILE:hb-shape>
"data/text-rendering-tests/
${
test
}
"
WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
)
WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
)
endforeach
()
endforeach
()
endif
()
endif
()
test/subset/CMakeLists.txt
浏览文件 @
a12dd6f7
...
@@ -3,7 +3,7 @@ if (HB_BUILD_UTILS)
...
@@ -3,7 +3,7 @@ if (HB_BUILD_UTILS)
extract_make_variable
(
TESTS
${
SOURCES
}
)
extract_make_variable
(
TESTS
${
SOURCES
}
)
foreach
(
test IN ITEMS
${
TESTS
}
)
foreach
(
test IN ITEMS
${
TESTS
}
)
add_test
(
NAME
${
test
}
add_test
(
NAME
${
test
}
COMMAND
python
run-tests.py $<TARGET_FILE:hb-subset>
"data/
${
test
}
"
COMMAND
"
${
PYTHON_EXECUTABLE
}
"
run-tests.py $<TARGET_FILE:hb-subset>
"data/
${
test
}
"
WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
)
WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
)
set_property
(
TEST
${
test
}
PROPERTY SKIP_RETURN_CODE 77
)
set_property
(
TEST
${
test
}
PROPERTY SKIP_RETURN_CODE 77
)
endforeach
()
endforeach
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录