Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
7d2376de
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看板
提交
7d2376de
编写于
2月 13, 2019
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into iter
上级
2d940946
890d0ee7
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
52 addition
and
50 deletion
+52
-50
.circleci/config.yml
.circleci/config.yml
+13
-3
src/hb-algs.hh
src/hb-algs.hh
+0
-5
src/hb-coretext.cc
src/hb-coretext.cc
+5
-5
src/hb-meta.hh
src/hb-meta.hh
+9
-18
src/hb-ot-layout.hh
src/hb-ot-layout.hh
+3
-3
src/hb-ot-shape-complex-arabic.cc
src/hb-ot-shape-complex-arabic.cc
+3
-3
test/fuzzing/hb-subset-fuzzer.cc
test/fuzzing/hb-subset-fuzzer.cc
+19
-13
未找到文件。
.circleci/config.yml
浏览文件 @
7d2376de
...
...
@@ -52,7 +52,7 @@ jobs:
-
image
:
alpine
steps
:
-
checkout
-
run
:
apk update && apk add ragel make pkgconfig libtool autoconf automake gettext gcc g++ glib-dev freetype-dev cairo-dev
-
run
:
apk update && apk add ragel make pkgconfig libtool autoconf automake gettext gcc g++ glib-dev freetype-dev cairo-dev
python
# C??FLAGS are not needed for a regular build
-
run
:
CFLAGS="-O3" CXXFLAGS="-O3 -DHB_NO_MMAP" ./autogen.sh
-
run
:
make -j32
...
...
@@ -60,10 +60,10 @@ jobs:
archlinux-py3-all
:
docker
:
-
image
:
base/devel
-
image
:
archlinux/base
steps
:
-
checkout
-
run
:
pacman --noconfirm -Syu freetype2 cairo icu gettext gobject-introspection gcc gcc-libs glib2 graphite pkg-config ragel python python-pip
-
run
:
pacman --noconfirm -Syu freetype2 cairo icu gettext gobject-introspection gcc gcc-libs glib2 graphite pkg-config ragel python python-pip
make which base-devel
-
run
:
pip install flake8 fonttools
-
run
:
flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
# C??FLAGS are not needed for a regular build
...
...
@@ -71,6 +71,15 @@ jobs:
-
run
:
make -j32 CPPFLAGS="-Werror"
-
run
:
make check CPPFLAGS="-Werror" || .ci/fail.sh
## Doesn't play well with CircleCI apparently
#void-notest:
# docker:
# - image: voidlinux/voidlinux
# steps:
# - checkout
# - run: xbps-install -Suy freetype gettext gcc glib graphite pkg-config ragel libtool autoconf automake make
# - run: ./autogen.sh && make -j32 && make check
clang-O3-O0
:
docker
:
-
image
:
ubuntu:18.10
...
...
@@ -307,6 +316,7 @@ workflows:
# autotools based builds
-
alpine-O3-NOMMAP
-
archlinux-py3-all
#- void-notest
-
gcc-valgrind
-
clang-O3-O0
-
clang-everything
...
...
src/hb-algs.hh
浏览文件 @
7d2376de
...
...
@@ -327,11 +327,6 @@ hb_ceil_to_4 (unsigned int v)
template
<
typename
T
>
static
inline
bool
hb_in_range
(
T
u
,
T
lo
,
T
hi
)
{
/* The sizeof() is here to force template instantiation.
* I'm sure there are better ways to do this but can't think of
* one right now. Declaring a variable won't work as HB_UNUSED
* is unusable on some platforms and unused types are less likely
* to generate a warning than unused variables. */
static_assert
(
!
hb_is_signed
<
T
>::
value
,
""
);
/* The casts below are important as if T is smaller than int,
...
...
src/hb-coretext.cc
浏览文件 @
7d2376de
...
...
@@ -171,7 +171,7 @@ create_ct_font (CGFontRef cg_font, CGFloat font_size)
if
(
CFStringHasPrefix
(
cg_postscript_name
,
CFSTR
(
".SFNSText"
))
||
CFStringHasPrefix
(
cg_postscript_name
,
CFSTR
(
".SFNSDisplay"
)))
{
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1080
#if
!(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) &&
MAC_OS_X_VERSION_MIN_REQUIRED < 1080
# define kCTFontUIFontSystem kCTFontSystemFontType
# define kCTFontUIFontEmphasizedSystem kCTFontEmphasizedSystemFontType
#endif
...
...
@@ -214,7 +214,7 @@ create_ct_font (CGFontRef cg_font, CGFloat font_size)
}
CFURLRef
original_url
=
nullptr
;
#if
TARGET_OS_OSX
&& MAC_OS_X_VERSION_MIN_REQUIRED < 1060
#if
!(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE)
&& MAC_OS_X_VERSION_MIN_REQUIRED < 1060
ATSFontRef
atsFont
;
FSRef
fsref
;
OSStatus
status
;
...
...
@@ -244,7 +244,7 @@ create_ct_font (CGFontRef cg_font, CGFloat font_size)
* process in Blink. This can be detected by the new file URL location
* that the newly found font points to. */
CFURLRef
new_url
=
nullptr
;
#if
TARGET_OS_OSX
&& MAC_OS_X_VERSION_MIN_REQUIRED < 1060
#if
!(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE)
&& MAC_OS_X_VERSION_MIN_REQUIRED < 1060
atsFont
=
CTFontGetPlatformFont
(
new_ct_font
,
NULL
);
status
=
ATSFontGetFileReference
(
atsFont
,
&
fsref
);
if
(
status
==
noErr
)
...
...
@@ -711,7 +711,7 @@ resize_and_retry:
/* What's the iOS equivalent of this check?
* The symbols was introduced in iOS 7.0.
* At any rate, our fallback is safe and works fine. */
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1090
#if
!(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) &&
MAC_OS_X_VERSION_MIN_REQUIRED < 1090
# define kCTLanguageAttributeName CFSTR ("NSLanguage")
#endif
CFStringRef
lang
=
CFStringCreateWithCStringNoCopy
(
kCFAllocatorDefault
,
...
...
@@ -783,7 +783,7 @@ resize_and_retry:
int
level
=
HB_DIRECTION_IS_FORWARD
(
buffer
->
props
.
direction
)
?
0
:
1
;
CFNumberRef
level_number
=
CFNumberCreate
(
kCFAllocatorDefault
,
kCFNumberIntType
,
&
level
);
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
#if
!(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) &&
MAC_OS_X_VERSION_MIN_REQUIRED < 1060
extern
const
CFStringRef
kCTTypesetterOptionForcedEmbeddingLevel
;
#endif
CFDictionaryRef
options
=
CFDictionaryCreate
(
kCFAllocatorDefault
,
...
...
src/hb-meta.hh
浏览文件 @
7d2376de
...
...
@@ -88,24 +88,15 @@ struct hb_enable_if<true, T> { typedef T type; };
*/
template
<
typename
T
>
struct
hb_is_signed
;
template
<
>
struct
hb_is_signed
<
signed
char
>
{
enum
{
value
=
true
};
};
template
<
>
struct
hb_is_signed
<
signed
short
>
{
enum
{
value
=
true
};
};
template
<
>
struct
hb_is_signed
<
signed
int
>
{
enum
{
value
=
true
};
};
template
<
>
struct
hb_is_signed
<
signed
long
>
{
enum
{
value
=
true
};
};
template
<
>
struct
hb_is_signed
<
unsigned
char
>
{
enum
{
value
=
false
};
};
template
<
>
struct
hb_is_signed
<
unsigned
short
>
{
enum
{
value
=
false
};
};
template
<
>
struct
hb_is_signed
<
unsigned
int
>
{
enum
{
value
=
false
};
};
template
<
>
struct
hb_is_signed
<
unsigned
long
>
{
enum
{
value
=
false
};
};
/* We need to define hb_is_signed for the typedefs we use on pre-Visual
* Studio 2010 for the int8_t type, since __int8/__int64 is not considered
* the same as char/long. The previous lines will suffice for the other
* types, though. Note that somehow, unsigned __int8 is considered same
* as unsigned char.
* https://github.com/harfbuzz/harfbuzz/pull/1499
*/
#if defined(_MSC_VER) && (_MSC_VER < 1600)
template
<
>
struct
hb_is_signed
<
__int8
>
{
enum
{
value
=
true
};
};
#endif
/* https://github.com/harfbuzz/harfbuzz/issues/1535 */
template
<
>
struct
hb_is_signed
<
int8_t
>
{
enum
{
value
=
true
};
};
template
<
>
struct
hb_is_signed
<
int16_t
>
{
enum
{
value
=
true
};
};
template
<
>
struct
hb_is_signed
<
int32_t
>
{
enum
{
value
=
true
};
};
template
<
>
struct
hb_is_signed
<
int64_t
>
{
enum
{
value
=
true
};
};
template
<
>
struct
hb_is_signed
<
uint8_t
>
{
enum
{
value
=
false
};
};
template
<
>
struct
hb_is_signed
<
uint16_t
>
{
enum
{
value
=
false
};
};
template
<
>
struct
hb_is_signed
<
uint32_t
>
{
enum
{
value
=
false
};
};
template
<
>
struct
hb_is_signed
<
uint64_t
>
{
enum
{
value
=
false
};
};
#define hb_is_signed(T) hb_is_signed<T>::value
template
<
bool
is_signed
>
struct
hb_signedness_int
;
...
...
src/hb-ot-layout.hh
浏览文件 @
7d2376de
...
...
@@ -215,7 +215,7 @@ _hb_glyph_info_set_unicode_props (hb_glyph_info_t *info, hb_buffer_t *buffer)
unsigned
int
gen_cat
=
(
unsigned
int
)
unicode
->
general_category
(
u
);
unsigned
int
props
=
gen_cat
;
if
(
u
>=
0x80
)
if
(
u
>=
0x80
u
)
{
buffer
->
scratch_flags
|=
HB_BUFFER_SCRATCH_FLAG_HAS_NON_ASCII
;
...
...
@@ -232,10 +232,10 @@ _hb_glyph_info_set_unicode_props (hb_glyph_info_t *info, hb_buffer_t *buffer)
* FVSes are GC=Mn, we have use a separate bit to remember them.
* Fixes:
* https://github.com/harfbuzz/harfbuzz/issues/234 */
else
if
(
unlikely
(
hb_in_range
(
u
,
0x180Bu
,
0x180Du
)))
props
|=
UPROPS_MASK_HIDDEN
;
else
if
(
unlikely
(
hb_in_range
<
hb_codepoint_t
>
(
u
,
0x180Bu
,
0x180Du
)))
props
|=
UPROPS_MASK_HIDDEN
;
/* TAG characters need similar treatment. Fixes:
* https://github.com/harfbuzz/harfbuzz/issues/463 */
else
if
(
unlikely
(
hb_in_range
(
u
,
0xE0020u
,
0xE007Fu
)))
props
|=
UPROPS_MASK_HIDDEN
;
else
if
(
unlikely
(
hb_in_range
<
hb_codepoint_t
>
(
u
,
0xE0020u
,
0xE007Fu
)))
props
|=
UPROPS_MASK_HIDDEN
;
/* COMBINING GRAPHEME JOINER should not be skipped; at least some times.
* https://github.com/harfbuzz/harfbuzz/issues/554 */
else
if
(
unlikely
(
u
==
0x034Fu
))
...
...
src/hb-ot-shape-complex-arabic.cc
浏览文件 @
7d2376de
...
...
@@ -467,7 +467,7 @@ apply_stch (const hb_ot_shape_plan_t *plan HB_UNUSED,
unsigned
int
j
=
new_len
;
for
(
unsigned
int
i
=
count
;
i
;
i
--
)
{
if
(
!
hb_in_range
<
u
nsigned
>
(
info
[
i
-
1
].
arabic_shaping_action
(),
STCH_FIXED
,
STCH_REPEATING
))
if
(
!
hb_in_range
<
u
int8_t
>
(
info
[
i
-
1
].
arabic_shaping_action
(),
STCH_FIXED
,
STCH_REPEATING
))
{
if
(
step
==
CUT
)
{
...
...
@@ -488,7 +488,7 @@ apply_stch (const hb_ot_shape_plan_t *plan HB_UNUSED,
unsigned
int
end
=
i
;
while
(
i
&&
hb_in_range
<
u
nsigned
>
(
info
[
i
-
1
].
arabic_shaping_action
(),
STCH_FIXED
,
STCH_REPEATING
))
hb_in_range
<
u
int8_t
>
(
info
[
i
-
1
].
arabic_shaping_action
(),
STCH_FIXED
,
STCH_REPEATING
))
{
i
--
;
hb_position_t
width
=
font
->
get_glyph_h_advance
(
info
[
i
].
codepoint
);
...
...
@@ -506,7 +506,7 @@ apply_stch (const hb_ot_shape_plan_t *plan HB_UNUSED,
unsigned
int
start
=
i
;
unsigned
int
context
=
i
;
while
(
context
&&
!
hb_in_range
<
u
nsigned
>
(
info
[
context
-
1
].
arabic_shaping_action
(),
STCH_FIXED
,
STCH_REPEATING
)
&&
!
hb_in_range
<
u
int8_t
>
(
info
[
context
-
1
].
arabic_shaping_action
(),
STCH_FIXED
,
STCH_REPEATING
)
&&
(
_hb_glyph_info_is_default_ignorable
(
&
info
[
context
-
1
])
||
HB_ARABIC_GENERAL_CATEGORY_IS_WORD
(
_hb_glyph_info_get_general_category
(
&
info
[
context
-
1
]))))
{
...
...
test/fuzzing/hb-subset-fuzzer.cc
浏览文件 @
7d2376de
...
...
@@ -11,11 +11,13 @@ trySubset (hb_face_t *face,
const
hb_codepoint_t
text
[],
int
text_length
,
bool
drop_hints
,
bool
drop_layout
)
bool
drop_layout
,
bool
retain_gids
)
{
hb_subset_input_t
*
input
=
hb_subset_input_create_or_fail
();
hb_subset_input_set_drop_hints
(
input
,
drop_hints
);
hb_subset_input_set_drop_layout
(
input
,
drop_layout
);
hb_subset_input_set_retain_gids
(
input
,
retain_gids
);
hb_set_t
*
codepoints
=
hb_subset_input_unicode_set
(
input
);
for
(
int
i
=
0
;
i
<
text_length
;
i
++
)
...
...
@@ -32,16 +34,14 @@ trySubset (hb_face_t *face,
static
void
trySubset
(
hb_face_t
*
face
,
const
hb_codepoint_t
text
[],
int
text_length
)
int
text_length
,
const
uint8_t
flags
[
1
])
{
for
(
unsigned
int
drop_hints
=
0
;
drop_hints
<
2
;
drop_hints
++
)
{
for
(
unsigned
int
drop_layout
=
0
;
drop_layout
<
2
;
drop_layout
++
)
{
trySubset
(
face
,
text
,
text_length
,
(
bool
)
drop_hints
,
(
bool
)
drop_layout
);
}
}
bool
drop_hints
=
flags
[
0
]
&
(
1
<<
0
);
bool
drop_layout
=
flags
[
0
]
&
(
1
<<
1
);
bool
retain_gids
=
flags
[
0
]
&
(
1
<<
2
);
trySubset
(
face
,
text
,
text_length
,
drop_hints
,
drop_layout
,
retain_gids
);
}
extern
"C"
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
data
,
size_t
size
)
...
...
@@ -55,21 +55,27 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
hb_face_collect_unicodes
(
face
,
output
);
hb_set_destroy
(
output
);
uint8_t
flags
[
1
]
=
{
0
};
const
hb_codepoint_t
text
[]
=
{
'A'
,
'B'
,
'C'
,
'D'
,
'E'
,
'X'
,
'Y'
,
'Z'
,
'1'
,
'2'
,
'3'
,
'@'
,
'_'
,
'%'
,
'&'
,
')'
,
'*'
,
'$'
,
'!'
};
trySubset
(
face
,
text
,
sizeof
(
text
)
/
sizeof
(
hb_codepoint_t
));
trySubset
(
face
,
text
,
sizeof
(
text
)
/
sizeof
(
hb_codepoint_t
)
,
flags
);
hb_codepoint_t
text_from_data
[
16
];
if
(
size
>
sizeof
(
text_from_data
))
{
if
(
size
>
sizeof
(
text_from_data
)
+
sizeof
(
flags
)
)
{
memcpy
(
text_from_data
,
data
+
size
-
sizeof
(
text_from_data
),
sizeof
(
text_from_data
));
memcpy
(
flags
,
data
+
size
-
sizeof
(
text_from_data
)
-
sizeof
(
flags
),
sizeof
(
flags
));
unsigned
int
text_size
=
sizeof
(
text_from_data
)
/
sizeof
(
hb_codepoint_t
);
trySubset
(
face
,
text_from_data
,
text_size
);
trySubset
(
face
,
text_from_data
,
text_size
,
flags
);
}
hb_face_destroy
(
face
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录