Commit Graph

113 Commits

Author SHA1 Message Date
Behdad Esfahbod 9810f0b80e [kern] Minor 2018-11-06 21:46:14 -05:00
Behdad Esfahbod 9c04b60583 [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.
2018-11-06 21:46:14 -05:00
Behdad Esfahbod e8c4772463 [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...
2018-11-06 21:46:14 -05:00
Behdad Esfahbod 01bf43ac01 [kern] Implement CrossStream kerning 2018-11-06 17:59:31 -05:00
Behdad Esfahbod b11830c09e [kern] Improve Format 2
Still disabled.
2018-11-06 17:59:31 -05:00
Behdad Esfahbod 10e6f708f3 [kern] Minor 2018-11-06 17:16:23 -05:00
Behdad Esfahbod 164eedd918 [kern] Minor 2018-11-06 17:16:23 -05:00
Behdad Esfahbod 220a5991ba [kern/kerx] Fix trace numbering 2018-11-06 17:16:23 -05:00
Behdad Esfahbod bfafe208da [kern] Switch to dispatch 2018-11-06 12:13:20 -05:00
Behdad Esfahbod 213fa3bf71 [kern] Refactor to include header in each subtable type 2018-11-06 12:13:20 -05:00
Behdad Esfahbod b0da2cd0b9 [kern] Some more 2018-11-06 12:13:20 -05:00
Behdad Esfahbod 75b00b51c8 [kern] Renames 2018-11-06 12:13:20 -05:00
Behdad Esfahbod b605db2f65 [aat] Clean up ankr table include mess 2018-11-04 12:58:02 -05:00
Behdad Esfahbod 8d98c51d13 [kern] Third try fix access violation in Format3
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11245
2018-11-03 15:14:57 -04:00
Behdad Esfahbod f074da8c2b [kern] Really fix access violation in Format3
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11245
2018-11-03 15:07:39 -04:00
Behdad Esfahbod 0589787ff5 [kern] Fix access violation in Format3
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11245
2018-11-03 14:59:40 -04:00
Behdad Esfahbod 8034d1dda0 [kern] Implement Format1
Also, implement backwards kerning for Format1 in kern and kerx.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1350
2018-11-02 14:48:04 -04:00
Behdad Esfahbod 46b3885c1a [kern] Set subtable on sanitizer 2018-11-02 14:43:38 -04:00
Behdad Esfahbod 74c7a2c6c8 [kern] Respect more flags 2018-11-02 14:26:04 -04:00
Behdad Esfahbod 9f880bad0d [kern] Minor
We like check_struct() more.
2018-11-02 13:57:41 -04:00
Behdad Esfahbod f1df441bed [kern] Comment 2018-11-02 13:26:15 -04:00
Behdad Esfahbod 095f5add0b [kern] Push apply loop to each subtable 2018-11-02 13:23:54 -04:00
Behdad Esfahbod 949dad89a8 [kern] Remove accelerator
It wasn't doing anything.
2018-11-02 12:47:55 -04:00
Behdad Esfahbod 6e06fe162e [kern] Implement Format3
Untested.
2018-11-02 11:56:55 -04:00
Behdad Esfahbod a4a7a62389 [kern] Add buffer message 2018-11-02 11:16:43 -04:00
Behdad Esfahbod 661340c475 [kern] Scale kern pairs before applying
Fixes https://github.com/harfbuzz/harfbuzz/issues/1255
Fixes https://github.com/harfbuzz/harfbuzz/issues/1252
2018-10-16 13:24:29 -07:00
Behdad Esfahbod 62376a7d98 Ignore signed-integer-overflow while kerning
Fixes https://github.com/harfbuzz/harfbuzz/issues/1247
2018-10-14 15:20:50 -07:00
Behdad Esfahbod 5d34164d98 [kern/kerx] Fix offset base
Disable kern Format2.

Fix kerx Format2.  Manually tested this with Tamil MN font and it works:

$ HB_OPTIONS=aat ./hb-shape Tamil\ MN.ttc -u 0B94,0B95
[tgv_au=0+3435|tgc_ka=1@-75,0+1517]

 HB_OPTIONS=aat ./hb-shape Tamil\ MN.ttc -u 0B94,0B95 --features=-kern
[tgv_au=0+3510|tgc_ka=1+1592]
2018-10-10 18:23:09 -04:00
Behdad Esfahbod 0537a40193 [kerx] Comment 2018-10-09 23:37:00 -04:00
Behdad Esfahbod 27db859416 [kern/kerx] Adjust bounds check 2018-10-09 22:55:17 -04:00
Behdad Esfahbod 4df8eb200d [kern] Use kern subtable length for sanitizing in the accelerator 2018-10-09 22:46:12 -04:00
Behdad Esfahbod 8bff1d2994 [kern] Minor 2018-10-09 22:39:31 -04:00
Behdad Esfahbod 210f899aca [kern] Sanitize 4 bytes, not 2 2018-10-09 21:58:04 -04:00
Behdad Esfahbod 977c8a8e5c [kern] Minor 2018-10-09 00:22:08 -04:00
Behdad Esfahbod a51958819f Apply TrueType/OpenType kern table when GPOS kern feature is not available
Fixes https://github.com/harfbuzz/harfbuzz/issues/250
2018-10-08 23:57:45 -04:00
Behdad Esfahbod 3c23ff9b7c [kern] Add kerning driver to TT kern table 2018-10-08 23:26:26 -04:00
Behdad Esfahbod 683c3a9533 [kern] Abstract away kerning machine 2018-10-08 23:09:48 -04:00
Behdad Esfahbod d62b4011cc [kern] Shout less 2018-10-07 22:58:06 -04:00
Behdad Esfahbod 8aa83d97f9 [kern/kerx] Fix Format2 offsetting
"The values in the right class table are stored pre-multiplied by the
number of bytes in a single kerning value, and the values in the left
class table are stored pre-multiplied by the number of bytes in one
row. This eliminates needing to multiply the row and column values
together to determine the location of the kerning value. The array can
be indexed by doing the right- and left-hand class mappings, adding the
class values to the address of the array, and fetching the kerning
value to which the new address points."
2018-10-07 22:45:15 -04:00
Behdad Esfahbod dff2c45f1e Port rest from VAR to UnsizedArrayOf<> 2018-09-11 01:01:08 +02:00
Behdad Esfahbod 9507b05a7a Simplify sanitize->check_array()
Fix a bug in CBDT sanitize, and redundant check in avar.
2018-09-10 23:18:23 +02:00
Behdad Esfahbod 3a0b3a29cc Free up hb-ot-face.hh from includes
There might be a better way to do this, but I couldn't find...
2018-08-26 15:11:24 -07:00
Behdad Esfahbod c77ae40852 Rename hb-*private.hh to hb-*.hh
Sorry for the noise, downstream custom builders.  Please adjust.
2018-08-25 22:36:36 -07:00
Behdad Esfahbod 9583e0077d Port more off of Sanitizer<> 2018-07-22 22:43:25 -07:00
Behdad Esfahbod 2a46a020fd Minor 2018-05-08 02:53:03 -07:00
Behdad Esfahbod eba1c16a60 Always lock blob in sanitize. Remove blob->lock_as() in favor of blob->lock() 2018-05-08 02:47:42 -07:00
Behdad Esfahbod b4fa505014 Move Sanitizer::lock_instance<>() to blob->lock_as<>(). 2018-05-08 02:45:08 -07:00
Ebrahim Byagowi a02c3ee70f Add or update tables specifications links 2018-04-12 13:44:32 +04:30
Ebrahim Byagowi 2a23606339
Fix llvm-gcc-4.2 compile issue and add a macOS bot to test it (#899) 2018-03-23 18:37:01 +04:30
bungeman 85be365ed9 Use KernSubTableFormat2::rightClassTable
Issue originally reported at http://cppfiles.com/chromium.txt .

This fixes what appears to be a copy - paste issue which causes both
KernSubTableFormat2::rightClassTable and the 'right' argument to
KernSubTableFormat2::get_kerning to go unused.
2018-01-26 15:20:18 -08:00
Behdad Esfahbod 6b19178ee3 Prefix int types with HB
Such a headache that Windows defines UINT8, ...; Just prefix it.
2018-01-10 03:07:30 +01:00
Behdad Esfahbod 470fe5b603 [aat] Implement Lookup table
Untested, but compiles.
2018-01-10 02:50:49 +01:00
Behdad Esfahbod 6f335ed1e5 Replace USHORT/SHORT/ULONG/etc with UINT16/INT16/UINT32/etc 2017-11-14 21:06:07 -08:00
Behdad Esfahbod 702d86ba6b [ot] Fold hb_ot_face_kern_accelerator_t 2017-11-14 19:25:51 -08:00
Behdad Esfahbod 8eed9cb11e [kern] Fix invalid memory access if offset is zero
If offset is zero, we return Null() object.  Wasn't prepared for that.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4088
2017-11-09 18:09:40 -08:00
Behdad Esfahbod a615030683 [kern] Implement format-2 kern subtable 2017-11-06 15:40:07 -05:00
Behdad Esfahbod 82a38d1f7a [kern] Allow subtables longer than 64kb
Apparently calibri.ttf does this:
https://github.com/fonttools/fonttools/pull/1094#discussion_r148933791
2017-11-06 15:28:24 -05:00
Behdad Esfahbod 625ae08fce [kern] Towards implementing format-2 2017-11-06 15:06:30 -05:00
Behdad Esfahbod 77acc1106e [kern] More...
Almost there.
2017-11-01 19:40:51 -06:00
Behdad Esfahbod 49c0f35580 [kern] See if this helps with making VS bot happy 2017-11-01 18:16:07 -06:00
Behdad Esfahbod 4c43a23bf4 [kern] Implement Format0 2017-11-01 18:12:26 -06:00
Behdad Esfahbod ac3d937c6c [kern] Implement some more 2017-11-01 17:54:56 -06:00
Behdad Esfahbod 2a16f647ae [kern] Start implementing kern table
Pushing this out early to catch bot errors since I'm using template tricks
we were not using in HarfBuzz before.
2017-11-01 17:32:34 -06:00