Commit Graph

104 Commits

Author SHA1 Message Date
Behdad Esfahbod 5d4b0377b9 Convert unsigned 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 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 39e1b6d03f Convert boolean enum class consts to static constexpr
Part of https://github.com/harfbuzz/harfbuzz/issues/1553
2019-01-22 12:17:26 +01: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 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 d39760cabf One more...
Sigh.

hb-ot-kern-table.hh: In member function 'int OT::KernSubTableFormat3<KernSubTableHeader>::get_kerning(hb_codepoint_t, hb_codepoint_t) const':
hb-ot-kern-table.hh:59: error: ambiguous overload for 'operator[]' in 'kernValue[kernIndex[i]]'
hb-ot-kern-table.hh:59: note: candidates are: operator[](T*, int) <built-in>
hb-dsalgs.hh:574: note:                 Type& hb_array_t<Type>::operator[](unsigned int) const [with Type = const OT::IntType<short int, 2u>]
2018-11-30 15:55:30 -05:00
Behdad Esfahbod 5c4fead734 Convert "static const hb_tag_t" constants to enum 2018-11-29 15:05:47 -05:00
Behdad Esfahbod 9e4138c825 Convert misc "static const" constants to enum 2018-11-29 15:01:10 -05:00
Behdad Esfahbod 44cbd2ea3d Convert "static const bool" constants to anonymous enum 2018-11-29 14:56:27 -05:00
Behdad Esfahbod 748962264a [aat] Disable mark advance zeroing if kern table has state-machines
Geeza Pro for example, relies on that for fancy mark positioning.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1405
2018-11-23 11:10:17 -05:00
Behdad Esfahbod 209b58ef73 Minor 2018-11-22 01:22:33 -05:00
Behdad Esfahbod 3b9fd176e8 Disallow taking Null() of unbounded structs
Not sure I've marked all such structs.  To be done as we discover.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1300
2018-11-22 01:18:55 -05:00
Behdad Esfahbod 9af983af24 [kern] Switch to dispatch 2018-11-07 16:03:09 -05:00
Behdad Esfahbod bc06e2805a [kerx/kern] Add has_cross_stream() 2018-11-07 16:02:40 -05:00
Behdad Esfahbod 7a9629f2f1 [kerx] Implement CrossStream kerning for non-state-machine subtables
Untested.
2018-11-07 14:52:57 -05:00
Behdad Esfahbod 0eb4157011 [kerx] Disable backwards-kerning for non-state-machine tables
That's what the spec says for Backwards flag, only applicable to
formats 1 and 4.
2018-11-07 14:42:15 -05:00
Behdad Esfahbod 14772da06f [kern/kerx] Share KernTable, renamed to KerxTable 2018-11-07 13:40:22 -05:00
Behdad Esfahbod db6e658e8c [kern/kerx] More towards sharing KernTable 2018-11-07 13:33:23 -05:00
Behdad Esfahbod 89ec095979 [kern] Disable Format1 and Format3 for OT-style tables 2018-11-07 13:10:05 -05:00
Behdad Esfahbod ab57bcae0f [kern] Minor 2018-11-07 13:04:21 -05:00
Behdad Esfahbod 30af5b4a4c [kern] Move code 2018-11-07 12:57:10 -05:00
Behdad Esfahbod 1ff300464a [kern] Massage more 2018-11-07 12:51:49 -05:00
Behdad Esfahbod f8c3df7d4a [kern/kerx] Minor 2018-11-07 12:48:06 -05:00
Behdad Esfahbod f5e0a63a22 [kern/kerx] Towards sharing KernTable 2018-11-07 12:32:51 -05:00
Behdad Esfahbod 330508497d [kern/kerx] Minor 2018-11-07 12:27:44 -05:00
Behdad Esfahbod 1a5ef84900 [kern/kerx] Share Format2
This, enables Format2 for kern table, which was disabled before.
2018-11-07 12:19:52 -05:00
Behdad Esfahbod d5c0ca210f [aat] Minor 2018-11-07 12:08:44 -05:00
Behdad Esfahbod 241ba7da51 [morx/kerx] Rename types 2018-11-07 11:51:40 -05:00
Behdad Esfahbod c808e444da [kern/kerx] Share Format1 subtable 2018-11-07 11:47:12 -05:00
Behdad Esfahbod f5f4ca7871 [kern/kerx] Enable crossStream kerning in vertical
CoreText doesn't, but no reason we shouldn't do.
2018-11-07 11:21:09 -05:00
Behdad Esfahbod 5b17853547 [kern/kerx] Share Format0 2018-11-07 10:45:25 -05:00
Behdad Esfahbod c97dde5d55 [kern/kerx] Towards merge more 2018-11-07 10:39:39 -05:00
Behdad Esfahbod 540ccc38b0 [kern/kerx] More towards sharing 2018-11-07 10:33:46 -05:00
Behdad Esfahbod d0f8f4c200 [kern] Move kern machine to hb-kern.hh 2018-11-07 10:25:25 -05:00
Behdad Esfahbod befac337ca [kern] Remove Override business
Not used in any fonts.  Not well-specified when mixing kerning with
Cross-Stream positioning.
2018-11-07 09:53:50 -05:00
Behdad Esfahbod 59e04e4231 [kern/kerx] Fix cursive joining
Tested with Waseem TTC:

$ hb-shape Waseem.ttc جحخج
[F1Jeem_R2=3@0,180+479|M1Khah_L2_R2=2@0,682+403|M1Hah_L2_R2=1@0,1184+403|I1Jeem_L2=0@0,1184+744]
2018-11-07 00:27:20 -05:00
Behdad Esfahbod 8d0f797139 [kern/kerx] Fix "reset" magic value 2018-11-07 00:05:10 -05:00
Behdad Esfahbod 80a33b9ac3 [kern] More tweaks
Solves a mystery or two.  I'm fairly confident this is what CoreText does now.
2018-11-06 21:46:14 -05:00
Behdad Esfahbod 564e8ac046 [kern] Adjust some more
Getting closer.  So many open questions still...
2018-11-06 21:46:14 -05:00
Behdad Esfahbod 4d003b8503 [kern] Add TODO 2018-11-06 21:46:14 -05:00
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