Commit Graph

5167 Commits

Author SHA1 Message Date
David Corbett c2a75e07e5 Implement 'rand' 2018-09-11 10:47:59 +02:00
Michiharu Ariza c6f75c3049 fix build attempt 2018-09-10 17:02:31 -07:00
Behdad Esfahbod 96471fe859 [uniscribe] Fix build 2018-09-11 01:39:23 +02:00
Michiharu Ariza cc52e53cf0 Removed unused subr subset code 2018-09-10 16:27:49 -07:00
Behdad Esfahbod becd84aa2f Add HB_FEATURE_GLOBAL_START/END
Fixes https://github.com/harfbuzz/harfbuzz/issues/1141

New API:
HB_FEATURE_GLOBAL_START
HB_FEATURE_GLOBAL_END
2018-09-11 01:27:25 +02:00
Behdad Esfahbod 13a8786c7c Add (unused) hb_array_t<> 2018-09-11 01:09:07 +02:00
Behdad Esfahbod bccf3e1827 Minor 2018-09-11 01:04:50 +02:00
Behdad Esfahbod dff2c45f1e Port rest from VAR to UnsizedArrayOf<> 2018-09-11 01:01:08 +02:00
Michiharu Ariza 1666b89e30 subset CFF1 String Index
Repurposed FDMap as Remap then subclassed for remapping SIDs
misc code cleanup
2018-09-10 16:00:20 -07: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 bc485a9812 Port some VAR arrays to UnsizedArrayOf<>
Fix avar sanitize().
2018-09-10 23:08:18 +02:00
Behdad Esfahbod 1bc7a8d6c4 [indic] Cache hb_options().uniscribe_bug_compatible on indic_plan 2018-09-10 22:51:26 +02:00
Behdad Esfahbod 24f1d96224 Unbreak HB_OPTIONS
Fixes https://github.com/harfbuzz/harfbuzz/issues/1154
2018-09-10 18:19:37 +02:00
Behdad Esfahbod e46c51f1e9 [indic] Do NOT allow matra after Halant,ZWJ
Fixes https://github.com/harfbuzz/harfbuzz/issues/556

Devanagari regresses 12 tests, and Gujarati 2.  See:

  https://github.com/harfbuzz/harfbuzz/issues/556#issuecomment-419957472

New numbers:

BENGALI: 353725 out of 354188 tests passed. 463 failed (0.130722%)
DEVANAGARI: 707299 out of 707394 tests passed. 95 failed (0.0134296%)
GUJARATI: 366353 out of 366457 tests passed. 104 failed (0.0283799%)
GURMUKHI: 60729 out of 60747 tests passed. 18 failed (0.0296311%)
KANNADA: 951300 out of 951913 tests passed. 613 failed (0.0643966%)
MALAYALAM: 1048136 out of 1048334 tests passed. 198 failed (0.0188871%)
ORIYA: 42327 out of 42329 tests passed. 2 failed (0.00472489%)
SINHALA: 271596 out of 271847 tests passed. 251 failed (0.0923313%)
TAMIL: 1091754 out of 1091754 tests passed. 0 failed (0%)
TELUGU: 970555 out of 970573 tests passed. 18 failed (0.00185457%)
2018-09-10 17:38:19 +02:00
Behdad Esfahbod 5dfd6e0762 Fix sanitize or Context Rule
Fixes https://github.com/harfbuzz/harfbuzz/issues/1110
2018-09-10 15:45:32 +02:00
Behdad Esfahbod 20a11a824d Revert "[subset] Disable GSUB/GPOS subsetting for now"
This reverts commit 616fd34a69.
2018-09-10 13:56:28 +02:00
Behdad Esfahbod 54d332dd9b 1.9.0 2018-09-10 11:37:24 +02:00
Behdad Esfahbod 616fd34a69 [subset] Disable GSUB/GPOS subsetting for now
So I can get a release out.  I haven't debugged those yet, and they
are producing bad tables.
2018-09-10 11:19:49 +02:00
Behdad Esfahbod d42f0e5809 [atomic] Fix pointer type passed to InterlockedExchangeAdd()
John Emmas reported on mailing list that build with MSVC is failing.
Not sure why bots don't catch it, but this should fix.
2018-09-10 11:05:33 +02:00
Behdad Esfahbod fda994e1d4 Use enum instead of "static const" in class scope
Technically, static const needs an out-of-class definition.  Eg:

  CXXLD    libharfbuzz-subset.la
Undefined symbols for architecture x86_64:
  "OT::FeatureVariationRecord::min_size", referenced from:
      bool OT::GSUBGPOS::subset<OT::PosLookup>(hb_subset_context_t*) constin libharfbuzz_subset_la-hb-subset.o
      bool OT::GSUBGPOS::subset<OT::SubstLookup>(hb_subset_context_t*) constin libharfbuzz_subset_la-hb-subset.o
  "OT::Record<OT::LangSys>::min_size", referenced from:
      OT::Script::subset(hb_subset_context_t*) constin libharfbuzz_subset_la-hb-subset.o
  "OT::IntType<unsigned short, 2u>::min_size", referenced from:
      OT::Script::subset(hb_subset_context_t*) constin libharfbuzz_subset_la-hb-subset.o
      OT::RecordListOf<OT::Feature>::subset(hb_subset_context_t*) const  in libharfbuzz_subset_la-hb-subset.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[4]: *** [libharfbuzz-subset.la] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Exited with code 2
2018-09-07 15:02:57 -04:00
Michiharu Ariza 1e88b1755c Merge branch 'master' into cff-subset 2018-09-07 10:50:55 -07:00
Behdad Esfahbod ebe67137ab Try fixing bots 2018-09-07 10:46:13 -04:00
Behdad Esfahbod 5f17dbc302 [subset] Fix div-by-zero 2018-09-07 10:24:22 -04:00
Michiharu Ariza 22b88632d5 Merge branch 'master' into cff-subset 2018-09-06 22:27:44 -07:00
Michiharu Ariza 2a74536aae fix build attempt ^2
Added hb-ot-cff1-table.cc to hb-subset sources
Deleted unused variable (charset)
2018-09-06 18:26:13 -07:00
Michiharu Ariza 55268df9d4 fix build attempt
Added HB_INTERNAL to static funtion declarations
2018-09-06 17:56:05 -07:00
Michiharu Ariza aca73c9df2 subset CFF1 Encoding & Charset
fixed misc Charset bugs
added source file hb-ot-cff1.table.cc
renamed things for clarity & consistency
2018-09-06 17:28:15 -07:00
Garret Rieger 21bf147054 [subset] Fix hdmx subsetted size calculation. 2018-09-05 19:31:55 -07:00
Behdad Esfahbod 1e6599f596 Fix older compilers re '>>' at nested template declarations 2018-09-05 19:29:42 -07:00
Behdad Esfahbod a1e5e07c73 [subset] Hook up GSUB/GPOS, but still disabled
They are still in the drop list.
2018-09-05 16:24:28 -07:00
Behdad Esfahbod 0d160d5ff5 [subset] Implement subsetting of SingleSubst 2018-09-04 14:20:35 -07:00
Michiharu Ariza 5ea03d2951 fix build by untemplatizing DictOpSet & DictVal
as they aren't instantiated with BlendArg (yet)
2018-09-04 11:29:15 -07:00
Michiharu Ariza f2d299b0b7 Drop hints from CFF2 charstrings
Templatized ArgStack so it may store the default value along with blend deltas as BlendArg while parsing blend operator arguments in CFF2 charstring
Added get_region_count() method to VarRegionList & VariationStore
2018-09-04 10:25:21 -07:00
Behdad Esfahbod 3f00d0b0df [subset] Keep glyph set in plan
Should remove the vector version at some point...
2018-09-03 18:54:32 -07:00
Behdad Esfahbod dc50493a8d [subset] Towards subsetting SingleSubstFormat1
Why does subset plan not have a hb_set_t of glyphs?
2018-09-03 18:23:23 -07:00
Behdad Esfahbod 339d3603b9 [subset] Wire up subset() call down to subtables 2018-09-03 17:40:16 -07:00
Behdad Esfahbod 7b2ef551da Templatize Lookup::sanitize() 2018-09-03 17:16:09 -07:00
Behdad Esfahbod 9c3747c5e5 [subset] More 2018-09-03 16:53:03 -07:00
Behdad Esfahbod 6d618522d6 Templatize GSUBGPOS::sanitize() 2018-09-03 16:41:28 -07:00
Behdad Esfahbod 49c44b58f6 [subset] Fix serialize_subset() calls
Ouch.
2018-09-03 16:37:17 -07:00
Behdad Esfahbod 7c9cfa2b40 Add intersects() method to GSUB/GPOS lookups 2018-09-02 19:47:50 -07:00
Behdad Esfahbod 61ce62e554 [subset] Minor
Remove Lookup::subset().
2018-09-02 17:00:39 -07:00
Behdad Esfahbod bfa72a9a72 [subset] Towards GSUB/GPOS subsetting
Add subset() call for GSUBGPOS struct and its dependencies.
Not hooked up anywhere.
2018-09-01 18:34:50 -07:00
Behdad Esfahbod 6803ed8674 [serialize] Add reset() 2018-08-31 17:11:08 -07:00
Behdad Esfahbod e58b190292 [subset] De-templatize hb_subset_context_t
We're going to (finally) use virtual methods for hb_serialize_context_t
customization, so don't need to carry a Serializer template variable
around...  Simplifies code.
2018-08-31 16:46:35 -07:00
Behdad Esfahbod 22acd424ca [serialize] Add a couple small methods 2018-08-31 16:41:18 -07:00
Behdad Esfahbod d1f29908c2 [subset] Add hb_subset_context_t<> 2018-08-31 16:31:00 -07:00
Michiharu Ariza fcf177885b templatized ArgStack as a prep to store blends 2018-08-31 16:28:47 -07:00
Michiharu Ariza 968168bf0e drop hints from CFF1 charstrings
renamed confusing Stack.size to Stack.count
2018-08-31 13:28:16 -07:00
Behdad Esfahbod aba0a945c5 [subset] Add hb-subset-input.hh and make hb-subset.hh toplevel include 2018-08-31 13:25:19 -07:00
Behdad Esfahbod 18d01eac7f Minor 2018-08-31 13:00:57 -07:00
Michiharu Ariza 8c5e03b541 Added drop_hints to SubrFlattener 2018-08-30 17:21:56 -07:00
Behdad Esfahbod a23b892fe6 Shuffle 2018-08-29 18:28:39 -07:00
Behdad Esfahbod 93fe0faaee [subset] Clean up hb_subset_input_t API 2018-08-29 18:24:03 -07:00
Michiharu Ariza 9fd08cc238 CFF2 subroutine flattner
Factored out CFF1 & CFF2 common subsetting code in hb-subset-cff-common.hh
2018-08-29 18:18:18 -07:00
Behdad Esfahbod d237ce7181 [subset] Bail if subsetting a table failed 2018-08-29 18:13:52 -07:00
Behdad Esfahbod f39166f0c0 [subset] Remove unused hb_subset_profile_t
We might reintroduce it later, but for now remove, as it was unused.
Some things that should have been in this object (drop_hints, etc)
are already in hb_subset_input_t.  So, for now, keep everything there.
2018-08-29 18:09:55 -07:00
Behdad Esfahbod 2ccc322cf8 [ot-font] Clean up cmap with gid=0
Fixes https://github.com/harfbuzz/harfbuzz/issues/1145
2018-08-29 16:38:25 -07:00
Michiharu Ariza b95bf075d7 fix build attempt ^2 2018-08-29 14:41:52 -07:00
Michiharu Ariza 1d1afddfd2 corrected preprocessor guards 2018-08-29 13:36:39 -07:00
Michiharu Ariza 8af9690ac7 Merge branch 'master' into cff-subset
Renamed cff "private" source/headers without the suffix
2018-08-29 13:26:17 -07:00
Michiharu Ariza 0ad081ec32 attempt to fix build failure 2018-08-29 12:56:48 -07:00
Michiharu Ariza a11420b48c Subroutine flattener for CFF1
Subr-flattened charstrings are temporarily re-encoded in ByteStrBuff during "plan" phase, then copied to hb_serialize_context_t during "write" phase

CSOpSet may callback opcode processing "virtual" functions via CRTP

Numer struct may store a value as fixed optionally in addition to int and float
2018-08-29 12:14:30 -07:00
Behdad Esfahbod fee0f41c6c Don't declare extern symbols as inline
clang -O3 was completely removing _get_gdef(), causing link
failure when needed from another compilation unit.  Surprisingly,
"extern inline" didn't fix it.
2018-08-28 18:27:41 -07:00
Behdad Esfahbod 967741e4c4 Add explicit to hb_auto_t 1param constructors 2018-08-28 18:18:02 -07:00
Behdad Esfahbod c0a3f38f78 Fix distcheck 2018-08-28 17:22:59 -07:00
Behdad Esfahbod 2dde6c803a Explicitly pass reference in hb_auto_t constructor
Fixes clang bots as well as fuzzer issue.
2018-08-28 11:07:24 -07:00
Behdad Esfahbod a268068010 [ot-face] Remove tables_t. The face_data_t is what tables_t was 2018-08-26 15:18:46 -07: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 a84309afc8 [face] Use saved cmap in collect_unicodes() APIs 2018-08-26 09:33:01 -07:00
Behdad Esfahbod c624e18a24 [OT] Move code around 2018-08-26 09:19:20 -07:00
Behdad Esfahbod 3999094682 [OT] Use relaxed ops for recursing into GSUB/GPOS lookups again 2018-08-26 09:12:25 -07:00
Behdad Esfahbod d8c57e85d9 [GDEF] Move code around 2018-08-26 09:04:34 -07:00
Behdad Esfahbod 453e0c60b1 Add template keyword
I swear I have no idea why this is needed, but it is...
2018-08-26 01:30:52 -07:00
Behdad Esfahbod c44b0caf0d Fixup 2018-08-26 01:29:30 -07:00
Behdad Esfahbod 4096fbe487 [ot-face] Port GDEF to unified table accelerator model as well 2018-08-26 01:25:54 -07:00
Behdad Esfahbod b929100f87 [ot-face] Unify GSUB/GPOS accelerators in the table accelerator framework 2018-08-26 01:15:47 -07:00
Behdad Esfahbod 963413fc54 WIP 2018-08-26 00:47:55 -07:00
Behdad Esfahbod e6cb938065 [ot-face] Unify accelerators and tables 2018-08-26 00:21:29 -07:00
Behdad Esfahbod 7f8b6fe67d Minor 2018-08-26 00:07:12 -07:00
Behdad Esfahbod 59bca0d2cb [ot-font] Rename 2018-08-26 00:06:12 -07:00
Behdad Esfahbod 1c48a7ef06 [ot-font] Cache tables on face, not font 2018-08-25 23:57:16 -07:00
Behdad Esfahbod 71f8893eff [ot-font] Use init0 2018-08-25 23:27:45 -07:00
Behdad Esfahbod f36ae6f8a8 [ot-font] Make everything (cmap/metrics) lazy 2018-08-25 23:26:45 -07:00
Behdad Esfahbod 62fc54725a [ot-font] Fallback vertical advance to UPEM
Used to be ascent+descent.  Whatever. This is more convenient for
upcoming changes.
2018-08-25 23:15:52 -07:00
Behdad Esfahbod d950022c8a Add hb-ot-face.cc/hh 2018-08-25 23:06:37 -07:00
Behdad Esfahbod dae39c58fb [face] Introduce character-map API
New API:
+hb_face_collect_unicodes
+hb_face_collect_variation_selectors
+hb_face_collect_variation_unicodes
2018-08-25 22:44:39 -07:00
Behdad Esfahbod 66384db97c Minor 2018-08-25 22:39:17 -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 82b12bcadd [unicode] Add HB_UNICODE_MAX
New API:
HB_UNICODE_MAX
2018-08-25 22:07:17 -07:00
Behdad Esfahbod b09a0336ca [cmap] More hb_auto_t<>(...) 2018-08-25 22:04:39 -07:00
Behdad Esfahbod 28634db07e [cmap] Fix skipping gid0 in Format4 collect_unicodes() 2018-08-25 21:23:43 -07:00
Behdad Esfahbod acce1fa3ea Use new hb_auto_t<> constructor with Coverage::Iter 2018-08-25 21:15:39 -07:00
Behdad Esfahbod ddea4d19cf Add 1-param passthrough constructor to hb_auto_t<>
And use.
2018-08-25 21:08:15 -07:00
Behdad Esfahbod c8cfb702e9 [cmap] Minor 2018-08-25 16:18:00 -07:00
Behdad Esfahbod 1dcf5fb038 [cmap Add hb_subset_collect_variation_unicodes()
To be moved to hb-face.h later.
2018-08-25 16:12:18 -07:00
Behdad Esfahbod 4806b3800d [cmap] Add hb_subset_collect_variation_selectors()
To be moved to hb-face later.
2018-08-25 15:58:40 -07:00
Behdad Esfahbod 3336de2479 [cmap] Remove unused code 2018-08-25 15:41:25 -07:00
Behdad Esfahbod 1becabe06c [cmap] Use bsearch to find subtables 2018-08-25 15:37:56 -07:00
Behdad Esfahbod 02fe03e09a [cmap] Factor out find_best_subtable 2018-08-25 15:33:05 -07:00