platform/upstream/libHarfBuzzSharp.git
5 years ago[blob] Use default null object
Behdad Esfahbod [Sun, 11 Nov 2018 05:12:30 +0000 (00:12 -0500)]
[blob] Use default null object

5 years ago[blob] Change null object memory mode to DUPLICATE
Behdad Esfahbod [Sun, 11 Nov 2018 05:11:28 +0000 (00:11 -0500)]
[blob] Change null object memory mode to DUPLICATE

We never rely on that being equal to readonly.  Just not being
writable.  Maybe not even that given that the object is inert.

In prep for next commit, using default null pool.

5 years agoAdd hb_blob_ptr_t
Behdad Esfahbod [Sun, 11 Nov 2018 04:52:15 +0000 (23:52 -0500)]
Add hb_blob_ptr_t

Use in a couple of places.  Push to bots to see how many unhappy before
I convert the rest.

5 years agoMinor
Behdad Esfahbod [Sun, 11 Nov 2018 03:41:35 +0000 (22:41 -0500)]
Minor

5 years ago[kerx] Fix Format1 tupleKern sanitization
Behdad Esfahbod [Sun, 11 Nov 2018 02:13:13 +0000 (21:13 -0500)]
[kerx] Fix Format1 tupleKern sanitization

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11312
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11305

5 years ago[fuzzing] Make "make lib" faster and more usable
Behdad Esfahbod [Sun, 11 Nov 2018 02:01:49 +0000 (21:01 -0500)]
[fuzzing] Make "make lib" faster and more usable

5 years agoMinor
Behdad Esfahbod [Sun, 11 Nov 2018 01:11:10 +0000 (20:11 -0500)]
Minor

5 years agoRevert parts of previous commit that made clang unhappy
Behdad Esfahbod [Sun, 11 Nov 2018 01:10:03 +0000 (20:10 -0500)]
Revert parts of previous commit that made clang unhappy

5 years agoBetter fix for MSVC 2008
Behdad Esfahbod [Sun, 11 Nov 2018 00:54:08 +0000 (19:54 -0500)]
Better fix for MSVC 2008

Follow up on b4c61130324455bfd42095b01fa14ac901e441f1

Fixes https://github.com/harfbuzz/harfbuzz/issues/1374

6 years agoTry fixing MSVC 2008 build
Behdad Esfahbod [Sat, 10 Nov 2018 21:35:39 +0000 (16:35 -0500)]
Try fixing MSVC 2008 build

Fixes https://github.com/harfbuzz/harfbuzz/issues/1374

6 years agoFix hb_bytes_t's unused template array constructor
Behdad Esfahbod [Sat, 10 Nov 2018 21:11:14 +0000 (16:11 -0500)]
Fix hb_bytes_t's unused template array constructor

6 years agoAdd trivial casts to hb_bytes_t
Behdad Esfahbod [Sat, 10 Nov 2018 21:09:21 +0000 (16:09 -0500)]
Add trivial casts to hb_bytes_t

6 years agoRevert back hb_bytes_t.cmp() to the scheme it was
Behdad Esfahbod [Sat, 10 Nov 2018 20:54:33 +0000 (15:54 -0500)]
Revert back hb_bytes_t.cmp() to the scheme it was

But fix UBSan complaint.

There's nothing in hb_bytes_t that guarantees lexical ordering, and
ordering by length first is much faster.

6 years agoFix hb_bytes_t.cmp() for realz this time
Behdad Esfahbod [Sat, 10 Nov 2018 20:43:16 +0000 (15:43 -0500)]
Fix hb_bytes_t.cmp() for realz this time

6 years agoFix hb_bytes_t.cmp()
Behdad Esfahbod [Sat, 10 Nov 2018 20:38:48 +0000 (15:38 -0500)]
Fix hb_bytes_t.cmp()

Ouch!

6 years agoMerge pull request #1376 from ebraminio/minor
Behdad Esfahbod [Sat, 10 Nov 2018 20:35:12 +0000 (15:35 -0500)]
Merge pull request #1376 from ebraminio/minor

[colr/feat/trak] minor

6 years ago[colr/feat/trak] minor
Ebrahim Byagowi [Sat, 10 Nov 2018 14:38:11 +0000 (18:08 +0330)]
[colr/feat/trak] minor

6 years ago[qsort] Fix O(N^2) behavior if all array elements are the same
Behdad Esfahbod [Sat, 10 Nov 2018 06:56:37 +0000 (01:56 -0500)]
[qsort] Fix O(N^2) behavior if all array elements are the same

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11327

Reported as https://github.com/noporpoise/sort_r/issues/7

6 years ago[post] Minor
Behdad Esfahbod [Sat, 10 Nov 2018 05:37:17 +0000 (00:37 -0500)]
[post] Minor

6 years ago[post] Move sanitize close to data fields
Behdad Esfahbod [Sat, 10 Nov 2018 05:26:36 +0000 (00:26 -0500)]
[post] Move sanitize close to data fields

6 years ago[post] Remove unnecessary hb_nonnull_ptr_t<>
Behdad Esfahbod [Sat, 10 Nov 2018 05:19:50 +0000 (00:19 -0500)]
[post] Remove unnecessary hb_nonnull_ptr_t<>

6 years ago[glyf] minor
Ebrahim Byagowi [Fri, 9 Nov 2018 23:12:08 +0000 (02:42 +0330)]
[glyf] minor

6 years agoFix a few MSVC 2008 warnings
Behdad Esfahbod [Fri, 9 Nov 2018 15:01:50 +0000 (10:01 -0500)]
Fix a few MSVC 2008 warnings

https://github.com/harfbuzz/harfbuzz/issues/1374

6 years agoMerge pull request #1358 from ebraminio/lcar
Behdad Esfahbod [Thu, 8 Nov 2018 19:42:40 +0000 (14:42 -0500)]
Merge pull request #1358 from ebraminio/lcar

Hook AAT's lcar to _get_ligature_carets

6 years agoHook AAT's lcar to _get_ligature_carets
Ebrahim Byagowi [Mon, 5 Nov 2018 09:01:58 +0000 (12:31 +0330)]
Hook AAT's lcar to _get_ligature_carets

6 years ago[aat] Minor
Ebrahim Byagowi [Thu, 8 Nov 2018 18:16:26 +0000 (21:46 +0330)]
[aat] Minor

6 years ago[test/text-rendering-tests] Update from upstream
Behdad Esfahbod [Thu, 8 Nov 2018 17:17:09 +0000 (12:17 -0500)]
[test/text-rendering-tests] Update from upstream

6 years ago[aat] Minor (#1369)
Ebrahim Byagowi [Thu, 8 Nov 2018 17:18:54 +0000 (20:48 +0330)]
[aat] Minor (#1369)

6 years ago[just] Initial table implementation (#1364)
Ebrahim Byagowi [Thu, 8 Nov 2018 15:47:02 +0000 (19:17 +0330)]
[just] Initial table implementation (#1364)

A starting point, its sanitization is not tested however

6 years ago[aat] Support Lookup<OffsetTo<>>, needed by just and lcar (#1368)
Ebrahim Byagowi [Thu, 8 Nov 2018 15:23:14 +0000 (18:53 +0330)]
[aat] Support Lookup<OffsetTo<>>, needed by just and lcar (#1368)

6 years ago[ci] minor
Ebrahim Byagowi [Thu, 8 Nov 2018 07:29:50 +0000 (10:59 +0330)]
[ci] minor

6 years ago[aat] Ignore cross-stream offset of deleted-glyphs
Behdad Esfahbod [Thu, 8 Nov 2018 02:58:04 +0000 (21:58 -0500)]
[aat] Ignore cross-stream offset of deleted-glyphs

I think it makes sense to accumulate it, but Ned tells me that's
what CoreText does.

6 years ago[fuzzing] Take whatever text we can
Behdad Esfahbod [Thu, 8 Nov 2018 00:11:43 +0000 (19:11 -0500)]
[fuzzing] Take whatever text we can

6 years agoMerge pull request #1362 from harfbuzz/cross-kern
Behdad Esfahbod [Wed, 7 Nov 2018 23:40:48 +0000 (18:40 -0500)]
Merge pull request #1362 from harfbuzz/cross-kern

Vastly improve kern/kerx tables, including cross-stream "kerning"

6 years ago[kerx] Comment
Behdad Esfahbod [Wed, 7 Nov 2018 23:13:22 +0000 (18:13 -0500)]
[kerx] Comment

6 years ago[kern] Implement negative state numbers
Behdad Esfahbod [Wed, 7 Nov 2018 23:04:53 +0000 (18:04 -0500)]
[kern] Implement negative state numbers

Let the fuzzing bots rip this code apart...

6 years ago[morx] Minor
Behdad Esfahbod [Wed, 7 Nov 2018 22:29:37 +0000 (17:29 -0500)]
[morx] Minor

6 years ago[aat] Remove deleted-glyhs after applying kerx/kern
Behdad Esfahbod [Wed, 7 Nov 2018 22:19:21 +0000 (17:19 -0500)]
[aat] Remove deleted-glyhs after applying kerx/kern

Finally:  Fixes https://github.com/harfbuzz/harfbuzz/issues/1356

Test case:
$ ./hb-shape GeezaPro.ttc -u U+0628,U+064A,U+064E,U+0651,U+0629
[u0629.final.tehMarbuta=4+713|u064e_u0651.shaddaFatha=1@0,-200+0|u064a.medial.yeh=1+656|u0628.initial.beh=0+656]

The mark positioning (kern table CrossStream kerning) only works if deleted
glyph (as result of ligation) is still in stream and pushed through the
state machine.

6 years ago[aat] Add debug info to state machine
Behdad Esfahbod [Wed, 7 Nov 2018 21:42:16 +0000 (16:42 -0500)]
[aat] Add debug info to state machine

6 years agoDisable fallback mark positioning if kern table has cross-stream kerning
Behdad Esfahbod [Wed, 7 Nov 2018 21:19:51 +0000 (16:19 -0500)]
Disable fallback mark positioning if kern table has cross-stream kerning

Happens even if the cross-stream kerning is for cursive attachment only.  Oh well..

6 years agoDon't apply both kerx and kern
Behdad Esfahbod [Wed, 7 Nov 2018 21:07:22 +0000 (16:07 -0500)]
Don't apply both kerx and kern

Ouch!

6 years agoMinor
Behdad Esfahbod [Wed, 7 Nov 2018 21:05:36 +0000 (16:05 -0500)]
Minor

6 years ago[kern] Switch to dispatch
Behdad Esfahbod [Wed, 7 Nov 2018 21:03:09 +0000 (16:03 -0500)]
[kern] Switch to dispatch

6 years ago[kerx/kern] Add has_cross_stream()
Behdad Esfahbod [Wed, 7 Nov 2018 21:02:40 +0000 (16:02 -0500)]
[kerx/kern] Add has_cross_stream()

6 years ago[kerx] Fix peculiar indexing that was needed previously
Behdad Esfahbod [Wed, 7 Nov 2018 20:44:40 +0000 (15:44 -0500)]
[kerx] Fix peculiar indexing that was needed previously

Not needed now that we use GPOS attachment for cursive kerx.

6 years ago[GPOS] Only mark unsafe-to-break if kerning happened
Behdad Esfahbod [Wed, 7 Nov 2018 20:40:55 +0000 (15:40 -0500)]
[GPOS] Only mark unsafe-to-break if kerning happened

Fixes https://github.com/harfbuzz/harfbuzz/issues/1365

6 years ago[GPOS] Add TODO item
Behdad Esfahbod [Wed, 7 Nov 2018 20:02:16 +0000 (15:02 -0500)]
[GPOS] Add TODO item

6 years ago[kerx] Implement CrossStream kerning for non-state-machine subtables
Behdad Esfahbod [Wed, 7 Nov 2018 19:52:36 +0000 (14:52 -0500)]
[kerx] Implement CrossStream kerning for non-state-machine subtables

Untested.

6 years ago[kerx] Disable backwards-kerning for non-state-machine tables
Behdad Esfahbod [Wed, 7 Nov 2018 19:42:15 +0000 (14:42 -0500)]
[kerx] Disable backwards-kerning for non-state-machine tables

That's what the spec says for Backwards flag, only applicable to
formats 1 and 4.

6 years ago[kerx] Use GPOS attachment facilities for CrossStream kerning
Behdad Esfahbod [Wed, 7 Nov 2018 19:38:29 +0000 (14:38 -0500)]
[kerx] Use GPOS attachment facilities for CrossStream kerning

6 years ago[kerx] Format
Behdad Esfahbod [Wed, 7 Nov 2018 19:11:48 +0000 (14:11 -0500)]
[kerx] Format

6 years ago[kerx] Don't disable crossKerning if kern feature is off
Behdad Esfahbod [Wed, 7 Nov 2018 19:04:04 +0000 (14:04 -0500)]
[kerx] Don't disable crossKerning if kern feature is off

6 years ago[kern] Apply erlier, where GPOS/kerx are applied
Behdad Esfahbod [Wed, 7 Nov 2018 18:58:41 +0000 (13:58 -0500)]
[kern] Apply erlier, where GPOS/kerx are applied

6 years ago[kerx] Implement tupleKerning for Format1
Behdad Esfahbod [Wed, 7 Nov 2018 18:51:17 +0000 (13:51 -0500)]
[kerx] Implement tupleKerning for Format1

Untested.

6 years ago[kerx] Better sanitize tupleKerning
Behdad Esfahbod [Wed, 7 Nov 2018 18:48:45 +0000 (13:48 -0500)]
[kerx] Better sanitize tupleKerning

6 years ago[kern/kerx] Share KernTable, renamed to KerxTable
Behdad Esfahbod [Wed, 7 Nov 2018 18:40:22 +0000 (13:40 -0500)]
[kern/kerx] Share KernTable, renamed to KerxTable

6 years ago[fallback] Minor
Behdad Esfahbod [Wed, 7 Nov 2018 18:35:06 +0000 (13:35 -0500)]
[fallback] Minor

6 years ago[kern/kerx] More towards sharing KernTable
Behdad Esfahbod [Wed, 7 Nov 2018 18:33:23 +0000 (13:33 -0500)]
[kern/kerx] More towards sharing KernTable

6 years ago[kern] Disable Format1 and Format3 for OT-style tables
Behdad Esfahbod [Wed, 7 Nov 2018 18:10:05 +0000 (13:10 -0500)]
[kern] Disable Format1 and Format3 for OT-style tables

6 years ago[kern] Minor
Behdad Esfahbod [Wed, 7 Nov 2018 18:04:21 +0000 (13:04 -0500)]
[kern] Minor

6 years ago[kern] Move code
Behdad Esfahbod [Wed, 7 Nov 2018 17:57:10 +0000 (12:57 -0500)]
[kern] Move code

6 years ago[kern] Massage more
Behdad Esfahbod [Wed, 7 Nov 2018 17:51:49 +0000 (12:51 -0500)]
[kern] Massage more

6 years ago[kerx] More minor
Behdad Esfahbod [Wed, 7 Nov 2018 17:49:20 +0000 (12:49 -0500)]
[kerx] More minor

6 years ago[kern/kerx] Minor
Behdad Esfahbod [Wed, 7 Nov 2018 17:48:06 +0000 (12:48 -0500)]
[kern/kerx] Minor

6 years ago[kern/kerx] Towards sharing KernTable
Behdad Esfahbod [Wed, 7 Nov 2018 17:32:39 +0000 (12:32 -0500)]
[kern/kerx] Towards sharing KernTable

6 years ago[kern/kerx] Minor
Behdad Esfahbod [Wed, 7 Nov 2018 17:27:44 +0000 (12:27 -0500)]
[kern/kerx] Minor

6 years ago[kern/kerx] Share Format2
Behdad Esfahbod [Wed, 7 Nov 2018 17:19:52 +0000 (12:19 -0500)]
[kern/kerx] Share Format2

This, enables Format2 for kern table, which was disabled before.

6 years ago[kerx] Towards merging Format2
Behdad Esfahbod [Wed, 7 Nov 2018 17:16:38 +0000 (12:16 -0500)]
[kerx] Towards merging Format2

6 years ago[aat] Minor
Behdad Esfahbod [Wed, 7 Nov 2018 17:08:44 +0000 (12:08 -0500)]
[aat] Minor

6 years ago[kerx] Rename
Behdad Esfahbod [Wed, 7 Nov 2018 16:56:36 +0000 (11:56 -0500)]
[kerx] Rename

6 years ago[morx/kerx] Rename types
Behdad Esfahbod [Wed, 7 Nov 2018 16:51:40 +0000 (11:51 -0500)]
[morx/kerx] Rename types

6 years ago[kern/kerx] Share Format1 subtable
Behdad Esfahbod [Wed, 7 Nov 2018 16:28:36 +0000 (11:28 -0500)]
[kern/kerx] Share Format1 subtable

6 years ago[kerx] Minor
Behdad Esfahbod [Wed, 7 Nov 2018 16:43:25 +0000 (11:43 -0500)]
[kerx] Minor

6 years ago[kerx] Minor
Behdad Esfahbod [Wed, 7 Nov 2018 16:25:55 +0000 (11:25 -0500)]
[kerx] Minor

6 years ago[kern/kerx] Enable crossStream kerning in vertical
Behdad Esfahbod [Wed, 7 Nov 2018 16:21:09 +0000 (11:21 -0500)]
[kern/kerx] Enable crossStream kerning in vertical

CoreText doesn't, but no reason we shouldn't do.

6 years ago[kerx] More towards sharing Format1
Behdad Esfahbod [Wed, 7 Nov 2018 16:20:14 +0000 (11:20 -0500)]
[kerx] More towards sharing Format1

6 years ago[morx] Simplify
Behdad Esfahbod [Wed, 7 Nov 2018 16:05:28 +0000 (11:05 -0500)]
[morx] Simplify

6 years ago[kerx] Towards sharing Format1
Behdad Esfahbod [Wed, 7 Nov 2018 16:02:04 +0000 (11:02 -0500)]
[kerx] Towards sharing Format1

6 years ago[morx] Minor
Behdad Esfahbod [Wed, 7 Nov 2018 15:58:50 +0000 (10:58 -0500)]
[morx] Minor

6 years ago[kern/kerx] Share Format0
Behdad Esfahbod [Wed, 7 Nov 2018 15:45:25 +0000 (10:45 -0500)]
[kern/kerx] Share Format0

6 years ago[kern/kerx] Towards merge more
Behdad Esfahbod [Wed, 7 Nov 2018 15:39:39 +0000 (10:39 -0500)]
[kern/kerx] Towards merge more

6 years ago[kern/kerx] More towards sharing
Behdad Esfahbod [Wed, 7 Nov 2018 15:33:46 +0000 (10:33 -0500)]
[kern/kerx] More towards sharing

6 years ago[kern] Move kern machine to hb-kern.hh
Behdad Esfahbod [Wed, 7 Nov 2018 15:25:25 +0000 (10:25 -0500)]
[kern] Move kern machine to hb-kern.hh

6 years ago[kerx] Towards sharing subtables with kern
Behdad Esfahbod [Wed, 7 Nov 2018 15:19:46 +0000 (10:19 -0500)]
[kerx] Towards sharing subtables with kern

6 years ago[kern] Remove Override business
Behdad Esfahbod [Wed, 7 Nov 2018 14:53:02 +0000 (09:53 -0500)]
[kern] Remove Override business

Not used in any fonts.  Not well-specified when mixing kerning with
Cross-Stream positioning.

6 years ago[post] Return true on truncation
Behdad Esfahbod [Wed, 7 Nov 2018 14:16:53 +0000 (09:16 -0500)]
[post] Return true on truncation

Client can check that buffer was completely filled out and reallocate.

6 years ago[post] Protect against huge empty tables
Behdad Esfahbod [Wed, 7 Nov 2018 14:14:42 +0000 (09:14 -0500)]
[post] Protect against huge empty tables

6 years ago[post] Minor
Behdad Esfahbod [Wed, 7 Nov 2018 14:13:51 +0000 (09:13 -0500)]
[post] Minor

6 years ago[post] Fix bound checking
Behdad Esfahbod [Wed, 7 Nov 2018 14:10:55 +0000 (09:10 -0500)]
[post] Fix bound checking

6 years agoUse non-GRID-fitted values for metrics (#1363)
HinTak [Wed, 7 Nov 2018 13:19:36 +0000 (13:19 +0000)]
Use non-GRID-fitted values for metrics (#1363)

* Use non-GRID-fitted values for metrics

See freetype/src/base/ftobjs.c:ft_recompute_scaled_metrics() and
the usage of GRID_FIT_METRICS inside.

Fixes https://github.com/behdad/harfbuzz/issues/1262

* Update hb-ft.cc

6 years ago[kern/kerx] Fix cursive joining
Behdad Esfahbod [Wed, 7 Nov 2018 05:25:48 +0000 (00:25 -0500)]
[kern/kerx] Fix cursive joining

Tested with Waseem TTC:

$ hb-shape Waseem.ttc جحخج
[F1Jeem_R2=3@0,180+479|M1Khah_L2_R2=2@0,682+403|M1Hah_L2_R2=1@0,1184+403|I1Jeem_L2=0@0,1184+744]

6 years ago[kern/kerx] Fix "reset" magic value
Behdad Esfahbod [Wed, 7 Nov 2018 05:04:40 +0000 (00:04 -0500)]
[kern/kerx] Fix "reset" magic value

6 years ago[kerx] Adjust CrossStream kern to match 'kern' table
Behdad Esfahbod [Wed, 7 Nov 2018 02:45:40 +0000 (21:45 -0500)]
[kerx] Adjust CrossStream kern to match 'kern' table

6 years ago[kern] More tweaks
Behdad Esfahbod [Wed, 7 Nov 2018 02:41:28 +0000 (21:41 -0500)]
[kern] More tweaks

Solves a mystery or two.  I'm fairly confident this is what CoreText does now.

6 years ago[kern] Adjust some more
Behdad Esfahbod [Wed, 7 Nov 2018 02:04:40 +0000 (21:04 -0500)]
[kern] Adjust some more

Getting closer.  So many open questions still...

6 years ago[kern] Add TODO
Behdad Esfahbod [Wed, 7 Nov 2018 02:04:02 +0000 (21:04 -0500)]
[kern] Add TODO

6 years ago[kern] Minor
Behdad Esfahbod [Wed, 7 Nov 2018 00:24:04 +0000 (19:24 -0500)]
[kern] Minor

6 years ago[kern] In Format1, adjust how kerning is done
Behdad Esfahbod [Tue, 6 Nov 2018 23:35:58 +0000 (18:35 -0500)]
[kern] In Format1, adjust how kerning is done

In a series of kerns in one action, kern all but last glyph forward,
and the last one backward.  Seems to better match what CoreText is doing.

Test cases, with GeezaPro Arabic:

$ ./hb-shape GeezaPro_10_10.ttc -u U+0631,U+0628
[u0628.beh=1+1415|u0631.reh=0@-202,0+700]

$ ./hb-shape GeezaPro_10_10.ttc -u U+0628,U+064F
[u064f.damma=0@0,-250+-250|u0628.beh=0@250,0+1665]

In a later change, I'll make kern machine avoid producing negative kerns.

6 years ago[kern] XXX Negate CrossKerning sign
Behdad Esfahbod [Tue, 6 Nov 2018 22:16:04 +0000 (17:16 -0500)]
[kern] XXX Negate CrossKerning sign

Not sure why, but seems to better match GeezaPro Arabic w CoreText.

Quite possibly I'm doing something very wrong...

6 years ago[kern] Implement CrossStream kerning
Behdad Esfahbod [Tue, 6 Nov 2018 19:48:42 +0000 (14:48 -0500)]
[kern] Implement CrossStream kerning