Commit Graph

33 Commits

Author SHA1 Message Date
Garret Rieger 62ae7a4c1e Add woff2 encoder/decoder support for overlapSimpleBitmap.
overlapSimpleBitmap is a new field in the transformed glyf table (https://www.w3.org/TR/WOFF2/#glyf_table_format). It allows the overlap simple flag set on glyphs in the original font to be saved into the woff2 encoding.
2022-03-29 13:49:27 -07:00
Garret Rieger 3831354113 [subset] Check for overflow when decoding glyf. 2018-05-31 17:54:06 -07:00
Frédéric Wang 9b5a53b1d7 Move public headers into a separate include/woff2 directory
This is a first step to make WOFF2 a shared library. Public headers are moved
in their own directory to make the public API clearer. This is similar to
the c/include/brotli/ directory in Brotli. "using" commands are also removed
from the public headers, so that callers won't have unexpected side effect
when including the files.
2017-10-05 12:04:24 -07:00
Rod Sheeter 53846e1861 Relicense as MIT 2017-10-04 16:12:46 -07:00
Rod Sheeter 679771f97a Reject fonts with bounding boxes for empty glyphs 2017-08-23 14:03:23 -07:00
Rod Sheeter e6579e6b12 Reject fonts with bad loca origLength or hmtx reserved bits set. Correct misplaced bracket in type conversion. 2017-08-23 12:59:55 -07:00
Rod Sheeter 2e09253456 Check for non-consecutive glyf/loca. Reject inconsistent xform flags on glyf/loca 2017-07-31 09:16:49 -07:00
Garret Rieger 44ab8c45d7 Fix a crash bug in the woff2 decoder when totalSfntSize in the woff2 header is <= 0. 2017-07-19 17:35:57 -07:00
Eugene Kliuchnikov 9db42c09e9 Roll new brotli version. 2016-12-06 11:14:53 +01:00
Khaled Hosny cdd850ef52 Don’t ignore write failure
Makes it easy to find the source of the problems than failing later.
2016-08-09 15:59:50 +02:00
Rod Sheeter 8f3ff26c37 Fix an out of bounds access found by libFuzzer 2016-05-17 16:00:38 -07:00
Rod Sheeter a15a8ab86b Fixes for bugs uncovered by libFuzzer analysis. A write past buffer, a potential DOS by way of giant alloc, and an out of range access. 2016-05-06 13:14:42 -07:00
Rod Sheeter 2bc6acf6df Push fix for https://bugs.chromium.org/p/chromium/issues/detail?id=604649 2016-04-21 09:29:50 -07:00
Rod Sheeter 07cd303dd2 Update to latest brotli. Use size_t more consistently. Remove dead code. 2016-04-21 09:27:28 -07:00
Rod Sheeter b220918cab Stop trusting header totalSfntSize and glyf origLength 2016-03-08 12:30:08 -08:00
Rod Sheeter d1efde9124 Update woff2_dec.cc range checking 2016-02-04 08:24:36 -08:00
Rod Sheeter 14f4cb67ec Tweaks requested by @fred-wang to help Mozilla build 2016-01-28 11:34:31 -08:00
Rod Sheeter c817c969bf hmtx optimization decoding. never encodes hmtx optimized as yet; need a cli param. 2016-01-20 14:10:02 -08:00
Kunihiko Sakamoto 965d077bde Fix signed/unsigned comparison warnings on MSVC 2015-11-17 18:20:03 +09:00
Khaled Hosny 17ed658d0a Don’t print to stderr unless a standalone binary
We will use woff2 code from OTS and it is undesirable for a library to
print messages to stderr.
2015-08-28 01:30:03 +02:00
Rod Sheeter eeec219f20 Only reorder the table directory 2015-07-27 08:47:58 -07:00
Khaled Hosny 208c8f854e Kill kWoff2FlagsContinueStream
There is only a single data stream for all the compressed tables, but
the code was originally written for separately compressed tables then
retrofitted, so this is an attempt to streamline it a bit.
2015-07-15 11:25:52 +02:00
Rod Sheeter 4e3bb3418f Merge PR #16 (reject composite glyphs w/o bbox), slightly modified to match recent code updates (mostly just adding branch predictions) 2015-07-14 10:12:40 -07:00
Rod Sheeter ea4c87a2c5 Updates from internal copy. Better branch prediction, ability to set Brotli quality on ConvertTTFToWOFF2 2015-07-13 09:08:04 -07:00
Khaled Hosny c54533f47f Fix compiler warning on Mac OS X
warning: format specifies type 'unsigned long' but the argument has type
'uint64_t' (aka 'unsigned long long') [-Wformat]
2015-06-25 03:32:08 +02:00
Khaled Hosny 531adab1fe Reject non-zero loca transformLength 2015-04-20 00:21:05 +02:00
Khaled Hosny 3f91c6e58f Check matadata and private blocks offsets & length
So that we can reject fonts with extraneous data between blocks, as the
spec says we should reject says we should reject such fonts.
2015-04-20 00:11:04 +02:00
Khaled Hosny 0634e0a719 Don't accept too long totalSfntSize
Per the spec (WOFF 2.0 spec just refer to WOFF 1.0 spec here):
http://www.w3.org/TR/2012/REC-WOFF-20121213/#conform-totalsize-longword-reject
2015-04-20 00:11:04 +02:00
Rod Sheeter 498c637024 Correct decoder output table ordering 2015-03-03 09:30:12 -08:00
Rod Sheeter 1c975530b9 Adding TTC support, take 1 2015-02-24 13:53:35 -08:00
Rod Sheeter 445f541996 Sort tables when decoding 2015-02-12 09:56:29 -08:00
Roderick Sheeter 2b35420fa9 As suggested in https://github.com/google/woff2/pull/2, correct const for top 7 bits 2014-11-24 07:11:04 -08:00
Khaled Hosny 09c4eba0f6 Rename woff2 to src 2014-11-22 16:35:21 +02:00