Behdad Esfahbod [Thu, 5 Nov 2015 19:37:48 +0000 (11:37 -0800)]
[util] If font has color, generate PNG with color
Behdad Esfahbod [Thu, 5 Nov 2015 06:55:11 +0000 (22:55 -0800)]
Don't try zeroing marks by GDEF if there are no non-ASCII
This one is a hack, but should be ok.
Behdad Esfahbod [Thu, 5 Nov 2015 06:54:49 +0000 (22:54 -0800)]
Don't try zeroing mark attachments by Unicode if there's no non-ASCII
Behdad Esfahbod [Thu, 5 Nov 2015 06:58:58 +0000 (22:58 -0800)]
Actually commit changes for previous commit
Behdad Esfahbod [Thu, 5 Nov 2015 06:42:41 +0000 (22:42 -0800)]
Skip GPOS cursive / attachment adjustmnent if none happened
I'm starting to really like how free these new scratch_flags are.
Behdad Esfahbod [Thu, 5 Nov 2015 06:28:44 +0000 (22:28 -0800)]
Minor
Behdad Esfahbod [Thu, 5 Nov 2015 06:24:19 +0000 (22:24 -0800)]
Skip forming clusters if text is all ASCII
Behdad Esfahbod [Thu, 5 Nov 2015 06:00:25 +0000 (22:00 -0800)]
Move variable-sized struct member to end
Hopefully makes clang build happy
Behdad Esfahbod [Thu, 5 Nov 2015 05:53:16 +0000 (21:53 -0800)]
Optimize positioning for when h_origin is nil
Behdad Esfahbod [Thu, 5 Nov 2015 05:42:55 +0000 (21:42 -0800)]
Add font->has_...() to check for individual nil font funcs
Hopefully this wouldn't break any compiler. There was some magic
moments to getting this to compile...
Behdad Esfahbod [Thu, 5 Nov 2015 05:16:26 +0000 (21:16 -0800)]
Minor reshaping of hb_font_funcs_t implementation
In anticipation of further changes. No functional changes.
Behdad Esfahbod [Thu, 5 Nov 2015 04:51:21 +0000 (20:51 -0800)]
Comments
Behdad Esfahbod [Thu, 5 Nov 2015 04:47:42 +0000 (20:47 -0800)]
[ot] Remove font funcs that do nothing
Behdad Esfahbod [Thu, 5 Nov 2015 04:43:59 +0000 (20:43 -0800)]
[ot] Port ot font funcs to allocated object
Behdad Esfahbod [Thu, 5 Nov 2015 04:40:05 +0000 (20:40 -0800)]
[ft] Remove font funcs that do nothing
Behdad Esfahbod [Thu, 5 Nov 2015 04:37:49 +0000 (20:37 -0800)]
[ft] Port ft font funcs to allocated object
Behdad Esfahbod [Thu, 5 Nov 2015 04:22:44 +0000 (20:22 -0800)]
Separate nil font-funcs from parent-peeking font-funcs
API change: all fonts created with hb_font_create() now inherit from
(ie have parent) hb_font_get_empty().
Behdad Esfahbod [Thu, 5 Nov 2015 03:28:17 +0000 (19:28 -0800)]
Optimize positioning direction calculations
It makes the binary smaller AND faster. Yumm!
Behdad Esfahbod [Thu, 5 Nov 2015 02:58:02 +0000 (18:58 -0800)]
Don't do fractions if buffer is ASCII-only
Behdad Esfahbod [Thu, 5 Nov 2015 02:46:22 +0000 (18:46 -0800)]
Optimize runs without Default_Ignorable's
Now that we have a buffer-wide scratch flags facility, use it to
optimize away a few passes.
Behdad Esfahbod [Thu, 5 Nov 2015 02:00:57 +0000 (18:00 -0800)]
Limit max edits during sanitize to 8
Used to be 100. If a tabe needs more than one or two edits, it's
probably completely bogus...
Might help with speeding up fuzzing for
https://github.com/behdad/harfbuzz/issues/157
Behdad Esfahbod [Thu, 5 Nov 2015 02:00:53 +0000 (18:00 -0800)]
Minor
Behdad Esfahbod [Thu, 5 Nov 2015 01:45:06 +0000 (17:45 -0800)]
If font doesn't support U+2011, fall back to U+2010
Test passes now.
Behdad Esfahbod [Thu, 5 Nov 2015 01:43:36 +0000 (17:43 -0800)]
Untangle if/else waterfall
Behdad Esfahbod [Thu, 5 Nov 2015 01:38:22 +0000 (17:38 -0800)]
Add tests for hyphen fallback
U+2011 is <noBreak> equivaent of U+2010, so we should do the fallback
for it. Currently fails.
Behdad Esfahbod [Thu, 5 Nov 2015 01:37:30 +0000 (17:37 -0800)]
[test] Drop hintings when subsetting fonts to record
Behdad Esfahbod [Thu, 5 Nov 2015 01:27:07 +0000 (17:27 -0800)]
Adjust the width of various spaces if font does not cover them
See discussion here:
https://github.com/behdad/harfbuzz/commit/
81ef4f407d9c7bd98cf62cef951dc538b13442eb
There's no way to disable this fallback, but I don't think it would
be needed. Let's hope for the best!
Fixes https://github.com/behdad/harfbuzz/issues/153
Behdad Esfahbod [Thu, 5 Nov 2015 00:25:57 +0000 (16:25 -0800)]
Generalize flags types
Behdad Esfahbod [Wed, 4 Nov 2015 22:48:46 +0000 (14:48 -0800)]
Normalize various spaces to space if font doesn't support
This resurrects the space fallback feature, after I disabled
the compatibility decomposition. Now I can release HarfBuzz
again without breaking Pango!
It also remembers which space character it was, such that later
on we can approximate the width of this particular space
character. That part is not implemented yet.
We normalize all GC=Zs chars except for U+1680 OGHA SPACE MARK,
which is better left alone.
Behdad Esfahbod [Wed, 4 Nov 2015 23:30:48 +0000 (15:30 -0800)]
[test] Support recording multiple lines of text in record-test.sh
Behdad Esfahbod [Wed, 4 Nov 2015 22:46:52 +0000 (14:46 -0800)]
Protect against possible invalid-memory access after OOM
Behdad Esfahbod [Wed, 4 Nov 2015 22:46:10 +0000 (14:46 -0800)]
Fix typo!
Ouch! Fortunately that function was unused.
Behdad Esfahbod [Wed, 4 Nov 2015 22:18:39 +0000 (14:18 -0800)]
Add Unicode space category
Unused so far.
Behdad Esfahbod [Wed, 4 Nov 2015 21:26:17 +0000 (13:26 -0800)]
Make top-byte of unicode_props available to be used differently per-GC
Behdad Esfahbod [Wed, 4 Nov 2015 21:21:25 +0000 (13:21 -0800)]
Towards using top-byte of unicode-props for more things
Behdad Esfahbod [Wed, 4 Nov 2015 21:17:33 +0000 (13:17 -0800)]
Add _hb_glyph_info_is_unicode_mark()
Unused right now.
Behdad Esfahbod [Tue, 3 Nov 2015 20:58:12 +0000 (12:58 -0800)]
Tighten ccc-setting a bit and document it
Behdad Esfahbod [Tue, 3 Nov 2015 20:28:34 +0000 (12:28 -0800)]
Fix test expectation
Behdad Esfahbod [Tue, 3 Nov 2015 20:15:12 +0000 (12:15 -0800)]
[ot-font] Fix hmtx table length checking, *again*
Exactly the same problem that I fixed in
63ef0b41dc48d6112d1918c1b1de9de8ea90adb5
I rewrote the table checking yesterday in
67f8821fb25d9bd55719f5e29a582ae1af4b02b3
and introduced the exact same issue again. :(
Good thing we have ongoing fuzzing going now. Was discovered
immediately by libFuzzer. Thanks kcc!
https://github.com/behdad/harfbuzz/issues/139#issuecomment-
153449473
Fixes https://github.com/behdad/harfbuzz/issues/156
Behdad Esfahbod [Tue, 3 Nov 2015 19:34:47 +0000 (11:34 -0800)]
[util] Fix option-parsing leaks
Behdad Esfahbod [Tue, 3 Nov 2015 19:26:34 +0000 (11:26 -0800)]
[util] In --debug mode, duplicate font data
This has the effect that the font data will end up in a memory
section malloc()ed exactly to its size. This gives us better
valgrind detection of out-of-bounds access.
Previously, the font data was placed in a mmap()ed section or
GString-allocated area, which didn't have proper protections
at the end when running under valgrind.
Behdad Esfahbod [Tue, 3 Nov 2015 01:58:12 +0000 (17:58 -0800)]
[perf] Micro-optimize
Behdad Esfahbod [Tue, 3 Nov 2015 01:52:45 +0000 (17:52 -0800)]
Remove irrelevant comment
I tried moving the is_default_ignorable() function to an INTERNAL
function. That made the binary size grow by 5k AND things got a
tad bit slower!
Behdad Esfahbod [Tue, 3 Nov 2015 01:44:05 +0000 (17:44 -0800)]
Minor
Behdad Esfahbod [Tue, 3 Nov 2015 01:36:51 +0000 (17:36 -0800)]
Combine unicode_props0/1 into a uint16
Slightly faster. In prep for more changes.
Behdad Esfahbod [Tue, 3 Nov 2015 01:27:48 +0000 (17:27 -0800)]
[perf] Only call combining_class() for marks
Saves some time. Also preparing for reusing the ccc byte for other stuff.
Behdad Esfahbod [Mon, 2 Nov 2015 23:43:08 +0000 (15:43 -0800)]
Make max context-length and max nesting level configurable
...at compile time.
Behdad Esfahbod [Mon, 2 Nov 2015 23:37:29 +0000 (15:37 -0800)]
[ot] Make bad-hmtx handling match FreeType
Also route fuzzing-related tests through hb-ot-font, to reduce dependency
on FreeType behavior for badly-broken fonts. Fixes failing test with
FreeType master.
Behdad Esfahbod [Mon, 26 Oct 2015 21:05:05 +0000 (14:05 -0700)]
Use templates for making sure expression is constant
Behdad Esfahbod [Wed, 21 Oct 2015 20:51:40 +0000 (18:51 -0200)]
Update comments for removal of compat decompositions
Behdad Esfahbod [Wed, 21 Oct 2015 19:20:55 +0000 (17:20 -0200)]
Disable compatibility decomposition usage during normalization
Fixes https://github.com/behdad/harfbuzz/issues/152
Behdad Esfahbod [Wed, 21 Oct 2015 13:23:12 +0000 (11:23 -0200)]
Fix two more -Wshadow warnings
https://bugzilla.mozilla.org/show_bug.cgi?id=1215894
Behdad Esfahbod [Wed, 21 Oct 2015 13:20:55 +0000 (11:20 -0200)]
Fix one more -Wshadow warning
https://bugzilla.mozilla.org/show_bug.cgi?id=1215894
Behdad Esfahbod [Wed, 21 Oct 2015 13:16:49 +0000 (11:16 -0200)]
Fix a few more -Wshadow-local warnings
https://bugzilla.mozilla.org/show_bug.cgi?id=1215894
Behdad Esfahbod [Wed, 21 Oct 2015 13:13:21 +0000 (11:13 -0200)]
Fix one -Wshadow-compatible-local warning
From https://bugzilla.mozilla.org/show_bug.cgi?id=1215894
Behdad Esfahbod [Wed, 21 Oct 2015 13:10:10 +0000 (11:10 -0200)]
Avoid unnecessary cast to 64-bit
Fixes https://github.com/behdad/harfbuzz/issues/146
Or I think it should.
Behdad Esfahbod [Wed, 21 Oct 2015 13:04:28 +0000 (11:04 -0200)]
Add HB_FALLTHROUGH
Borrowed from https://bugzilla.mozilla.org/show_bug.cgi?id=1215411
Behdad Esfahbod [Tue, 20 Oct 2015 18:39:41 +0000 (16:39 -0200)]
Fix typo
Behdad Esfahbod [Tue, 20 Oct 2015 17:21:18 +0000 (15:21 -0200)]
Add BUILD.md to dist
Behdad Esfahbod [Tue, 20 Oct 2015 17:19:41 +0000 (15:19 -0200)]
Merge pull request #148 from ebraminio/inst
Add BUILD.md based on harfbuzz.org docs
Behdad Esfahbod [Mon, 19 Oct 2015 18:59:43 +0000 (16:59 -0200)]
Merge pull request #147 from ebraminio/dockerci
[ci] change to docker infrastructure
Ebrahim Byagowi [Mon, 19 Oct 2015 18:11:01 +0000 (21:41 +0330)]
[ci] change to docker infrastructure
Ebrahim Byagowi [Mon, 19 Oct 2015 18:32:12 +0000 (22:02 +0330)]
Add BUILD.md based on harfbuzz.org docs
Behdad Esfahbod [Thu, 15 Oct 2015 23:25:29 +0000 (20:25 -0300)]
1.0.6
Behdad Esfahbod [Thu, 15 Oct 2015 23:20:22 +0000 (20:20 -0300)]
[ft] Revert change-of-behavior of hb_ft_font_create() introduced in 1.0.5
The default FreeType load flags where changed from FT_LOAD_NO_HINTING
to FT_LOAD_DEFAULT in
2a9627c5641cd000e2adff0e42a0dc687b53ec70.
This is crashing HarfBuzz-enabled FreeType as I suppose it causes
infinite recursion between HB and FT autohinter...
Revert the behavior change.
Fixes https://github.com/behdad/harfbuzz/issues/143
Behdad Esfahbod [Thu, 15 Oct 2015 15:55:57 +0000 (12:55 -0300)]
Add tests for a couple of fixed issues found by libFuzzer
From:
https://github.com/behdad/harfbuzz/issues/139#issuecomment-
147616887
https://github.com/behdad/harfbuzz/issues/139#issuecomment-
148289957
Behdad Esfahbod [Thu, 15 Oct 2015 15:47:22 +0000 (12:47 -0300)]
[ot-font] Fix hmtx wrong table length check
Discovered by libFuzzer. Ouch!
https://github.com/behdad/harfbuzz/issues/139#issuecomment-
148289957
Behdad Esfahbod [Wed, 14 Oct 2015 02:33:28 +0000 (23:33 -0300)]
Reduce max nesting level from 8 to 6
We probably should implement better system to catch cyclic lookups.
But for now, this speeds up worst case behavior with broken fonts
considerably without compromising legitimate usecases.
https://github.com/behdad/harfbuzz/issues/139#issuecomment-
147788447
Behdad Esfahbod [Tue, 13 Oct 2015 13:55:33 +0000 (10:55 -0300)]
1.0.5
Behdad Esfahbod [Tue, 13 Oct 2015 13:32:56 +0000 (10:32 -0300)]
[ot-font] Fix leak
https://github.com/behdad/harfbuzz/issues/139#issuecomment-
147616887
Behdad Esfahbod [Tue, 13 Oct 2015 04:33:59 +0000 (00:33 -0400)]
Add test for previous commit
Behdad Esfahbod [Tue, 13 Oct 2015 04:30:50 +0000 (00:30 -0400)]
Fix another memory access issue discovered by libFuzzer
Fixes https://github.com/behdad/harfbuzz/issues/139#issuecomment-
146984679
Behdad Esfahbod [Mon, 12 Oct 2015 21:39:52 +0000 (17:39 -0400)]
[fuzz] Add fuzzing script from kcc@
https://github.com/behdad/harfbuzz/issues/139
Behdad Esfahbod [Mon, 12 Oct 2015 21:21:52 +0000 (17:21 -0400)]
Extern "C" custom-allocator declerations
Behdad Esfahbod [Mon, 12 Oct 2015 01:41:04 +0000 (21:41 -0400)]
Behdad Esfahbod [Mon, 12 Oct 2015 00:59:29 +0000 (20:59 -0400)]
Typo
Behdad Esfahbod [Fri, 9 Oct 2015 18:23:15 +0000 (14:23 -0400)]
Fix another sanitize bug
Also discovered by "libFuzzer".
Behdad Esfahbod [Fri, 9 Oct 2015 16:34:02 +0000 (12:34 -0400)]
Add test for previous fix
Behdad Esfahbod [Fri, 9 Oct 2015 16:25:55 +0000 (12:25 -0400)]
Fix return value of sanitize when subformat is not readable
This is a fix on top of the previous issue fixed in
c917965b9e6fe2b21ed6c51559673288fa3af4b7.
This was caught by "libFuzzer" testing.
Behdad Esfahbod [Fri, 9 Oct 2015 16:20:58 +0000 (12:20 -0400)]
Add hb_dispatch_context_t
Behdad Esfahbod [Thu, 8 Oct 2015 16:51:02 +0000 (12:51 -0400)]
Add hb_font_set_parent()
No reason to not have it. Makes life easier later.
We (hb-ft, hb-ot-font, etc) can use this API to inject new
parent into a font...
Behdad Esfahbod [Thu, 8 Oct 2015 16:47:15 +0000 (12:47 -0400)]
[ft] Add version for new API
Behdad Esfahbod [Wed, 7 Oct 2015 21:33:20 +0000 (17:33 -0400)]
[ft] API: Add hb_font_[sg]et_load_flags() API
This changes the default load_flags of fonts created using
hb_ft_font_create() from NO_HINTING to DEFAULT. Hope that doesn't
break too much client code.
Code calling hb_ft_font_set_funcs() is unaffected.
Behdad Esfahbod [Wed, 7 Oct 2015 21:33:02 +0000 (17:33 -0400)]
Minor
Behdad Esfahbod [Sat, 3 Oct 2015 12:20:55 +0000 (13:20 +0100)]
Allow compiling with custom allocators
User can define hb_malloc_impl, etc, to name of custom allocator functions
that have the same signature as malloc.
Behdad Esfahbod [Fri, 2 Oct 2015 13:38:20 +0000 (14:38 +0100)]
Default font scale to face upem
Makes for a better default and avoids nasty inheritance issues.
See mailing list thread "Default hb_font_t scale".
Behdad Esfahbod [Fri, 2 Oct 2015 13:21:29 +0000 (14:21 +0100)]
Make hb_font_create_sub_font() NOT make parent immutable
We don't rely on that. However, whenever hb_font_make_immutable()
is called, it makes its parenting chain immutable.
Behdad Esfahbod [Fri, 2 Oct 2015 07:21:12 +0000 (08:21 +0100)]
Fix hb-ot-shape-normalize with empty buffer
Part of https://github.com/behdad/harfbuzz/issues/136
Behdad Esfahbod [Fri, 2 Oct 2015 07:02:29 +0000 (08:02 +0100)]
Replace a couple of malloc()s with calloc()
Behdad Esfahbod [Fri, 2 Oct 2015 06:25:52 +0000 (07:25 +0100)]
Fix segfault with empty buffer in hb_shape_plan_execute()
Move the empty-buffer check from hb_shape_full() to hb_shape_plan_execute().
Reported by Simon Cozens.
Behdad Esfahbod [Wed, 30 Sep 2015 21:51:16 +0000 (22:51 +0100)]
1.0.4
Behdad Esfahbod [Tue, 29 Sep 2015 13:57:02 +0000 (14:57 +0100)]
Define return_trace()
Not functional change (expected!).
Behdad Esfahbod [Tue, 29 Sep 2015 13:45:35 +0000 (14:45 +0100)]
Add missing returns
Fixes possible invalid read of two bytes.
Reported by Behzad Najjarpour Jabbari, Secunia Research.
Behdad Esfahbod [Tue, 29 Sep 2015 13:34:56 +0000 (14:34 +0100)]
Micro-optimize hb_language_from_string()
As measured / improved by Benson Limketkai.
Sascha Brawer [Sun, 28 Jun 2015 01:29:47 +0000 (03:29 +0200)]
Handle language tags that indicate phonetic IPA transcription
The BCP-47 registry defines a variant subtag "fonipa" that can be used
in combination with arbitrary other language tags. For example,
"rm-CH-fonipa-sursilv" indicates the Sursilvan dialect of Romansh
as used in Switzerland, transcribed used the International Phonetic
Alphabet.
http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry
Behdad Esfahbod [Thu, 3 Sep 2015 11:23:22 +0000 (15:53 +0430)]
Fix Since tags
Fixes https://github.com/behdad/harfbuzz/issues/103
Behdad Esfahbod [Thu, 3 Sep 2015 10:25:59 +0000 (14:55 +0430)]
Fix Since: version tags on font and face APIs
A while back we marked every API as version:1.0. We should fix them all
to reflect real version they were introduced. This is a start.
Patch from Nikolay Sivov.
Behdad Esfahbod [Tue, 1 Sep 2015 16:03:50 +0000 (17:03 +0100)]
1.0.3
Behdad Esfahbod [Tue, 1 Sep 2015 15:26:35 +0000 (16:26 +0100)]
[indic] Add comments to merge_clusters calls
Behdad Esfahbod [Tue, 1 Sep 2015 15:24:54 +0000 (16:24 +0100)]
[thai] Respect cluster-level > 0