Commit Graph

6090 Commits

Author SHA1 Message Date
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 8e9f6cd0fd [kerx] More minor 2018-11-07 12:49:20 -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 8faec4e334 [kerx] Towards merging Format2 2018-11-07 12:16:38 -05:00
Behdad Esfahbod d5c0ca210f [aat] Minor 2018-11-07 12:08:44 -05:00
Behdad Esfahbod e72e041c3c [kerx] Rename 2018-11-07 11:56:36 -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 a244190afa [kerx] Minor 2018-11-07 11:47:12 -05:00
Behdad Esfahbod 2a72091196 [kerx] Minor 2018-11-07 11:26:57 -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 d5c88af4a2 [kerx] More towards sharing Format1 2018-11-07 11:20:14 -05:00
Behdad Esfahbod b693fd0dc6 [morx] Simplify 2018-11-07 11:10:24 -05:00
Behdad Esfahbod ce3451dc2a [kerx] Towards sharing Format1 2018-11-07 11:02:04 -05:00
Behdad Esfahbod e890753ebb [morx] Minor 2018-11-07 10:59:53 -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 a6acff252c [kerx] Towards sharing subtables with kern 2018-11-07 10:19:57 -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 9d5027696e [post] Return true on truncation
Client can check that buffer was completely filled out and reallocate.
2018-11-07 09:16:53 -05:00
Behdad Esfahbod 7d91f07edf [post] Protect against huge empty tables 2018-11-07 09:14:42 -05:00
Behdad Esfahbod 5ed816ab59 [post] Minor 2018-11-07 09:13:51 -05:00
Behdad Esfahbod 64f0becd89 [post] Fix bound checking 2018-11-07 09:10:55 -05:00
HinTak 7ec694ddf2 Use non-GRID-fitted values for metrics (#1363)
* Use non-GRID-fitted values for metrics

See freetype/src/base/ftobjs.c:ft_recompute_scaled_metrics() and
the usage of GRID_FIT_METRICS inside.

Fixes https://github.com/behdad/harfbuzz/issues/1262

* Update hb-ft.cc
2018-11-07 08:19:36 -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 0123976a0c [kerx] Adjust CrossStream kern to match 'kern' table 2018-11-06 21:46:14 -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 c0383c6bb7 Minor 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
Behdad Esfahbod 213fa3bf71 [kern] Refactor to include header in each subtable type 2018-11-06 12:13:20 -05:00
Behdad Esfahbod b0da2cd0b9 [kern] Some more 2018-11-06 12:13:20 -05:00
Behdad Esfahbod 75b00b51c8 [kern] Renames 2018-11-06 12:13:20 -05:00
Behdad Esfahbod 37f421c951 Minor 2018-11-06 10:03:38 -05:00
Ebrahim Byagowi 9139cc23ea
Fix link issue of some of the bots
e.g. https://circleci.com/gh/harfbuzz/harfbuzz/52410
2018-11-06 11:17:14 +03:30
Ebrahim Byagowi 98b37f0c10
[mort] Fix table detection logic
mort really needs some initial tests at least.
2018-11-06 09:16:28 +03:30
Behdad Esfahbod fa3ebf845f Simplify some more 2018-11-05 23:34:07 -05:00
Behdad Esfahbod 61f52231f4 [math] Shorten names a bit 2018-11-05 23:28:52 -05:00
Behdad Esfahbod 737efbe655 [ot-layout] Simplify GSUB/GPOS access
This concludes simplifying table access to face->table.XXXX.
2018-11-05 23:26:29 -05:00
Behdad Esfahbod 5e68cec179 [ot-layout] Simplify GDEF access 2018-11-05 23:23:57 -05:00
Behdad Esfahbod 33b006cc51 [ot-layout] Simplify some access 2018-11-05 23:19:04 -05:00
Behdad Esfahbod db35409f0d [ot-layout] Remove ensures 2018-11-05 23:11:46 -05:00
Behdad Esfahbod 9198de7b9b [ot-font] Remove ensure 2018-11-05 23:10:37 -05:00
Behdad Esfahbod ea6d9b661f [ot-face] Remove a few ensures 2018-11-05 23:10:21 -05:00
Behdad Esfahbod 0fe7a745c9 [ot-face] Simplify more table access 2018-11-05 23:10:18 -05:00
Behdad Esfahbod a35c92cbe7 [ot-face] Simplify table access
Yoohoo!
2018-11-05 23:10:16 -05:00
Behdad Esfahbod 914b595f25 [ot-face] Include hb-ot-face directly in hb_face_t
Simplifying access coming next.
2018-11-05 23:10:12 -05:00
Behdad Esfahbod 56ba998cdd [cmap] Push get_nominal_glyphs down into cmap accelerator 2018-11-05 19:49:54 -05:00
Behdad Esfahbod 36d85dce25 [cmap] Use hb_nonnullptr_t 2018-11-05 19:46:29 -05:00
Behdad Esfahbod 8be74d8553 2.1.1 2018-11-05 18:47:22 -05:00
Behdad Esfahbod 252632c477 [uniscribe] Fix use of deprecated API 2018-11-05 14:33:41 -05:00
Behdad Esfahbod bb380ec183 [cmap] Make null accelerator safe
Fixes https://github.com/harfbuzz/harfbuzz/issues/1146
2018-11-05 13:47:30 -05:00
Behdad Esfahbod f6fc5574d3 Add pointer magic operators to hb_atomic_ptr_t 2018-11-05 13:23:54 -05:00
Behdad Esfahbod f6e7cb51b1 Fix const-confusion in hb_array_t as well 2018-11-05 13:23:07 -05:00
Behdad Esfahbod 0da22fb0ad [null] Tweak hb_nonnull_ptr_t some more 2018-11-05 13:20:06 -05:00
Behdad Esfahbod 03348ce005 Minor 2018-11-05 12:59:32 -05:00
Behdad Esfahbod b605db2f65 [aat] Clean up ankr table include mess 2018-11-04 12:58:02 -05:00
Behdad Esfahbod 17335a8161 Clean up buffer->swap_buffers() calls
That function checks for buffer->successful already.  No need
to check at call site.
2018-11-04 02:25:07 -05:00
Behdad Esfahbod 4eb52460c8 Fix >> 2018-11-03 21:45:39 -04:00
Behdad Esfahbod ae9ad1076e Fix "Warning: extra ";" ignored." 2018-11-03 21:41:50 -04:00
Behdad Esfahbod d0163afb7b Revert "Add operator char * to the naked array types as well"
This reverts commit db889c182e.

Was resulting in ambigious overloads...
2018-11-03 21:38:30 -04:00
Behdad Esfahbod c8f94a1ca6 Minor 2018-11-03 21:08:13 -04:00
Behdad Esfahbod 0b0b38ec1e Fix null accelerator's
Fixes all except for cmap.  To be done separately.

Part of https://github.com/harfbuzz/harfbuzz/issues/1146
2018-11-03 16:16:31 -04:00
Behdad Esfahbod db889c182e Add operator char * to the naked array types as well 2018-11-03 16:04:19 -04:00
Behdad Esfahbod d6fdae310f Add operator char * to hb_nonnull_ptr_t 2018-11-03 16:02:03 -04:00
Behdad Esfahbod 7430ff604a Template casts in hb_nonnull_ptr_t 2018-11-03 15:59:13 -04:00
Behdad Esfahbod da408fce98 [blob] Allow null parent in create_sub_blob()
Like font and unicode.
2018-11-03 15:49:37 -04:00
Behdad Esfahbod fb0f30f55a Add hb_nonnull_ptr_t
Towards fixing https://github.com/harfbuzz/harfbuzz/issues/1146
2018-11-03 15:41:32 -04:00
Behdad Esfahbod 8d98c51d13 [kern] Third try fix access violation in Format3
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11245
2018-11-03 15:14:57 -04:00
Behdad Esfahbod f074da8c2b [kern] Really fix access violation in Format3
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11245
2018-11-03 15:07:39 -04:00
Behdad Esfahbod 93ef20a83b Replace most uses of is_inert with is_immutable 2018-11-03 15:03:06 -04:00
Behdad Esfahbod 0589787ff5 [kern] Fix access violation in Format3
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11245
2018-11-03 14:59:40 -04:00
Behdad Esfahbod 5570c87f21 Port objects to use header.writable instead of immutable
Saves 4 or 8 bytes per object on 64bit archs.
2018-11-03 14:59:40 -04:00
Behdad Esfahbod ee351a38ec [object] Add "writable" 2018-11-03 14:59:40 -04:00
Ebrahim Byagowi b8a78ce201
[BASE] Improvements (#1347) 2018-11-03 22:28:30 +03:30
Khaled Hosny 2c68f34bdd [os2] Capitalize table tag and struct
Other tables follow the case of the OT tag, except this one.
2018-11-02 17:17:54 -04:00
Behdad Esfahbod 8034d1dda0 [kern] Implement Format1
Also, implement backwards kerning for Format1 in kern and kerx.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1350
2018-11-02 14:48:04 -04:00
Behdad Esfahbod 46b3885c1a [kern] Set subtable on sanitizer 2018-11-02 14:43:38 -04:00
Behdad Esfahbod 74c7a2c6c8 [kern] Respect more flags 2018-11-02 14:26:04 -04:00
Behdad Esfahbod 9f880bad0d [kern] Minor
We like check_struct() more.
2018-11-02 13:57:41 -04:00
Behdad Esfahbod 04b82b181d Remove pointer cast operators from ArrayOf<>
ArrayOf<>, unlike UnsizedArrayOf<>, has data before the array.
This was confusing.  Remove.
2018-11-02 13:47:33 -04:00
Behdad Esfahbod f1df441bed [kern] Comment 2018-11-02 13:26:15 -04:00
Behdad Esfahbod 095f5add0b [kern] Push apply loop to each subtable 2018-11-02 13:23:54 -04:00
Behdad Esfahbod 949dad89a8 [kern] Remove accelerator
It wasn't doing anything.
2018-11-02 12:47:55 -04:00
Behdad Esfahbod 0382b7184a Use as_array in more places 2018-11-02 12:23:26 -04:00
Behdad Esfahbod 91de9dfcf3 Fix &array_of<> 2018-11-02 12:16:51 -04:00
Behdad Esfahbod 9b7cb13794 Fixup 2018-11-02 12:00:55 -04:00
Behdad Esfahbod 6e06fe162e [kern] Implement Format3
Untested.
2018-11-02 11:56:55 -04:00
Behdad Esfahbod c6ef5dbd5c Add cast operators to hb_array_t 2018-11-02 11:51:21 -04:00
Behdad Esfahbod 72462eb765 Add UnsizedArrayOf::as_array() instead of hb_array() template 2018-11-02 11:46:42 -04:00
Behdad Esfahbod 1cf075ecb6 Add get_size to UnsizedArrayOf 2018-11-02 11:38:00 -04:00
Behdad Esfahbod a4a7a62389 [kern] Add buffer message 2018-11-02 11:16:43 -04:00
Behdad Esfahbod de96e5c81c [Crap] Avoid operator= 2018-11-01 18:14:41 -04:00
Behdad Esfahbod f9353bd68c [aat] Rely on vector auto initialization 2018-11-01 18:05:22 -04:00
Behdad Esfahbod 5a18d97b35 [aat] Remove unused forward declaration 2018-11-01 18:01:26 -04:00
Behdad Esfahbod 07ec792212 Warning fix 2018-11-01 10:31:19 -04:00
Ebrahim Byagowi c32280b30f
[ot-layout] minor 2018-11-01 15:31:14 +03:30
Behdad Esfahbod 52a00cd87f [aat] Implement 'aalt' mapping
Fixes https://github.com/harfbuzz/harfbuzz/issues/1160
2018-10-31 19:06:08 -07:00
Behdad Esfahbod 6e3ea269fa [aat] Add 'afrc' feature mapping
https://github.com/harfbuzz/harfbuzz/issues/1342#issuecomment-434829028
2018-10-31 19:00:11 -07:00
Behdad Esfahbod 40b19fd469 [aat] Fallback to old style "Letter Case" small caps
Fixes https://github.com/harfbuzz/harfbuzz/issues/1342
2018-10-31 18:51:45 -07:00
Behdad Esfahbod cf203af8a3 Implement space fallback in vertical direction
Fixes https://github.com/harfbuzz/harfbuzz/issues/1343
2018-10-31 18:27:09 -07:00
Behdad Esfahbod e01250230b [hmtx/vmtx] Fix a crasher 2018-10-31 18:14:00 -07:00
Behdad Esfahbod 36e90ef56e [mort] Massage some more 2018-10-31 15:09:09 -07:00
Behdad Esfahbod cbaff4ef19 [mort] Some more 2018-10-31 15:06:12 -07:00
Behdad Esfahbod 3087046d31 [mort] Refactor offset-to-index mapping 2018-10-31 14:59:14 -07:00
Behdad Esfahbod b9db610add Minor 2018-10-31 14:22:31 -07:00
Behdad Esfahbod 995bf6c6f8 [sbix] Rely on blob->as<> checking size against Type::min_size 2018-10-31 13:21:33 -07:00
Behdad Esfahbod 4d4e526b5c Improve blob->as<>
It's true that blob->as<> should only be called on null or sanitized
data.  But this change is safe, so keep it.
2018-10-31 13:19:42 -07:00
Behdad Esfahbod 5854d3fa25 [set] Warning fix with gcc 8.1
https://github.com/harfbuzz/harfbuzz/pull/1334
2018-10-31 10:42:49 -07:00
Ebrahim Byagowi 850a7af3a4
[ot-color-test] Remove the non-working exact strike size storing (#1339) 2018-10-31 14:20:23 +03:30
Ebrahim Byagowi 2e639c47c9
[aat] Fix older compilers by not referencing enum directly (#1340) 2018-10-31 14:20:14 +03:30
Ebrahim Byagowi 642c9dcf1b
[aat] Minor, remove extra semicolons 2018-10-31 14:02:37 +03:30
Behdad Esfahbod c962d5e714 [mort] Make ligatures work
./hb-shape Apple_Chancery_10_12.ttf  "Th th ll te to tr fr fu fj"
[T_h=0+2308|space=2+569|t_h=3+1687|space=5+569|l_l=6+1108|space=8+569|t_e=9+1408|space=11+569|t_o=12+1531|space=14+569|t_r=15+1385|space=17+569|f_r=18+1432|space=20+569|f_u=21+1733|space=23+569|f_j=24+1098]

Part of https://github.com/harfbuzz/harfbuzz/issues/1331
2018-10-31 01:18:21 -07:00
Behdad Esfahbod c077989600 [mort] More Ligature work 2018-10-31 00:36:03 -07:00
Behdad Esfahbod 431c6e496b [mort] Some Ligature work 2018-10-31 00:15:00 -07:00
Behdad Esfahbod 28b68cffe4 [mort] Implement / adjust Contextual substitution 2018-10-30 23:54:29 -07:00
Behdad Esfahbod 11dbf0f129 [mort] More fixes] 2018-10-30 21:49:59 -07:00
Behdad Esfahbod e1552af95b [maxp] Minor 2018-10-30 21:09:05 -07:00
Behdad Esfahbod 0cf282a32e [mort] Grind some more 2018-10-30 20:52:12 -07:00
Behdad Esfahbod 90667b31bc [mort] Hook up more 2018-10-30 20:15:28 -07:00
Behdad Esfahbod 9346b1f158 [morx] Remove stale comment 2018-10-30 20:04:13 -07:00
Behdad Esfahbod f864ef215e [mort] More massaging towards mort 2018-10-30 19:42:21 -07:00
Behdad Esfahbod 2d9467340b [mort] Fix version check in sanitize 2018-10-30 19:33:42 -07:00
Behdad Esfahbod c2527a1bc2 [mort] Make it compile / hook it up
Untested.
2018-10-30 19:26:39 -07:00
Behdad Esfahbod 933babdc07 [mort] Fixup on previous commit 2018-10-30 19:22:43 -07:00
Ebrahim Byagowi b053cabacd [mort] Bring back mort generalizations
Started by reverting https://github.com/harfbuzz/harfbuzz/commit/1f1c85a5

Just a starting point, if we agree even mort can come back.
2018-10-30 19:18:06 -07:00
Behdad Esfahbod 5cd544a621 Fix build
Fixes https://github.com/harfbuzz/harfbuzz/issues/1338
2018-10-30 19:16:00 -07:00
Behdad Esfahbod 1019391046 2.1.0 2018-10-30 15:52:26 -07:00
Behdad Esfahbod bfd549daaa Fix everything-bot 2018-10-30 14:47:27 -07:00
Garret Rieger 0e1ad5a075 [subset] Limit the number of scripts and langsys' that should be checked when collecting features. 2018-10-30 14:15:58 -07:00
Behdad Esfahbod a7aba99baa [name] Rename hb_name_id_t to hb_ot_name_id_t
https://github.com/harfbuzz/harfbuzz/pull/1254
2018-10-30 14:04:09 -07:00
Simon Tooke 881e1054bc fix various GCC function pointer warnings 2018-10-30 13:17:54 -07:00
Behdad Esfahbod dc9bd29fea [CBDT] Implement Format18 get_extens
Part of https://github.com/harfbuzz/harfbuzz/issues/1327
2018-10-30 13:16:07 -07:00
Behdad Esfahbod a2a7422aaf [CBDT] Bound checks in reference_png 2018-10-30 13:14:56 -07:00
Khaled Hosny 0af3d176a6 [sbix] Fix memory leak in early return
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11210
2018-10-30 17:05:28 +02:00
Behdad Esfahbod 138f9e0f25 Minor 2018-10-30 01:31:13 -07:00
Ebrahim Byagowi f7a08cd41d
Fix extra semicolon issues and test that on CI (#1330) 2018-10-30 11:29:09 +03:30
Behdad Esfahbod 7e998d193a Fix spurious warning re uninitialized use 2018-10-30 00:52:22 -07:00
Behdad Esfahbod b186274362 [set/map] Fix uninitialized memory
I keep forgetting that primitive types are NOT initialized during construction. :|
2018-10-29 23:21:14 -07:00
Behdad Esfahbod 4ef671f25f [unicode] Fix a long-standing double-declaration warning 2018-10-29 22:46:19 -07:00
Behdad Esfahbod 166ae8b0aa Remove now unused hb_auto_t<> 2018-10-29 22:40:37 -07:00
Behdad Esfahbod 56e0fd345c Remove last use of hb_auto_t<> 2018-10-29 22:35:44 -07:00
Behdad Esfahbod ca5e5a4979 Port Coverage::Iter off hb_auto_t<> 2018-10-29 22:30:21 -07:00
Behdad Esfahbod 3a4e5dd425 Remove a few unnecessary hb_auto_t<>'s
See a85641446c30247c4e948263f0f8c1147ed4efb9
2018-10-29 22:27:20 -07:00
Behdad Esfahbod 67a22f377d [set/map/vector] Make constructable, but not copy or assignable
Disable copy/assign on them, as they shouldn't.

Make constructor / destructor call init_shallow/fini_shallow,
and make those idempotent.  So, these three can be constructed
on stack now and no init/fini call is needed.  As such,
hb_auto_t<> is not needed anymore.  I'll remove that separately.
2018-10-29 22:23:22 -07:00
Behdad Esfahbod ea0e51d1b1 Add HB_NO_CREATE_COPY_ASSIGN 2018-10-29 16:00:23 -07:00
Behdad Esfahbod 5b563640b2 Remove HB_DISALLOW_COPY_AND_ASSIGN from hb_ot_shape_planner_t
It was arbitrary that this struct had it and not dozens of others.
2018-10-29 15:58:44 -07:00
Behdad Esfahbod 14b353c185 One more iteration 2018-10-29 15:29:13 -07:00
Behdad Esfahbod c7c5df9ffd Try fixing older bots
Older C++ doesn't allow struct-with-constructor in union.
2018-10-29 15:16:52 -07:00
Behdad Esfahbod be87959a67 [cmap] Minor 2018-10-29 15:16:38 -07:00
Behdad Esfahbod 35d410f2ba Remove ASSERT_POD
Newer compilers / language allows structs with constructor in union.
So, this was not actually testing anything.  Indeed, the recent
change in DISALLOW_COPY *is* making some of our types non-POD.
That broke some bots.

Just remove this since it wasn't doing much, and I'd rather have
DISALLOW_COPY.
2018-10-29 14:45:44 -07:00
Behdad Esfahbod 6f0454e176 Fix extra-semicolon warnings 2018-10-29 13:51:15 -07:00
Behdad Esfahbod a256a92b3f Make Array types uncopyable-unassignable
Finally!  Catches hard-to-find errors like this:

-    const SortedArrayOf<SVGDocumentIndexEntry> docs = this+svgDocEntries;
+    const SortedArrayOf<SVGDocumentIndexEntry> &docs = this+svgDocEntries;

We implement this for our array types.  This, in turn, trickles down
into all types that embed the arrays.  So, as long as we define all
open-ended structs in terms of Array types (all can be done using
UnsizedArrayOf), this achieves the goal of making uncopyable all
structs that are variable-sized.  Yay!
2018-10-29 11:40:21 -07:00
Behdad Esfahbod 31cc1f74b7 [svg] Minor 2018-10-29 11:14:37 -07:00
Behdad Esfahbod 1366bb9760 Fix g-i warnings 2018-10-29 11:01:25 -07:00
Ebrahim Byagowi ae802c2c6e
[test-ot-color] Minor 2018-10-29 13:42:14 +03:30
Ebrahim Byagowi 7170e35096
Rename deprecated symbols list file name and clean it up (#1328) 2018-10-29 13:11:01 +03:30
Ebrahim Byagowi 9c692e5b8d [test-ot-color] Use public APIs on the tool 2018-10-29 12:22:39 +03:30
Ebrahim Byagowi fb525f8943 Rename dump-emoji to test-ot-color 2018-10-29 11:40:06 +03:30
Ebrahim Byagowi 81bcf47e9e Revive dump-emoji 2018-10-29 11:40:06 +03:30
Ebrahim Byagowi f10252b4b6
[svg] Fix incorrect array referencing 2018-10-29 10:29:58 +03:30
Behdad Esfahbod 5eb251aab0 [cbdt] Implement strike selection logic 2018-10-28 23:16:13 -07:00
Behdad Esfahbod 98bddbc8ef [sbix] Minor 2018-10-28 23:14:15 -07:00
Behdad Esfahbod 8cffee0577 [cbdt] Simplify more 2018-10-28 23:07:59 -07:00
Behdad Esfahbod 574579d376 [color] Rename get_strike() to choose_strike() 2018-10-28 23:04:37 -07:00
Behdad Esfahbod e2ba96da4c [cbdt] Refactor get_strike() 2018-10-28 23:01:57 -07:00
Behdad Esfahbod 6983cca9c8 [cbdt] Minor 2018-10-28 22:46:18 -07:00
Behdad Esfahbod e998fb9fbf [color] Round extents when scaling 2018-10-28 22:45:53 -07:00
Ebrahim Byagowi c929ccfcea [ot-color/png] Consider strike ppem on scaling 2018-10-28 22:40:40 -07:00
Behdad Esfahbod a8c9facf7a [svg] Cosmetic 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 9c1460e568 [svg] Use SortedArrayOf.bsearch 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 18dd6363a5 [svg] Minor 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 4876c938a2 [sbix] Comment 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 519fca1014 [color] Minor 2018-10-28 18:33:10 -07:00
Behdad Esfahbod e8ff27c208 Minor 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 6562172381 [sbix] Use LOffsetLArrayOf<> 2018-10-28 18:33:10 -07:00
Behdad Esfahbod a3ddd8067f [sbix] Add get_strike 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 95524ed9bc [sbix] Remove sbix_len 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 69e9846452 [sbix] Fix get_glyph_blob() on Null object 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 4e0ee2af09 [sbix] Simplify ppem access
If struct members are simple and needed publicly, we make them public.
2018-10-28 18:33:10 -07:00
Behdad Esfahbod 6ac9a4eaa3 [sbix] Simplify glyph_length calc 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 0730d62385 [sbix] Check glyph data end is in range 2018-10-28 18:33:10 -07:00
Behdad Esfahbod b76dc03108 [sbix] Reduce code 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 50fb02a219 [sbix] Check glyph id before looking into unsafe array
That 'Z' at end of imageOffsetsZ is a reminder that you should check...
2018-10-28 18:33:10 -07:00
Behdad Esfahbod a8cb9c73da [sbix] Simplify 'dupe' handling logic 2018-10-28 18:33:10 -07:00
Behdad Esfahbod d7eb534e59 [sbix] Check offsets before proceeding 2018-10-28 18:33:10 -07:00
Behdad Esfahbod c8380bd3e4 [color] Remove more dump-emoji cruft 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 68f2c832c8 Remove dump-emoji 2018-10-28 18:33:10 -07:00
Behdad Esfahbod b46de42b3a [sbix] Fix order of parameters 2018-10-28 18:33:10 -07:00
Behdad Esfahbod a91cda72ab [sbix] Remove redundant parameter 2018-10-28 18:33:10 -07:00
Behdad Esfahbod c712005f55 [sbix] Add get_strike() 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 400bc3f030 [sbix] Remove a couple of extra checks 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 3770282c83 [sbix] Rename sbix_table to table in accelerator 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 7346841807 [cbdt] Rename reference_blob_for_glyph() to reference_png() 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 1f33b8525d [sbix] Rename ugly reference_blob_for_glyph() to reference_png() 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 946b534419 [sbix] Fix uninitialized variables 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 01c7d53fb7 [sbix] Select best strike based on ppem 2018-10-28 18:33:10 -07:00
Behdad Esfahbod f9f26bff4c [sbix] Move code around. Add get_extents() 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 48bc3039cb [sbix] Check blob length against PNG header leangth 2018-10-28 18:33:10 -07:00
Ebrahim Byagowi d3ec31a57c [ot-color] More on PNGHeader fields 2018-10-28 18:33:10 -07:00
Ebrahim Byagowi 35fa3d3260 [ot-color] Apply Behdad comment 2018-10-28 18:33:10 -07:00
Ebrahim Byagowi 307d61867a [ot-color] Make PNGHeader reading actually work 2018-10-28 18:33:10 -07:00
Ebrahim Byagowi 632e9af862 [ot-color] Implement PNGHeader and test it, it doesn't work however 2018-10-28 18:33:10 -07:00
Ebrahim Byagowi 38706a0746 [ot-color] Preparation for setting PNG width/height in extents 2018-10-28 18:33:10 -07:00
Behdad Esfahbod d6d6f3bc22 [docs] Add comment 2018-10-28 18:33:10 -07:00
Ebrahim Byagowi 3d4c1f6a41 [ot-color] Apply Behdad reviews 2018-10-28 18:33:10 -07:00
Ebrahim Byagowi 8ef0d2ef92 [ot-color] Apply Behdad comment 2018-10-28 18:33:10 -07:00
Ebrahim Byagowi dbd419bede [ot-color] Add public API for CBDT/sbix/SVG color Emojis 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 6ce49a921a [name] Change hb_name_id_t back to unsigned int
d941f66c75 (commitcomment-31076011)
2018-10-28 08:26:30 -07:00
Behdad Esfahbod a4f4f5ba5f [docs] Fix titles here as well 2018-10-28 08:23:36 -07:00
Behdad Esfahbod 213b6dd335 [name] Make sure hb_name_id_t is int-sized
d941f66c75 (commitcomment-31068905)
2018-10-27 18:36:24 -07:00
Behdad Esfahbod 1d40d72f29 [docs] Hook up hb-var 2018-10-27 05:01:01 -07:00
Behdad Esfahbod 80d9a427cf [docs] Document remaining sections 2018-10-27 04:58:32 -07:00
Behdad Esfahbod cf5fa57f00 [docs] Change section titles again
I think I like the uniform "hb-*" more.
2018-10-27 04:51:42 -07:00
Behdad Esfahbod 04981ee05d [docs] More 2018-10-27 04:47:41 -07:00
Behdad Esfahbod 5dd86aa33b [docs] Rename section titles to object names
More useful.
2018-10-27 04:47:41 -07:00
Behdad Esfahbod 524fb70216 [docs] More 2018-10-27 04:47:41 -07:00
Behdad Esfahbod 46072b7cb5 [ot] Fold hb-ot-tag.h into hb-ot-layout.h 2018-10-27 04:47:41 -07:00
Behdad Esfahbod 00cf4e5eb6 [docs] Fill in some sections 2018-10-27 04:47:41 -07:00
Behdad Esfahbod 55a19d73b4 Move HB_EXTERN 2018-10-27 04:47:41 -07:00
Ebrahim Byagowi 524e854c15
Merge pull request #1318 from ebraminio/png
Add a non-hooked _png _svg get emoji blob
2018-10-27 15:04:43 +03:30
Ebrahim Byagowi 8180c37df0 [ot-color] Remove _png and _svg public APIs 2018-10-27 14:54:08 +03:30
Ebrahim Byagowi 9aa6279a2d [ot-color/png] Try to get image blob from sbix first options.aat is set 2018-10-27 14:24:58 +03:30
Ebrahim Byagowi b42661ee91 [ot-color] Add some documentation 2018-10-27 14:15:38 +03:30
Behdad Esfahbod 4ee3c8272c [docs] Fix hb_name_id_t
Yep, was not recognized without this patch!
2018-10-27 03:18:45 -07:00
Ebrahim Byagowi 9435fb24da [ot-color/png] Implement CBDT part 2018-10-27 13:47:11 +03:30
Behdad Esfahbod d941f66c75 [name] Make hb_name_id_t be the enum
This is like hb_script_t.

We had this exposed as unsigned int since 2.0.0 release in two APIs,
as well as hb_ot_layout_get_size_params() from earlier.
But since no one uses those (right?!), let's just fix this now.
2018-10-27 03:06:14 -07:00
Behdad Esfahbod 40496a54a0 [name] Move HB_NAME_ID_INVALID into the enum
Don't know how to document anonymous enum members.
2018-10-27 03:06:14 -07:00
Behdad Esfahbod a8a55b9f89 [name] Move around 2018-10-27 03:06:14 -07:00
Behdad Esfahbod 3b7e5f1313 [name] Rename hb_ot_name_get_names() to hb_ot_name_list_names()
And swap return value positions, so can be annotated for gobject-introspectin.
2018-10-27 03:06:14 -07:00
Behdad Esfahbod 4025ad8043 Document new API 2018-10-27 03:06:14 -07:00
Ebrahim Byagowi 5e2a52f71a [sbix] Remove dump method from sbix accelerator 2018-10-27 12:44:33 +03:30
Ebrahim Byagowi 0353ac6cde
Fix test-name-table on older bots 2018-10-27 12:24:53 +03:30
Ebrahim Byagowi dc11a38107
[sbix] Set num_glyphs on accelerator
dump-emoji was broken without it
2018-10-27 12:15:25 +03:30
Ebrahim Byagowi 6a38fd68a8 [ot-color/png] sbix runtime memory check 2018-10-27 11:17:27 +03:30
Behdad Esfahbod ca645accb9 Comment 2018-10-27 00:39:31 -07:00
Ebrahim Byagowi 265ad408ca [ot-color/png] Implement sbix part 2018-10-27 10:43:46 +03:30
Behdad Esfahbod 7f5941e162 Remove stale comment
Ugliness was fixed in 30eab97a00
But yeah, my smell detector was working.  Ugliness was buggy.
2018-10-27 00:06:48 -07:00
Behdad Esfahbod e7400c0275 [docs] Hook up new symbols 2018-10-26 22:24:40 -07:00
Behdad Esfahbod 6aa019c4af [morx] Fix merge_cluster to end at last ligature component
Don't assume current position was a component in the ligature.
2018-10-26 22:02:17 -07:00
Behdad Esfahbod 00ae4be6bf [morx] Fix bailing out ligation at end-of-text
Check was after a move_to, which wouldn't work.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11147
2018-10-26 21:59:20 -07:00
Behdad Esfahbod 30eab97a00 Fix invalid memory read
Buffer might be relocated inside replace_glyphs().

Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=895117
2018-10-26 21:54:40 -07:00
Behdad Esfahbod 79b2fa62ca [indic] Fix infinite loop
Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=863044
2018-10-26 21:22:26 -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 b2e1ec374c [subset] Fix warning 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 337ea0b717 [fuzzing] Remove HB_NDEBUG
Not sure why it ever was added.
2018-10-26 21:22:26 -07:00
Behdad Esfahbod c965eeadbc [name] Default to "en" if language is not specified 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 3fd6e5dbef [name] Add pre-defined nameIDs 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 20d0171d20 [name] Fill out most missing language codes 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 622b014faf [name] Skip enumerating names with unknown language 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 2c39f359e4 [utf] Remove unused typedef 2018-10-26 21:22:26 -07:00
Behdad Esfahbod ce81c74298 [utf] Fix ASCII 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 327546e633 [name] Hook up ltag table 2018-10-26 21:22:26 -07:00
Behdad Esfahbod dc9a5f88b4 [name] Do record sanitization at run-time 2018-10-26 21:22:26 -07:00
Behdad Esfahbod a53d301b1c [name] Minor 2018-10-26 21:22:26 -07:00
Behdad Esfahbod c442fd9a10 [name] Add src/test-name-table tool to show all font names 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 7007bd9dff [name] Rebuild language list, include missing entries 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 68f172101c [name] Fix cmp for invalid language 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 888a65615c [name] Fix nul-termination bug 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 9b532e2ed4 [name] Add language mapping 2018-10-26 21:22:26 -07:00
Behdad Esfahbod e2f9b65775 [name] Start adding language support 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 6db6bbe64b [name] Remove unused cmp function 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 4668a05006 [name] Hook things up
Accept Mac Latin name entries as ASCII as well.
2018-10-26 21:22:26 -07:00
Behdad Esfahbod 69f5da0629 [name] More
It assumes all names are encoded in UTF16-BE.  Other than that, and not
listing languages correctly, it's *supposed* to work.
2018-10-26 21:22:26 -07:00
Behdad Esfahbod 64334aff8c [name] Fix check 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 5531bd068e [name] Flesh out UTF-X to UTF-X conversion routines 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 84811a06a2 [name] Fix for rebase changes to hb_array_t 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 1046b1938b [name] Some more 2018-10-26 21:22:26 -07:00
Behdad Esfahbod b4d4d1ea78 [name] Return full string length from API 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 8d304ef7f9 [utf] Add UTF16-BE and UTF32-BE 2018-10-26 21:22:26 -07:00
Behdad Esfahbod a826a8730f [name] Hide internal details from public API 2018-10-26 21:22:26 -07:00
Behdad Esfahbod e7c595a9f0 [name] More 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 75cd8c86bd [name] Add hb_ot_name_get_utf() 2018-10-26 21:22:26 -07:00
Behdad Esfahbod c783d36324 [name] Pre-allocate array 2018-10-26 21:22:26 -07:00
Behdad Esfahbod c2aa409537 [name] Start implementing hb_ot_name_get_utf16() 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 740cde8991 [name] Implement hb_bytes_t get_name() 2018-10-26 21:22:26 -07:00
Behdad Esfahbod c3425f2401 [name] Add hb-ot-name.cc for realz 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 90420ed8cb [name] Implement hb_ot_name_get_names() 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 9a6c87c17d [name] Finish accelerator sorting 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 2157e56b34 [name] Start implementing public API infrastructure 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 0bf93ec0fb [name] Add public API declarations 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 982c2f4a65 [indic/khmer/myanmar/use] Clarify clear_syllable
No logic change.
2018-10-26 15:40:45 -07:00