Behdad Esfahbod [Wed, 10 Oct 2018 23:20:06 +0000 (19:20 -0400)]
[kerx] When rejecting variable kerning, also check for tupleCount
Behdad Esfahbod [Wed, 10 Oct 2018 23:11:30 +0000 (19:11 -0400)]
[kerx] No-op
Tested that Format0 works with Kannada MN font:
$ make -j5 lib -s && HB_OPTIONS=aat ./hb-shape Kannada\ MN.ttc -u 0C95,0CC2
[kn_ka=0+1000|kn_matra_uu=0@-30,0+1345]
$ make -j5 lib -s && HB_OPTIONS=aat ./hb-shape Kannada\ MN.ttc -u 0C95,0CC2 --features=-kern
[kn_ka=0+1030|kn_matra_uu=0+1375]
Note that GPOS does the same with 'dist' feature, and applies the whole difference to the
same glyph:
$ make -j5 lib -s && ./hb-shape Kannada\ MN.ttc -u 0C95,0CC2
[kn_ka=0+970|kn_matra_uu=0+1375]
$ make -j5 lib -s && ./hb-shape Kannada\ MN.ttc -u 0C95,0CC2 --features=-dist
[kn_ka=0+1030|kn_matra_uu=0+1375]
Behdad Esfahbod [Wed, 10 Oct 2018 23:02:32 +0000 (19:02 -0400)]
Comment
Behdad Esfahbod [Wed, 10 Oct 2018 22:59:07 +0000 (18:59 -0400)]
Fix option string matching
Behdad Esfahbod [Wed, 10 Oct 2018 22:14:41 +0000 (18:14 -0400)]
[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]
Behdad Esfahbod [Wed, 10 Oct 2018 22:10:05 +0000 (18:10 -0400)]
[kerx] Don't loop over kerning subtables if kerning disabled
Behdad Esfahbod [Wed, 10 Oct 2018 21:44:46 +0000 (17:44 -0400)]
Allow HB_OPTIONS=aat to prefer AAT tables over OT
Fixes https://github.com/harfbuzz/harfbuzz/issues/322
Behdad Esfahbod [Wed, 10 Oct 2018 21:32:32 +0000 (17:32 -0400)]
[kerx] Skip variation subtables
Behdad Esfahbod [Wed, 10 Oct 2018 20:32:35 +0000 (16:32 -0400)]
Remove HAVE_OT
We never tested compiling without it. Just kill it. We always build
our own shaper.
Behdad Esfahbod [Wed, 10 Oct 2018 17:24:51 +0000 (13:24 -0400)]
[kerx] Actually hook up, and fix crash
Behdad Esfahbod [Wed, 10 Oct 2018 16:07:49 +0000 (12:07 -0400)]
Add per-subtable set-digests
This speeds up Roboto shaping by ~10%. I was hoping for more.
Still, good defense against lookups with many subtables.
Behdad Esfahbod [Wed, 10 Oct 2018 15:54:48 +0000 (11:54 -0400)]
Move apply down into subtables accel
Behdad Esfahbod [Wed, 10 Oct 2018 15:50:46 +0000 (11:50 -0400)]
Move subtable array into lookup accel
Behdad Esfahbod [Wed, 10 Oct 2018 15:41:05 +0000 (11:41 -0400)]
Move more code
Behdad Esfahbod [Wed, 10 Oct 2018 15:36:28 +0000 (11:36 -0400)]
Move code
In preparation to move add per-subtable set digests...
Behdad Esfahbod [Wed, 10 Oct 2018 14:57:28 +0000 (10:57 -0400)]
Fix GPOS/kern interaction
Oops. Was checking for kern feature in GSUB, not GPOS.
Behdad Esfahbod [Wed, 10 Oct 2018 14:49:45 +0000 (10:49 -0400)]
More rewriting plan compile
Hopefully more clear.
Behdad Esfahbod [Wed, 10 Oct 2018 14:42:10 +0000 (10:42 -0400)]
More reshuffle plan compile
Behdad Esfahbod [Wed, 10 Oct 2018 14:41:08 +0000 (10:41 -0400)]
[kerx] Hook up to shaper
Behdad Esfahbod [Wed, 10 Oct 2018 14:18:39 +0000 (10:18 -0400)]
[kern] Minor
Behdad Esfahbod [Wed, 10 Oct 2018 14:16:09 +0000 (10:16 -0400)]
Apply TT or fallback kerning when GPOS does not have kern feature
Previously we only did if there was no GPOS whatsoever. This applies
to Arial, Times New Roman, etc in Win7. Was not kerning before. It
is now.
Behdad Esfahbod [Wed, 10 Oct 2018 14:04:05 +0000 (10:04 -0400)]
Minor
Ebrahim Byagowi [Wed, 10 Oct 2018 13:42:52 +0000 (17:12 +0330)]
[circleci] Add an iOS bot (#1233)
Behdad Esfahbod [Wed, 10 Oct 2018 03:35:07 +0000 (23:35 -0400)]
[kerx] Comment
Behdad Esfahbod [Wed, 10 Oct 2018 03:27:00 +0000 (23:27 -0400)]
[aat] Rename
Behdad Esfahbod [Wed, 10 Oct 2018 03:18:19 +0000 (23:18 -0400)]
[morx] Use subtable range for embedded sanitizer here as well
Behdad Esfahbod [Wed, 10 Oct 2018 03:17:32 +0000 (23:17 -0400)]
[aat] Fixup recent commit
For
329f2401082011007d9ce12b15ce0225cd267c57
max_ops is signed.
Behdad Esfahbod [Wed, 10 Oct 2018 03:07:47 +0000 (23:07 -0400)]
[kerx] Use subtable range for runtime checks
Behdad Esfahbod [Wed, 10 Oct 2018 03:02:53 +0000 (23:02 -0400)]
[aat] Set embedded sanitizer max ops really high
Since we consume it legitimately during shaping.
Behdad Esfahbod [Wed, 10 Oct 2018 02:57:00 +0000 (22:57 -0400)]
[kerx] Comment
Behdad Esfahbod [Wed, 10 Oct 2018 02:55:47 +0000 (22:55 -0400)]
[kerx] Remove junk
Behdad Esfahbod [Wed, 10 Oct 2018 02:52:41 +0000 (22:52 -0400)]
[kern/kerx] Adjust bounds check
Behdad Esfahbod [Wed, 10 Oct 2018 02:49:33 +0000 (22:49 -0400)]
[kerx] Implement Format2 apply()
Still, not hooked.
Behdad Esfahbod [Wed, 10 Oct 2018 02:46:30 +0000 (22:46 -0400)]
Fix check
Behdad Esfahbod [Wed, 10 Oct 2018 02:46:12 +0000 (22:46 -0400)]
[kern] Use kern subtable length for sanitizing in the accelerator
Behdad Esfahbod [Wed, 10 Oct 2018 02:39:31 +0000 (22:39 -0400)]
[kern] Minor
Behdad Esfahbod [Wed, 10 Oct 2018 02:35:22 +0000 (22:35 -0400)]
[kerx] Implement Format0 apply()
Not hooked up to be called yet.
Behdad Esfahbod [Wed, 10 Oct 2018 02:25:53 +0000 (22:25 -0400)]
Minor
Behdad Esfahbod [Wed, 10 Oct 2018 01:56:37 +0000 (21:56 -0400)]
[kern] Sanitize 4 bytes, not 2
Behdad Esfahbod [Tue, 9 Oct 2018 20:24:50 +0000 (16:24 -0400)]
[ft] Use mutex to lock access to FT_Face
Makes our FT-backed hb_font_t safe to use from multiple threads. Still,
the underlying FT_Face should NOT be used from other threads by client
or other libraries.
Maybe I add a lock()/unlock() public API ala PangoFT2 and cairo-ft.
Maybe not.
Behdad Esfahbod [Tue, 9 Oct 2018 20:07:55 +0000 (16:07 -0400)]
[ft] Remove (probably) stale comment
Behdad Esfahbod [Tue, 9 Oct 2018 19:55:26 +0000 (15:55 -0400)]
Minor
Behdad Esfahbod [Tue, 9 Oct 2018 19:39:51 +0000 (15:39 -0400)]
Install ot-funcs on newly created funcs
**Finally**! Casual users can stop caring about font-funcs completely now,
like they haven't been needing to care re unicode-funcs for a few years.
Behdad Esfahbod [Tue, 9 Oct 2018 19:12:09 +0000 (15:12 -0400)]
[ot-font] Don't pre-load cmap table
Now that we have get_h_advances() and get_nominal_glyphs() implemented, the
overhead of doing a proper atomic load would be once per run, NOT once per
glyph. So, no need to pre-load the tables to avoid that overhead.
As such, hb_ot_font_set_funcs() has become really cheap. Can *finally* make
it be default font functions on all newly created fonts!
Behdad Esfahbod [Tue, 9 Oct 2018 19:07:04 +0000 (15:07 -0400)]
[ot/ft] Implement get_nominal_glyphs() callback
Some more measurable speedup. The recent commits' speedups are as follows:
Testing with Roboto, ****when disabling kern and liga****:
Before:
FT --features=-kern,-liga
user↦ 0m0.521s
OT --features=-liga,-kern
user↦ 0m0.568s
After:
FT --features=-liga,-kern
user↦ 0m0.428s
OT --features=-liga,-kern
user↦ 0m0.470s
So, 17% speedup.
Note that FT callbacks are faster than OT these days since we added an advance
cache to FT. I don't think the difference is enough to justify adding a cache
to OT.
When not disabling kern, the thing is three times slower, so the speedups
are three times less impressive... Still, 5% not bad for a codebase that I
otherwise thought is optimized out.
Note that, because of this and other optimiztions in our main shaper,
disabling kern and liga, the OT shaper is now *faster* than the fallback
shaper. So, that's my recommendation to clients that need the absolute
fastest...
Behdad Esfahbod [Tue, 9 Oct 2018 18:50:57 +0000 (14:50 -0400)]
Call get_nominal_glyphs() for runs of simple clusters at a time
Even without FT or OT font funcs implementing get_nominal_glyphs(), there's measurable
speedup.
Behdad Esfahbod [Tue, 9 Oct 2018 18:38:23 +0000 (14:38 -0400)]
Whitespace
Behdad Esfahbod [Tue, 9 Oct 2018 18:37:08 +0000 (14:37 -0400)]
Avoid sort and recompose stages if all clusters simple
Even has measurable speedup...
Behdad Esfahbod [Tue, 9 Oct 2018 18:36:25 +0000 (14:36 -0400)]
Fix warning
How come this one is not generated by clang everything bot?!
../../../test/api/test-multithread.c:37:26: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
static char *font_path = "fonts/Inconsolata-Regular.abc.ttf";
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../test/api/test-multithread.c:38:21: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
Behdad Esfahbod [Tue, 9 Oct 2018 18:33:24 +0000 (14:33 -0400)]
Rewrite main normalizer loop to isolate runs of simple clusters
Behdad Esfahbod [Tue, 9 Oct 2018 18:12:59 +0000 (14:12 -0400)]
Inline decompose_cluster
Towards separating the common case into its own loop.
Behdad Esfahbod [Tue, 9 Oct 2018 13:23:51 +0000 (09:23 -0400)]
[font] Add get_nominal_glyphs() callback (note the plural)
Unused as of now. To be wired up to normalizer, which would remove
overhead and allow hb-ot-font initialization to become a no-op, so
we can enable it by default.
Behdad Esfahbod [Tue, 9 Oct 2018 13:06:07 +0000 (09:06 -0400)]
Minor
Chun-wei Fan [Wed, 25 Jul 2018 10:26:10 +0000 (18:26 +0800)]
test/api/test-subset-*.c: Fix build on pre-C99
Ensure that we have the variables at the beginning of the block. These
are the only fixes that we need for building HarfBuzz on older
compilers.
Chun-wei Fan [Wed, 25 Jul 2018 10:12:34 +0000 (18:12 +0800)]
builds: Fix and clean up MSVC DLL builds
Instead of passing a CFLAG/CXXFLAG to define HB_EXTERN, define it
directly in src/hb.hh as __declspec(dllexport) extern when we are
building HarfBuzz as DLLs on Visual Studio. Define HB_INTERNAL
as nothing without defining HB_NO_VISIBILITY when building HarfBuzz as
DLLs to avoid linker errors on Visual Studio builds.
Also "install" harfbuzz-subset.dll into $(PREFIX)\bin as the
hb-subset utility will depend on that DLL at runtime, when HarfBuzz is
built as DLLs. Since it consists of private APIs that are subject to
change, we do not install its headers nor .lib file.
Behdad Esfahbod [Tue, 9 Oct 2018 12:28:07 +0000 (08:28 -0400)]
Another old bot fix
Behdad Esfahbod [Tue, 9 Oct 2018 12:20:10 +0000 (08:20 -0400)]
Try fixing older bots
Behdad Esfahbod [Tue, 9 Oct 2018 12:01:49 +0000 (08:01 -0400)]
Add const to get_*_advances API
Ouch!
Behdad Esfahbod [Tue, 9 Oct 2018 11:48:52 +0000 (07:48 -0400)]
Port test off deprecated API
Behdad Esfahbod [Tue, 9 Oct 2018 05:10:15 +0000 (01:10 -0400)]
Minor
Behdad Esfahbod [Tue, 9 Oct 2018 05:07:36 +0000 (01:07 -0400)]
[icu] Unbreak
Behdad Esfahbod [Tue, 9 Oct 2018 05:05:28 +0000 (01:05 -0400)]
Remove test for deprecated hb_set_invert()
Behdad Esfahbod [Tue, 9 Oct 2018 04:56:33 +0000 (00:56 -0400)]
Properly remove deprecated stuff
Behdad Esfahbod [Tue, 9 Oct 2018 04:39:42 +0000 (00:39 -0400)]
Remove deprecated decompose_compatibility stuff
Behdad Esfahbod [Tue, 9 Oct 2018 04:33:30 +0000 (00:33 -0400)]
Remove deprecated eastasian_width
Behdad Esfahbod [Tue, 9 Oct 2018 04:30:45 +0000 (00:30 -0400)]
[ft/ot] Remove implementation of deprecated kerning funcs
Behdad Esfahbod [Tue, 9 Oct 2018 04:22:08 +0000 (00:22 -0400)]
[kern] Minor
Behdad Esfahbod [Tue, 9 Oct 2018 04:20:35 +0000 (00:20 -0400)]
[kern] Minor
Behdad Esfahbod [Tue, 9 Oct 2018 04:01:09 +0000 (00:01 -0400)]
Deprecate font kern API
Behdad Esfahbod [Tue, 9 Oct 2018 03:57:45 +0000 (23:57 -0400)]
Apply TrueType/OpenType kern table when GPOS kern feature is not available
Fixes https://github.com/harfbuzz/harfbuzz/issues/250
Behdad Esfahbod [Tue, 9 Oct 2018 03:30:24 +0000 (23:30 -0400)]
Separate fallback kern vs mark positioning
Behdad Esfahbod [Tue, 9 Oct 2018 03:26:26 +0000 (23:26 -0400)]
[kern] Add kerning driver to TT kern table
Behdad Esfahbod [Tue, 9 Oct 2018 03:09:48 +0000 (23:09 -0400)]
[kern] Abstract away kerning machine
Behdad Esfahbod [Tue, 9 Oct 2018 02:44:16 +0000 (22:44 -0400)]
Add HB_DEPRECATED
Fixes https://github.com/harfbuzz/harfbuzz/issues/1232
Behdad Esfahbod [Tue, 9 Oct 2018 02:41:08 +0000 (22:41 -0400)]
[kerx] Process coverage flags
Behdad Esfahbod [Tue, 9 Oct 2018 02:31:35 +0000 (22:31 -0400)]
Deprecate decompose_compatibility stuff
Behdad Esfahbod [Tue, 9 Oct 2018 02:26:39 +0000 (22:26 -0400)]
Deprecate eastasian_width stuff
Behdad Esfahbod [Mon, 8 Oct 2018 20:41:08 +0000 (16:41 -0400)]
Minor
Behdad Esfahbod [Mon, 8 Oct 2018 20:32:44 +0000 (16:32 -0400)]
Minor
Behdad Esfahbod [Mon, 8 Oct 2018 20:10:54 +0000 (16:10 -0400)]
[test/text-rendering-tests] Update from upstream
Behdad Esfahbod [Mon, 8 Oct 2018 03:08:39 +0000 (23:08 -0400)]
[kerx] Minor
Behdad Esfahbod [Mon, 8 Oct 2018 02:58:06 +0000 (22:58 -0400)]
[kern] Shout less
Behdad Esfahbod [Mon, 8 Oct 2018 02:52:53 +0000 (22:52 -0400)]
[kerx] Clean up Format2
Behdad Esfahbod [Mon, 8 Oct 2018 02:43:59 +0000 (22:43 -0400)]
[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."
Behdad Esfahbod [Mon, 8 Oct 2018 02:33:41 +0000 (22:33 -0400)]
[kerx] Clean up Format0
Behdad Esfahbod [Mon, 8 Oct 2018 02:30:42 +0000 (22:30 -0400)]
Support HBUINT32 BinSearchArrayOf
Behdad Esfahbod [Mon, 8 Oct 2018 02:28:45 +0000 (22:28 -0400)]
Move code
Behdad Esfahbod [Mon, 8 Oct 2018 02:27:00 +0000 (22:27 -0400)]
[aat] Rename
Behdad Esfahbod [Mon, 8 Oct 2018 00:46:11 +0000 (20:46 -0400)]
Rename invisible_codepoint to invisible_glyph in API
Deleted recently added API:
hb_buffer_set_invisible_codepoint()
hb_buffer_get_invisible_codepoint()
hb-shape / hb-view --invisible-codepoint
New API:
hb_buffer_set_invisible_glyph()
hb_buffer_get_invisible_glyph()
hb-shape / hb-view --invisible-glyph
Fixes https://github.com/harfbuzz/harfbuzz/issues/1216
Behdad Esfahbod [Mon, 8 Oct 2018 00:36:46 +0000 (20:36 -0400)]
Revert "[morx] Fix MORX-35"
This reverts commit
f62f6e90ad1f1a83f77771ad65ee1ffb79470a8a.
Behdad Esfahbod [Mon, 8 Oct 2018 00:35:06 +0000 (20:35 -0400)]
[buffer] Improve shift_forward()
"Improve" is a strong word in this case though, I understand.
Behdad Esfahbod [Sun, 7 Oct 2018 22:06:53 +0000 (18:06 -0400)]
[morx] Fix MORX-35
Fixes https://github.com/harfbuzz/harfbuzz/issues/1224
Behdad Esfahbod [Sun, 7 Oct 2018 22:52:12 +0000 (18:52 -0400)]
Remove some code
We use scratch-flags to short-circuit this function. No need for previous
early loop.
Behdad Esfahbod [Sun, 7 Oct 2018 22:00:14 +0000 (18:00 -0400)]
[test/text-rendering-tests] Update from upstream
Behdad Esfahbod [Sun, 7 Oct 2018 18:01:33 +0000 (14:01 -0400)]
[kerx] Clean up kerx and KerxTable structures
Behdad Esfahbod [Sun, 7 Oct 2018 16:41:52 +0000 (18:41 +0200)]
Add API for setting invisible-codepoint
Fixes https://github.com/harfbuzz/harfbuzz/issues/1216
New API:
hb_buffer_set_invisible_codepoint()
hb_buffer_get_invisible_codepoint()
hb-shape / hb-view --invisible-codepoint
Behdad Esfahbod [Sun, 7 Oct 2018 16:23:45 +0000 (18:23 +0200)]
[ot-font] Load hmtx/vmtx lazily
Since we have get_*_advanes() API now, the overhead is once per shape,
not once per glyph.
Only cmap is warmed-up at set_funcs() time now.
Behdad Esfahbod [Sun, 7 Oct 2018 16:21:15 +0000 (18:21 +0200)]
Minor
Behdad Esfahbod [Sun, 7 Oct 2018 15:51:50 +0000 (17:51 +0200)]
Minor
Behdad Esfahbod [Sun, 7 Oct 2018 14:31:33 +0000 (16:31 +0200)]
[coretext] Fix OS X check
Fixes https://github.com/harfbuzz/harfbuzz/issues/1230