Commit Graph

162 Commits

Author SHA1 Message Date
Behdad Esfahbod 89dd4b9597 Fix bots
"Unused private member" warning turned error.  ugh.
2018-09-16 18:11:46 +02:00
Behdad Esfahbod 10642b3fbf Disallow null-enabled offsets to unsized structures...
...like UnsizedArrayOf<>.

This fixes a class of crasher bugs, mostly with color and AAT tables.  We
cannot use nullable offsets to varsized data that does not declare min_size,
because it's nost safe to use our fixed-size null pool for types that have
their size external.  So, use non_null'able offsets for these.

A further enhancement would be to make use of min_size in Null<> itself.
Will try that after.
2018-09-15 19:43:33 +02:00
Behdad Esfahbod 9ff76c6025 [morx] Respect default feature settings
Does NOT apply user-selected features.  But at least now enables
correct subtables.
2018-09-15 18:31:14 +02:00
Behdad Esfahbod 2f97da6e2d [aat] Change version field 2018-09-15 14:51:50 +02:00
Behdad Esfahbod 29c2bd1795 [morx] Add stub for InsertionChain 2018-09-15 14:47:18 +02: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 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 63f57f4dab Mark more unsized array's as arrayZ 2018-05-08 16:56:11 -07:00
Behdad Esfahbod 5b93f69169 Rename some X-terminated members to Z-terminated
X-terminated means don't access this, it's not located correctly.
Z-terminated means this is a C array with no bound checking.
2018-05-02 14:59:14 -04:00
Ebrahim Byagowi 277e328986
Make some of implicit header uses explicit (#989)
Splitted from #950 and #986 IIRC Chromium had a policy about this encouraging it,
not sure about automated way to detect and add them but for now lets have the needed
ones of them.
2018-04-17 09:13:35 +04:30
Ebrahim Byagowi a02c3ee70f Add or update tables specifications links 2018-04-12 13:44:32 +04:30
Ebrahim Byagowi b799fc8077
minor, use LOffsetTo and LArrayOf whenever possible (#966) 2018-04-11 18:36:09 +04:30
Ebrahim Byagowi 211da5efdc
[aat] Cosmetic changes (#964) 2018-04-11 17:41:24 +04:30
Ebrahim Byagowi 158f2810b2
[aat/ltag] Implement the table parsing (#911) 2018-03-26 12:04:30 +04:30
Behdad Esfahbod c7d7c9898e [aat] Minor 2018-02-13 14:00:14 -08:00
Behdad Esfahbod 2dbfeecf96 Minor 2018-02-13 13:59:39 -08:00
Behdad Esfahbod 91519c6a5b [aat] Add buffer messages 2018-02-10 13:35:17 -06:00
Behdad Esfahbod 5021ba2a21 [aat] Minor 2018-02-08 15:11:28 -06:00
Behdad Esfahbod ee433d36fa [aat] Set debug lookup_index 2018-02-07 12:41:21 -05:00
Behdad Esfahbod 126ffdbe95 [aat] Fix debug compile 2018-02-07 12:26:57 -05:00
Behdad Esfahbod 54e6efadd6 [aat] Fix unsafe-to-break
At any position, if state is not zero, mark unsafe-to-break before,
unless we can reason it safe.

At any position, if there's an action entry for end-of-text, mark
unsafe to break.

Also changes buffer diff impl to allow for flag differences as long
as the buffer glyph flags are superset of reference glyph flags.

With this, all MORX tests pass.
2018-02-04 17:18:54 -05:00
Behdad Esfahbod 89b1906d99 [aat] More adjustment to ContextualSubtable
See comment.

With this, MORX-20 passes if I turn --verify off.  Our unsafe-to-break
logic is currently broken in presence of end-of-text actions.  That's,
ugh, extra work to fix.  Let me try...
2018-02-04 14:45:02 -05:00
Behdad Esfahbod 8be596f0b7 [aat] In ContextualSubstitute, apply end-of-text action to last glyph 2018-02-04 14:40:17 -05:00
Behdad Esfahbod c0b1c7eb2e [aat] Remove unneeded check 2018-02-04 14:19:41 -05:00
Behdad Esfahbod aed32589af [aat] In ContextualSubtable, mark mark after substituting mark
Fixes MORX-21.
2018-02-04 12:36:54 -05:00
Behdad Esfahbod fe5f9b1ae3 [aat] Fix ContextualSubtable sanitization
Fixes MORX-18, MORX-19, and MORX-22.
2018-02-04 12:36:54 -05:00
Behdad Esfahbod 51ce3828e6 [aat] Fix Ligature matching
I hope... Makes "ffi" work with Zapfino. I'm not sure if doing it correctly though...
2018-01-19 18:37:58 -08:00
Behdad Esfahbod bef509855c [aat] Add TODO 2018-01-19 18:24:00 -08:00
Behdad Esfahbod e6f283ed7d [aat] Implement LigatureSubtable
We form the Zapfino ligature now. Yay! No further testing done.
2018-01-19 18:09:48 -08:00
Behdad Esfahbod 046690a4df [aat] Add hb_aat_apply_context_t 2018-01-19 16:40:13 -08: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 e6263c7142 [aat] Wire up table length to apply() 2018-01-15 15:37:55 -05:00
Behdad Esfahbod 679ae744d0 [aat] Towards implementing LigatureSubtable 2018-01-14 15:03:31 -05:00
Behdad Esfahbod 9009b341c4 [aat] Fix some struct sizes
I hate it that with my compiler at least, it doesn't catch totally uncompilable
statements in templates if they are not used...
2018-01-12 12:04:53 +01:00
Behdad Esfahbod 57051b4f67 [aat] Flush rest of buffer if state machine failed 2018-01-12 11:42:25 +01:00
Behdad Esfahbod 25364c4f00 [aat] Fix symbol visibility
Not sure why only one of the bots sees this as visible...
2018-01-12 11:31:20 +01:00
Behdad Esfahbod dd38db523a [aat] Fix more builds
Maybe I should disable C++11 detection such that my compiler also catches
these.  Doesn't look like we can switch to it for a while anyway...
2018-01-12 09:45:42 +01:00
Behdad Esfahbod 72cb2b1f57 [aat] Fix builds 2018-01-12 09:38:55 +01:00
Behdad Esfahbod c70d58f97d [aat] Port RearrangementSubtable to StateTableDriver 2018-01-12 00:08:22 +01:00
Behdad Esfahbod 117cfe7bb7 [aat] Add StateTableDriver and convert ContextualSubtable to it 2018-01-12 00:01:36 +01:00
Behdad Esfahbod 1f1c85a54a [aat] Remove 'mort' support
It's dead, Jim!
2018-01-11 22:43:57 +01:00
Behdad Esfahbod 7e2fed6d73 [aat] Allow DontAdvance
Apparently CoreText does allow these.  To be done: detect infinite
loops.

Fixes MORX-12 test.
2018-01-11 19:25:21 +01:00
Behdad Esfahbod 17f01aff91 [aat] Sanitize ContextualSubtable 2018-01-11 18:54:49 +01:00
Behdad Esfahbod 0e3b3379a0 [aat] Actually fix d887f93148 2018-01-11 18:01:10 +01:00
Behdad Esfahbod d887f93148 [aat] Make bots happy
Don't know why this is not caught by my compiler.  Looks like clang catches it
while gcc doesn't.

In file included from ../src/hb-aat-layout-morx-table.hh:31:
../src/hb-aat-layout-common-private.hh:523:30: error: no member named 'static_size' in 'AAT::ContextualSubtable<AAT::MorxTypes>::EntryData'
  DEFINE_SIZE_STATIC (4 + T::static_size);
                            ~~~^
2018-01-11 17:41:34 +01:00
Behdad Esfahbod f6be730994 [aat] In NoncontextualSubtable, handle MarkLast with end-of-line transition
Fixes MORX-11 test.
2018-01-11 15:23:24 +01:00
Behdad Esfahbod f9be673814 [aat] Implement ContextualSubtable
Tested with Zapfino and text "2nd". Sascha will create tests later.
2018-01-11 15:15:36 +01:00
Behdad Esfahbod 335a9c1fe4 [aat] Towards implementing ContextualSubtable 2018-01-11 15:15:36 +01:00
Behdad Esfahbod 62348f647f [aat] Implement end-of-text in state machine
Passes MORX-10 test now.
2018-01-11 15:15:36 +01:00
Behdad Esfahbod 9adbd938fa Minor 2018-01-11 15:15:36 +01:00
Behdad Esfahbod 94644d7ea4 [aat] Generate finegrained unsafe-to-break in state-machine!
Neato.
2018-01-11 11:49:07 +01:00
Behdad Esfahbod 14b4d84eef [aat] Fix RearrangementSubtable action 2018-01-11 10:43:30 +01:00
Behdad Esfahbod 800e4ae802 [aat] Mark state-machine-based lookup as completely unsafe-to-break
To be improved later.
2018-01-11 10:43:30 +01:00
Behdad Esfahbod ca42d96129 [aat] Implement RearrangementSubtable 2018-01-11 10:43:30 +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 81e321c802 [aat] Try fixing VC bots
c:\projects\harfbuzz\src\hb-aat-layout-common-private.hh(51): error C2872: 'UINT16': ambiguous symbol [C:\projects\harfbuzz\build\harfbuzz.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\shared\basetsd.h(80): note: could be 'unsigned short UINT16'
c:\projects\harfbuzz\src\hb-open-type-private.hh(648): note: or       'OT::UINT16'
2018-01-10 02:56:29 +01:00
Behdad Esfahbod 748b989a1f [aat/morx] Implement NoncontextualSubtables
Also makes hb-ot-shape call morx for now instead of GSUB... Just for testing.
2018-01-10 02:50:49 +01:00
Behdad Esfahbod 470fe5b603 [aat] Implement Lookup table
Untested, but compiles.
2018-01-10 02:50:49 +01:00
Behdad Esfahbod 7c7cb42d81 [aat] Update previous commits for rebase on master 2018-01-10 02:50:49 +01:00
Behdad Esfahbod a0175e75bc [aat] Start implementing common table formats 2018-01-10 02:50:49 +01:00
Behdad Esfahbod c71b55a223 [aat] Start implementing Apple AAT morx table 2018-01-10 02:50:49 +01:00