Commit Graph

4905 Commits

Author SHA1 Message Date
Behdad Esfahbod 6ddd669e20 [khmer] Clear syllables before presentation features
Probably not what Uniscribe does, but good idea?
2018-07-31 13:40:22 -07:00
Behdad Esfahbod 8eef1964a7 [khmer] Revert previous change, and remove pauses
This makes test suite happy again (at 44) while fixing the sequences
we were fixing, which were the following with KhmerUI.ttf:

  U+1789,U+17BC
  U+1789,U+17D2,U+1789
  U+1789,U+17D2,U+1789,U+17BC

Fixes rest of https://github.com/harfbuzz/harfbuzz/issues/974
2018-07-31 13:40:17 -07:00
Behdad Esfahbod 7c658ea2f2 [khmer] Apply ccmp after basic features
Part of https://github.com/harfbuzz/harfbuzz/issues/974
2018-07-31 12:49:02 -07:00
Behdad Esfahbod 1a96cc825d [khmer] Rewrite most of shaper to better follow spec
Khmer spec has only one reordering phase, and only simple prebase
matra and Coeng-Ro reordering.  Implement that.  Specifically,
this was done to address recognizing different orders of the matra
and Coeng-Ro sequence.  That said, some combinations are now
reordered differently from Uniscribe.  Not clear if that's intended
or a bug in Uniscribe.  The following two sequences render the same
in Uniscribe whereas we reorder them differently:

  U+17A0,U+17D2,U+179A,U+17C2
  U+17A0,U+17C2,U+17D2,U+179A

For that reason, our test suite numbers regressed slightly.  Used
to be at 34 for fails, now at:

KHMER: 299080 out of 299124 tests passed. 44 failed (0.0147096%)

But generally a good change, and removed lots of code.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1026
2018-07-31 11:45:32 -07:00
Behdad Esfahbod f5152cea42 [shaper] Move code around 2018-07-31 01:27:04 -07:00
Behdad Esfahbod 36d0fbbc52 [shaper] Remove a macro 2018-07-31 01:15:04 -07:00
Behdad Esfahbod b1e5650c67 [atomic] Make pointer get op relaxed instead of acquire
We only use it before cmpexch, so relaxed is fine and faster for
common case.
2018-07-31 01:02:31 -07:00
Behdad Esfahbod 66ccd8ac40 [serialize] Increase stage count from 8 to 32
Indic shaper uses many stages.  Now we are provably not limiting
functionality whereas the previous limit of 8 was assuming real-world
practices.
2018-07-30 17:03:06 -07:00
Behdad Esfahbod ee8cf91965 [serialize] Remove unused truncate() method 2018-07-30 16:59:41 -07:00
Garret Rieger 5edf454aa6 [subset] During lookup collection remember the features we've already processed. 2018-07-27 17:29:00 -07:00
Behdad Esfahbod 42c183f803 Minor 2018-07-27 14:55:29 -07:00
Behdad Esfahbod ecab6604e5 [serialize] Allocate for markFilteringSet 2018-07-27 14:54:15 -07:00
Behdad Esfahbod 7f08818c44 Minor 2018-07-27 14:54:15 -07:00
prrace 2e25d8f491 Fix unlikely leaks 2018-07-27 14:54:08 -07:00
Behdad Esfahbod 3c2842cbcf Add hb-iter-private.hh
Unused so far.
2018-07-25 17:07:17 -07:00
Behdad Esfahbod 92b1e025c6 Move some code from hb-open-type-private.hh to hb-machinery-private.hh 2018-07-25 16:58:47 -07:00
Behdad Esfahbod 6b11fea997 [closure] Allocate out set on the stack 2018-07-25 16:01:37 -07:00
Behdad Esfahbod 74467b7901 Fix compile 2018-07-25 14:30:07 -07:00
Behdad Esfahbod bf90f35302 [coretext] Add note 2018-07-25 13:57:24 -07:00
Garret Rieger fb58cb4b5c [subset] Only used reachable lookups for gsub closure. 2018-07-25 13:56:58 -07:00
Behdad Esfahbod c38bd4025f [closure] Separate in and out glyphs
Fixes https://github.com/harfbuzz/harfbuzz/issues/1107
2018-07-24 13:47:32 -07:00
Garret Rieger 85646fdadb [subset] Limit the iterations of the closure algorithm.
Prevents O(n^2) run times.
2018-07-23 16:01:57 -07:00
Behdad Esfahbod 94759d4cf8 Fix visibility on mingw32
Should fix bots again.
2018-07-23 15:08:32 -07:00
Behdad Esfahbod 61eddbd8ef Fix infinite loop in loading num_glyphs within sanitizer 2018-07-23 14:44:10 -07:00
Behdad Esfahbod e22a48ac95 One more visibility trick
Should fix Windows build again.
2018-07-23 13:24:26 -07:00
Behdad Esfahbod e57a638bde One more 2018-07-23 12:00:02 -07:00
Behdad Esfahbod 36ed163fdd Remove unnecessary OT:: namespace specifiers 2018-07-23 11:57:45 -07:00
Behdad Esfahbod c6bc7c3831 Set num glyphs on sanitizer reference_table()
Move out-of-class definitions of two methods to hb-static so they
are accessible in libharfbuzz-subset.
2018-07-23 11:46:46 -07:00
Behdad Esfahbod 9401829d4e Remove Sanitizer<> 2018-07-22 22:50:58 -07:00
Behdad Esfahbod 8e3e41272b Port rest of code away from Sanitizer<> 2018-07-22 22:49:26 -07:00
Behdad Esfahbod d6a8f64045 Port dump-emoji away from Sanitizer<> 2018-07-22 22:47:19 -07:00
Behdad Esfahbod 14f78d2b3b . 2018-07-22 22:45:26 -07:00
Behdad Esfahbod 4547051f48 Minor 2018-07-22 22:44:22 -07:00
Behdad Esfahbod 740ae27d5c Port sbix off of Sanitizer<> 2018-07-22 22:43:25 -07:00
Behdad Esfahbod 9583e0077d Port more off of Sanitizer<> 2018-07-22 22:43:25 -07:00
Behdad Esfahbod e7737b41d7 Add sanitizer reference_table, also fix clang build
Clang is being really peculiar.  Fix with:

-  inline hb_blob_t *sanitize (hb_blob_t *blob) { return c->sanitize<Type> (blob); }
+  inline hb_blob_t *sanitize (hb_blob_t *blob) { return c[0].template/*clang idiosyncrasy*/sanitize_blob<Type> (blob); }
2018-07-22 22:24:31 -07:00
David Corbett 62fa7cd1cc Order Chakma split vowels in accordance with NFC
Fixes #1105.
2018-07-22 19:47:21 -07:00
Ebrahim Byagowi 0c1b287b72
Add a new API, hb_ot_layout_get_feature_name_ids (#976)
This new API returns cvXX and ssXX related NameId, things like
featUiLabelNameId, featUiTooltipTextNameId, sampleTextNameId, ... of cvXX
and UINameId of ssXX, in a unified way.

However HarfBuzz currently doesn't expose an API for retrieving the actual
information associated with NameId from the `name` table and that should be
done separately.
2018-07-21 21:14:48 +04:30
Ebrahim Byagowi 93b65d9fe3
Remove dump-fon (#1100)
It had interesting stuffs like EXE parsing and
big-endian parsers but added in an attempt to find
a solution for #681 which later found not related.
2018-07-17 23:29:16 +04:30
Ebrahim Byagowi d5cd47a69c
Remove AAT's gcid/fmtx (#1099)
We are not going to use them, at least in the foreseeable future
2018-07-17 22:32:37 +04:30
Behdad Esfahbod 1e9e344b2b Fix hb_face_count() sanitize referencing 2018-07-17 19:17:59 +02:00
Behdad Esfahbod a8cc0b5907 Remove TODO that is not gonna be done
Previously the idea was to cache sanitize results externally (think,
in Fontconfig) and avoid resanitizing every time.  That's, not a good
idea.
2018-07-17 19:09:03 +02:00
Behdad Esfahbod be70738400 Move sanitizer code around a bit 2018-07-17 18:51:59 +02:00
Behdad Esfahbod db5d430eff [aat] Update for blob changes
Also, uncomment code again, just "if (0)" it out, so it doesn't get stale again.
2018-07-17 18:14:45 +02:00
Behdad Esfahbod 68310a65cb 1.8.4 2018-07-17 13:20:40 +02:00
Behdad Esfahbod 04b7b81bcb Reland "Implement C++11-style GCC builtin atomic ops"
Fixed the crasher in it.
2018-07-17 11:02:38 +02:00
Behdad Esfahbod 019d18e9ae Minor 2018-07-17 11:00:24 +02:00
Behdad Esfahbod 3edef5a19b Revert "Implement C++11-style GCC builtin atomic ops"
This reverts commit 21fa170f0b.

Is crashing.  Oops.
2018-07-17 10:50:01 +02:00
Behdad Esfahbod 21fa170f0b Implement C++11-style GCC builtin atomic ops
Hopefully fixes bots.
2018-07-16 17:58:02 +02:00
Behdad Esfahbod 804b59cf49 Relax C++11 atomic ops memory order to acquire-release 2018-07-16 15:45:22 +02:00
Behdad Esfahbod bda242409f Implement C++11 <atomic> operations
Fixes https://github.com/harfbuzz/harfbuzz/issues/345
2018-07-16 15:45:22 +02:00
Behdad Esfahbod 2aae617a84 Move _hb_alignof later again
It uses constexpr...
2018-07-11 17:27:23 +02:00
Behdad Esfahbod f3a74c16ec Make hb_vector_t 8 bytes smaller 2018-07-11 17:23:53 +02:00
Behdad Esfahbod 44999f8b75 Align NullPool and CrapPool to HB_VECTOR_SIZE 2018-07-11 17:21:32 +02:00
Behdad Esfahbod 20a318d06a Fix return type of alignof() fallback 2018-07-11 17:00:13 +02:00
Behdad Esfahbod 2b76767bf5 1.8.3 2018-07-11 15:27:13 +02:00
Behdad Esfahbod 718dfd4189 Fix shift 2018-07-10 16:34:31 +02:00
Behdad Esfahbod 25aa411ac5 Put back include dependencies 2018-07-10 16:05:03 +02:00
Behdad Esfahbod 491d93bf74 Move more stuff from hb-private.hh to hb-dsalgs.hh 2018-07-10 16:03:31 +02:00
Behdad Esfahbod f477765661 Move more stuff to hb-dsalgs.hh 2018-07-10 15:49:05 +02:00
Behdad Esfahbod be7f664f72 Move hb_bytes_t to hb-dsalgs.hh 2018-07-10 15:23:08 +02:00
Behdad Esfahbod 7a00f7eb2e Remove hb_auto_array_t 2018-07-10 14:42:10 +02:00
Behdad Esfahbod be458eb059 Include more basic internal headers from hb-private.hh 2018-07-10 14:41:04 +02:00
Behdad Esfahbod bddeb2b10c Minor renamings of internal inline functions 2018-07-10 14:13:21 +02:00
Behdad Esfahbod d652ef299d Move hb_vector_t and hb_lockable_set_t to hb-dsalgs.hh 2018-07-10 14:05:00 +02:00
Behdad Esfahbod 9e53b08329 Move hb_stable_sort to hb-dsalgs.hh
Also, include hb-dsalgs.hh from end of hb-pricate.hh
2018-07-10 14:03:58 +02:00
Behdad Esfahbod 39f11d8e72 Minor 2018-07-10 14:01:39 +02:00
Behdad Esfahbod 763f878cc0 Fix syntax
Oops.
2018-07-10 13:47:41 +02:00
Behdad Esfahbod 83ea277178 Add posix_memalign() fallback 2018-07-10 13:17:27 +02:00
Behdad Esfahbod 292c100d61 Always compile (but not use) alignof() and round() fallback codes
Catches compile-errors in them better.
2018-07-10 13:16:52 +02:00
Behdad Esfahbod 27c5317d91 Fix alignof impl 2018-07-10 13:03:42 +02:00
Behdad Esfahbod bca83618cd Add fallback implementation for constexpr and alignof 2018-07-10 12:59:13 +02:00
Behdad Esfahbod 7cb47d0f3f Minor 2018-07-10 12:59:13 +02:00
Cosimo Lupo ccdd156554
src/Makefile.am: pass headers to gen-def.py as arguments, not env vars 2018-07-09 18:26:44 +01:00
Cosimo Lupo e3a931ef0b
gen-def.py: pass headers as arguments so that msys2 can convert posix paths
When one is not using the msys2 python, the header files that are passed in as environment
variable cannot be found.

https://ci.appveyor.com/project/fonttools/ttfautohint-py/build/1.0.65/job/rkremny4jjid9nl2#L803

This is because msys2 shell and make use POSIX paths (e.g. /c/Users/clupo/...)
whereas non-msys2 python.exe uses native Windows paths (e.g. C:\Users\clupo\...).

Msys2 will automatically convert command line arguments (but not environment variables) from
POSIX to Windows paths when calling a native win32 executable, so we pass the header paths
as arguments instead of environment variables.

This way the gen-def.py script can support both mingw python running in an MSYS2 shell, and
native win32 python.
2018-07-09 18:11:33 +01:00
David Corbett 46d8f0d552 Do not enforce a native direction of LTR for Runic
Fixes #481
2018-07-08 17:18:25 +04:30
David Corbett 936dadc661 Regenerate the USE table for Grantha and Bhaiksuki (#1090)
Completes #1037 and fixes #1035.
2018-07-07 19:38:17 +04:30
Behdad Esfahbod 1ebaa090d8 Disable vectorization
Disable vectorization for now.  To correctly use them, we should
use posix_memalign() to allocate them.  Otherwise, can cause
misaligned access.

https://bugs.chromium.org/p/chromium/issues/detail?id=860184
2018-07-05 14:04:13 +04:30
Behdad Esfahbod 18a06f8a66 Fix warning
../../src/hb-ot-layout-gsubgpos-private.hh:391:18: warning: missed loop optimization, the loop counter may overflow [-Wunsafe-loop-optimizations]
2018-07-05 14:03:48 +04:30
Behdad Esfahbod 058708a665 Allow disabling vector_size use 2018-07-05 13:16:00 +04:30
Ebrahim Byagowi d8a7dedc83
Use CreateFileW explicitly and pass wchar_t to it (#1087) 2018-07-04 15:33:39 +04:30
Behdad Esfahbod 9940504e93 [indic] Adjust left-matra repositioning and Halant,ZWJ sequence
From the new code (first paragraph is from the OT Devanagari spec.):

  /*   o Reorder matras:
   *
   *     If a pre-base matra character had been reordered before applying basic
   *     features, the glyph can be moved closer to the main consonant based on
   *     whether half-forms had been formed. Actual position for the matra is
   *     defined as “after last standalone halant glyph, after initial matra
   *     position and before the main consonant”. If ZWJ or ZWNJ follow this
   *     halant, position is moved after it.
   *
   * IMPLEMENTATION NOTES:
   *
   * It looks like the last sentence is wrong.  Testing, with Windows 7 Uniscribe
   * and Devanagari shows that the behavior is best described as:
   *
   * "If ZWJ follows this halant, matra is NOT repositioned after this halant.
   *  If ZWNJ follows this halant, position is moved after it."
   *
   * Test case, with Adobe Devanagari or Nirmala UI:
   *
   *   U+091F,U+094D,U+200C,U+092F,U+093F
   *   (Matra moves to the middle, after ZWNJ.)
   *
   *   U+091F,U+094D,U+200D,U+092F,U+093F
   *   (Matra does NOT move, stays to the left.)

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

Test case added with Adobe Devanagari.
2018-07-03 14:34:38 +04:30
Behdad Esfahbod 2cb075fe26 Fix unused function '_hb_mapped_file_destroy' if no mmap 2018-07-03 13:04:05 +04:30
Behdad Esfahbod 343e8c694b 1.8.2 2018-07-03 12:43:59 +04:30
Behdad Esfahbod 29e7879bcf Disable .dfont code for now
The get_table imple was wrong, as table offsets in a dfont are
relative to the resource.  We were treating them as relative to
the big blob itself.  To be fixed.

Part of https://github.com/harfbuzz/harfbuzz/pull/1085
2018-07-03 12:38:21 +04:30
Ebrahim Byagowi 32348a43c1
Fix trak table apply logic
In collaboration with Behdad
2018-07-01 15:32:43 +04:30
Ebrahim Byagowi 225b92b7d4
Support dfont font files (#949) 2018-07-01 14:32:00 +04:30
Ebrahim Byagowi 5d8cafcf6a
Improve nommap naming and use C style comments on create_from_file (#1084) 2018-07-01 01:54:14 +04:30
Behdad Esfahbod d3c0980ac2 Adjust MarkBasePos heuristic in presence of MultipleSubst
From the issue:
"In this font, the virama,ya first forms a ligature, then decomposes back to
virama,ya. This causes those two to be marked parts of a MultipleSubst
sequence. When attaching the matra, we look for the first of the MultipleSubst
sequence because that's where we attach to (because of eg #740). In this case,
the first glyph in the MultipleSubst sequence is a mark, so we skip it and
attach to the base char before it."

Font in question is Nirmala UI from Windows 10. Test sequence:

  U+0926,U+094D,U+092F,U+0941

Fixes https://github.com/harfbuzz/harfbuzz/issues/1020
2018-06-30 15:59:25 +04:30
Behdad Esfahbod 8b9cbe3b24 [indic] Tweak for old-spec Bengali and halant-ya-halant
Fixes https://github.com/harfbuzz/harfbuzz/issues/1073
2018-06-30 12:28:39 +04:30
punchcutter 9541c9dae1 Rebase and update USE overrides for Bhaiksuki Gap Fillers and Grantha Anusvara 2018-06-30 10:02:34 +04:30
Behdad Esfahbod 7b8dfac560 [khmer] Fix infinite-loop in cluster merging
Indic shaper already had this check.  We removed it when forking
Khmer shaper by mistake.

Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1464623
2018-06-30 09:16:54 +04:30
Ebrahim Byagowi 25970a93aa
armcc compatibility, don't use EINTR if doesn't exist
Fixes #1081
2018-06-28 14:32:36 +04:30
Ebrahim Byagowi 8a51f91b70
Minor on hb_blob_create_from_file, reuse ferror result
Oops
2018-06-28 13:22:21 +04:30
Ebrahim Byagowi 7b4099f35f
Minor, rename blob to data on blob_from_file 2018-06-27 16:54:44 +04:30
Ebrahim Byagowi fa090ed4d4
Minor touches on hb_blob_create_from_file (#1079)
* Handle EINTR on fallback reader
* Increase fallback reader limitation size limitation to 2 << 28
* Ensure _O_BINARY does exist if MMAP is used on Windows
  (maybe superfluous but makes me more confident)
2018-06-27 14:13:26 +04:30
Behdad Esfahbod 01dff1ea1a Make round() fallback portable to systems that do have round()
Makes compiling without HAVE_ROUND on systems that do have it work.
2018-06-26 18:00:58 -04:00
Ebrahim Byagowi 7db2e9ea38
Minor on hb_blob_create_from_file
Add one more "unlikely" annotation and use explicit nullptr check for more consistency.
2018-06-26 10:46:10 +04:30
Ebrahim Byagowi 35ce8f31d3
Unify our pipe reader with the fallback reader (#1068)
And assign one bot to use the path always using NOMMAPFILEREADER token.

It's limited to 200mb so no more fun with using /dev/zero on hb-view!
2018-06-25 22:23:43 +04:30
Behdad Esfahbod b2a1879187 In Coverage iterator, bail out if table smells
In particular, if CoverageFormat2 has unsorted ranges, bail out.
Otherwise, 64k ranges of each 64k glyphs can DoS closure() method.

We can do the same for CoverageFormat1, but that one does not expose
the quadratic behavior, so, fine.
2018-06-23 10:32:28 -04:00