Commit Graph

281 Commits

Author SHA1 Message Date
Qunxin Liu b0c3eb06b6 [subset] GPOS Lookup Type 3: CursivePos 2019-09-25 05:43:25 +09:00
Ebrahim Byagowi 68d39ea486 Revert previous change and fix -Wrange-loop-analysis complains 2019-09-24 13:52:46 +03:30
Ebrahim Byagowi cbc0646a6c Minor, normalize for each calls 2019-09-24 12:09:20 +03:30
Ebrahim Byagowi f0a7677993
[gpos] minor 2019-09-23 21:09:39 +03:30
Ebrahim Byagowi c1a585fab0 [gpos] minor 2019-09-21 23:36:29 +04:30
Ebrahim Byagowi d87d38998a Fix clang -Wrange-loop-analysis complains
./hb-ot-layout-gpos-table.hh:674:43: error: loop variable '_' is always a copy because the range of type 'hb_zip_iter_t<hb_iter_type<hb_array_t<const OT::IntType<unsigned short, 2> > &>, hb_iter_type<hb_array_t<const OT::IntType<unsigned short, 2> > &> >' (aka 'hb_zip_iter_t<hb_array_t<const OT::IntType<unsigned short, 2> >, hb_array_t<const OT::IntType<unsigned short, 2> > >') does not return a reference [-Werror,-Wrange-loop-analysis]
      for (const hb_pair_t<Value, Value>& _ : hb_zip (val_iter, first_val_iter))
                                          ^
./hb-ot-layout-gpos-table.hh:674:12: note: use non-reference type 'hb_pair_t<OT::Value, OT::Value>' (aka 'hb_pair_t<IntType<unsigned short, 2>, IntType<unsigned short, 2> >')
      for (const hb_pair_t<Value, Value>& _ : hb_zip (val_iter, first_val_iter))

and

In file included from hb-subset.cc:44:
./hb-ot-vorg-table.hh:87:34: error: loop variable '_' is always a copy because the range of type 'hb_map_iter_t<hb_filter_iter_t<hb_sorted_array_t<const OT::VertOriginMetric>, const hb_set_t *, OT::HBGlyphID OT::VertOriginMetric::*, nullptr>, (lambda at ./hb-ot-vorg-table.hh💯15), hb_function_sortedness_t::NOT_SORTED, nullptr>' does not return a reference [-Werror,-Wrange-loop-analysis]
    for (const VertOriginMetric& _ : it)
                                 ^
./hb-ot-vorg-table.hh:113:17: note: in instantiation of function template specialization 'OT::VORG::serialize<hb_map_iter_t<hb_filter_iter_t<hb_sorted_array_t<const OT::VertOriginMetric>, const hb_set_t *, OT::HBGlyphID OT::VertOriginMetric::*, nullptr>, (lambda at ./hb-ot-vorg-table.hh💯15), hb_function_sortedness_t::NOT_SORTED, nullptr>, nullptr>' requested here
    vorg_prime->serialize (c->serializer, it, defaultVertOriginY);
                ^
./hb-ot-vorg-table.hh:87:10: note: use non-reference type 'OT::VertOriginMetric'
    for (const VertOriginMetric& _ : it)
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-09-21 17:52:01 +04:30
Ebrahim Byagowi 6e42a418c8 Minor, turn more of hb_apply to for each 2019-09-21 17:52:01 +04:30
Ebrahim Byagowi d512087e4d Rename GlyphID to HBGlyphID
Avoid collision with macOS's ATSUnicodeTypes.h GlyphID
2019-09-14 11:55:53 +04:30
Behdad Esfahbod 3c81246f66 [subset] Use newer iter tools in SinglePosFormat1 2019-09-04 11:28:40 -04:00
Behdad Esfahbod e0e0c8c109 Minor 2019-08-29 14:58:16 -07:00
Ebrahim Byagowi a0b4ac4dce Turn 8 spaces to tab across the project
According to the current code style of the project
2019-08-27 02:40:41 +04:30
Qunxin Liu 321d5588d4 [subset] Add subsetting for GPOS Lookup Type 1: Single Adjustment Positioning Subtable 2019-08-06 14:06:35 -07:00
Ali Javadi c184180228 Fix C++20 compile warning on implicit capture of this with '=' default capture (#1833)
Happens when compiled with -std=c++2a, the fix just makes the captures explicit to resolve the issue. Just adding this in addition to = doesn't work in C++11.

src/hb-ot-layout-gpos-table.hh:737:18: warning: implicit capture of 'this' with a capture default of '=' is deprecated [-Wdeprecated-this-capture]
              { return (this+_).intersects (glyphs, valueFormat); })
                        ^
src/hb-ot-layout-gpos-table.hh:736:16: note: add an explicit capture of 'this' to capture '*this' by reference
    | hb_map ([=] (const OffsetTo<PairSet> &_)
               ^
                , this
2019-07-16 22:10:24 +04:30
Behdad Esfahbod 7dcf8e126e [config] Fix build with HB_NO_OT_LAYOUT 2019-06-26 13:44:23 -07:00
Behdad Esfahbod c8f529a07e [config] Add HB_NO_HINTING, enabled by HB_TINY
Disables HintingDevice tables and Anchors addressing contour points.

Part of https://github.com/harfbuzz/harfbuzz/issues/1652
2019-06-19 19:33:15 -07:00
Behdad Esfahbod 78d35f0e78 Reduce captures of lambdas 2019-05-15 18:15:05 -07:00
Behdad Esfahbod dfc5780245 Fix more double-promotion errors
WHy do only some of the clang bots catch this I have no idea :(.
2019-05-07 23:26:09 -07:00
Behdad Esfahbod 83e3eabd84 Whitespace 2019-05-07 20:58:43 -07:00
Behdad Esfahbod 41248cce0e Remove MIN/MAX in favor of hb_min/hb_max 2019-05-07 20:54:31 -07:00
Behdad Esfahbod 36bb24f7b4 [dispatch] Forward arguments in all dispatch multiplexers 2019-05-05 10:14:17 -07:00
Behdad Esfahbod b10f65933a [dispatch] Use functionality from previous commit
To remove a couple of unwanted wrapper methods
2019-05-05 09:23:35 -07:00
Behdad Esfahbod 88a4147240 [serializer] Accept exact type in serialize_subset/copy() 2019-05-02 14:22:31 -07:00
Ebrahim Byagowi 92588782d7
Remove space between right angle brackets now that we have C++11 (#1689) 2019-04-30 13:05:10 -07:00
Behdad Esfahbod 95df00aec1 Hide a few static methods
Looks like static methods that do not get inlined end up exported.
We have a lot more.  Need to protect all at some point.  Wish there
was an easier way, like the visibility flag we pass that automatically
hides all inline methods.

Was exposed by check-symbols.sh when compiling on OS X 10.14 with:

$ make CPPFLAGS=-Oz CXXFLAGS=-flto=thin LDFLAGS=-lc++
2019-04-12 17:51:14 -04:00
Behdad Esfahbod 9d8c72042b Whitespace 2019-03-29 21:59:28 -07:00
Behdad Esfahbod f5ef8a7347 [iter] Port one more function to dagger 2019-03-29 21:57:17 -07:00
Behdad Esfahbod 090fe56dc6 Merge branch 'master' into iter 2019-01-25 16:06:52 +01:00
Behdad Esfahbod ef00654962 Convert tag enum class consts to static constexpr
Part of https://github.com/harfbuzz/harfbuzz/issues/1553
2019-01-22 12:17:26 +01:00
Behdad Esfahbod 934d3fa2a7 Use more iter pipelines 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 0d1fdf939d Use hb_zip() some mooore 2019-01-20 20:12:12 -05:00
Behdad Esfahbod a46874f1ab [iter] Revert back uses of C++11 auto type deduction 2019-01-20 20:12:12 -05:00
Behdad Esfahbod e16884248f [iter] Port Coverage iterator to hb_iter_t 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 89bcfb204c Remove TRACE_COLLECT_GLYPHS 2019-01-18 14:59:18 -05:00
Behdad Esfahbod f39b5603ff Comment 2019-01-17 17:50:01 -05:00
Behdad Esfahbod b9a51f5310 Minor 2018-12-21 15:05:00 -05:00
Ebrahim Byagowi e412008599 Remove redundant void from C++ sources (#1486) 2018-12-17 13:01:01 -05:00
Ebrahim Byagowi b2ebaa9afa Remove redundant 'inline' from methods (#1483) 2018-12-16 14:08:10 -05:00
Behdad Esfahbod 2cc993e035 [dispatch] Minor 2018-12-12 10:07:38 -05:00
Behdad Esfahbod fb05908213 Revert ugly fixes
Now that we have 6daf45e0, revert cryptic hacks...

This reverts commit abd81ed4f5.
This reverts commit 9c6921c08c.
This reverts commit d39760cabf.
This reverts commit fedd8e6c17.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1374
2018-11-30 20:56:15 -05:00
Behdad Esfahbod 9c6921c08c More...
hb-ot-layout-gsubgpos.hh:1707: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
...
2018-11-30 15:16:57 -05:00
Behdad Esfahbod 5c4fead734 Convert "static const hb_tag_t" constants to enum 2018-11-29 15:05:47 -05:00
Behdad Esfahbod 574d888c8a [aat] Ignore GSUB table of Muthu Foundry if they have morx table
Fixes https://github.com/harfbuzz/harfbuzz/issues/1410
2018-11-25 16:51:22 -05:00
Ebrahim Byagowi 11aa0468ac [subset] minor, adjust spaces 2018-11-16 00:02:47 +03:30
Behdad Esfahbod e014405a21 Rename check_array(array, a, b) to check_range() 2018-11-12 14:23:31 -05:00
Behdad Esfahbod 1d66cdcf77 Better fix for MSVC 2008
Follow up on b4c6113032

Fixes https://github.com/harfbuzz/harfbuzz/issues/1374
2018-11-10 19:57:51 -05:00
Behdad Esfahbod 385f78b312 [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.
2018-11-07 17:20:47 -05:00
Behdad Esfahbod 6ee6cd93d8 [GPOS] Only mark unsafe-to-break if kerning happened
Fixes https://github.com/harfbuzz/harfbuzz/issues/1365
2018-11-07 15:40:55 -05:00
Behdad Esfahbod 501a364d9b [GPOS] Add TODO item 2018-11-07 15:02:16 -05:00
Behdad Esfahbod 33b006cc51 [ot-layout] Simplify some access 2018-11-05 23:19:04 -05:00
Behdad Esfahbod ca5e5a4979 Port Coverage::Iter off hb_auto_t<> 2018-10-29 22:30:21 -07:00
Behdad Esfahbod 39bd07aed5 Fix bunch of unused parameter warnings
Show up with gcc -O0.

There's a few more but those are functions that need to be filled in.

Maybe this is a lost battle...
2018-10-26 21:22:26 -07:00
Behdad Esfahbod 21ede867df Fix possible overflow in bsearch impls
From bungeman.

Fixes https://github.com/harfbuzz/harfbuzz/pull/1314
2018-10-25 13:19:58 -07:00
Bruce Mitchener 8d1e479d1d Use bool literals instead of 0/1. 2018-10-19 18:05:46 +02:00
Behdad Esfahbod 36f38ea703 [gpos] Protect mark attachment against out-of-bounds
Not sure how can happen, but does...
2018-10-16 16:24:03 -07:00
Behdad Esfahbod bf8469be9a Attach CursivePositioning backwards, not forward
This is how Uniscribe does it.  So, adjust.  This is only relevant
to fonts that apply cursive positioning from a contextual lookup.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1181
2018-10-11 20:45:40 -04:00
Behdad Esfahbod 1622ba5943 [kerx] Implement Format4 'ankr'-based mark attachment
Tested with Kannada MN:

$ HB_OPTIONS=aat ./hb-shape Kannada\ MN.ttc -u 0CCD,0C95,0CD6
[kn_ka.vattu=0+230|kn_ai_length_mark=1@326,0+607]
2018-10-11 01:17:33 -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 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 7c9cfa2b40 Add intersects() method to GSUB/GPOS lookups 2018-09-02 19:47:50 -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 3999094682 [OT] Use relaxed ops for recursing into GSUB/GPOS lookups again 2018-08-26 09:12:25 -07:00
Behdad Esfahbod c44b0caf0d Fixup 2018-08-26 01:29:30 -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 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 1c6b369324 [ot] Rename hb_ot_layout_t to hb_ot_face_data_t 2018-08-23 11:30:21 -07:00
Behdad Esfahbod 0271c7ab3b [ot] Move GSUB/GPOS into tables_t 2018-08-03 16:45:57 -07:00
Behdad Esfahbod bddeb2b10c Minor renamings of internal inline functions 2018-07-10 14:13:21 +02:00
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
Ebrahim Byagowi eaf649450a Resolve clang's conditional-uninitialize warnings 2018-04-23 11:38:45 -07:00
Ebrahim Byagowi a02c3ee70f Add or update tables specifications links 2018-04-12 13:44:32 +04:30
Behdad Esfahbod e347fb908b Minor 2018-02-26 01:08:50 -08:00
Behdad Esfahbod 1c50a88623 Readjust mark attachment heuristic a bit more
Previously adjusted logic could fail if nothing around was ligated,
and something moved.  This should take care of that.

CC https://github.com/harfbuzz/harfbuzz/issues/740
2018-02-18 15:58:09 -08:00
Behdad Esfahbod 978ace6fbb Improve _hb_popcount()
Support 128bit type.
2018-02-16 16:08:45 -08:00
Behdad Esfahbod 9b5af3ec7f [gpos] Adjust mark attachment heuristic
Hopefully it...
fixes https://github.com/harfbuzz/harfbuzz/issues/740
2018-02-10 21:50:44 -06:00
Behdad Esfahbod fd03449094 Rename hb_apply_context_t to hb_ot_apply_context_t 2018-01-19 16:40:13 -08:00
Behdad Esfahbod 188ee6e5ee Calculate anchor positions in float, then round
Hoping to reduce rounding error, to make tests happier...
No luck.
2018-01-10 05:13:47 +01:00
Behdad Esfahbod 7cdd6ab068 Round, instead of floor, when applying variations
Hoping this would fix remaining text-rendering-tests failures,
but so far no luck.
2018-01-10 04:44:33 +01: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 71e6adf1e2 [collect_glyphs] handle ClassDef better 2017-12-16 11:07:37 -05:00
Behdad Esfahbod 87cc5a65cb [collect_glyphs] In PairPosFornat2 do not collect classDef1
The coverage already covered that.
2017-12-16 06:18:07 -08:00
Behdad Esfahbod 81f27df4d9 More work towards improving collect_glyphs() against bad input
The three "XXXXX"'s should be switched to false.  Doing that separately for ease
of bisecting...
2017-12-16 06:12:06 -08:00
Behdad Esfahbod 5d02572034 [set] Add add_sorted_array()
Not optimized to use sortedness yet.  Also start putting in place infra
to faster reject bad data.

A version of Chandas.ttf found on some Chrome bots has 660kb of GPOS,
mostly junk.  That is causing 48 million of set->add() calls in
collect_glyphs(), which is insane.

In the upcoming commits, I'll be speeding that up by optimizing
add_sorted_array(), while also reducing work by rejecting out-of-sort
arrays quickly and propagate the rejection.

Part of https://bugs.chromium.org/p/chromium/issues/detail?id=794896
2017-12-14 19:35:47 -08:00
Behdad Esfahbod 6f335ed1e5 Replace USHORT/SHORT/ULONG/etc with UINT16/INT16/UINT32/etc 2017-11-14 21:06:07 -08:00
Behdad Esfahbod 5d98de1f38 Tweak mark-base attachment
Apparently a base glyph can also become an attached component of a
ligature if the ligature-forming lookup used IgnoreBase.  This was
being confused with a non-first component of a MultipleSubst and
hence not matched for mark-attachment.  Tweak test to fix.

Fixes https://github.com/behdad/harfbuzz/issues/543
2017-10-03 13:49:40 +02:00
Behdad Esfahbod b65aa1cd47 [unsafe-to-break] Flag during mark attachment 2017-08-10 20:32:02 -07:00
Behdad Esfahbod 882ebdadd6 [unsafe-to-break] Flag during cursive positioning 2017-08-10 20:23:17 -07:00
Behdad Esfahbod 2d158ca376 [unsafe-to-break] Flag during kerning 2017-08-10 20:20:30 -07:00
Volker H. Simonis ad273881c5 Minor fixes to pacify Coverity code scan
Fixes https://github.com/behdad/harfbuzz/pull/377
2016-12-18 00:14:06 -06:00
Behdad Esfahbod 59055b5494 [GX] Implement Feature Variations
Not hooked up to shaper yet.
2016-12-16 19:06:26 -06:00
Behdad Esfahbod cf3de4d8f7 [GX] Rename VarStore to VariationStore 2016-12-16 19:06:26 -06:00
Behdad Esfahbod 1124d2ece5 [GX] Fix thinko 2016-12-16 19:06:26 -06:00
Behdad Esfahbod 151d93de8a [GX] Hook up GPOS to Variation Store stored in GDEF
Untested.
2016-12-16 19:06:26 -06:00
Behdad Esfahbod 49cb87850c [GX] Pass apply-context down to get_anchor()
Needed to access GDEF for varStore.
2016-12-16 19:06:26 -06:00
Behdad Esfahbod dc9f229799 [GX] Port variation stuff to Variation Store design
Not hooked up to GDEF yet.
2016-12-16 19:06:26 -06:00
Behdad Esfahbod ca28670316 [GX] Towards anisotropic interpolation
Also hookup to ValueRecord and Anchors.
2016-12-16 19:06:26 -06:00