Commit Graph

4964 Commits

Author SHA1 Message Date
Behdad Esfahbod 19ec366fb1 Fix previous commit
Automake has this stupid behavior where if your Makefile.am has
syntactic error, it can get to a state that make succeeds but just
ignores broken Makefile.am.  Ouch.
2018-03-26 15:09:54 -07:00
Behdad Esfahbod 44b6c77c64 Try fixing linking again
Before 1.7.5, we were setting -fno-exceptions etc on CXXFLAGS. In 1.7.6
we set it as CPPFLAGS. Try fixing. Also, I'm fairly sure it's safe to
set these unconditionally.

Fixes https://github.com/harfbuzz/harfbuzz/issues/880 (or so I hope)
2018-03-26 14:26:45 -07:00
Behdad Esfahbod e4d1cbfb4f Add HB_SUBSET_BUILTIN
Fixes https://github.com/harfbuzz/harfbuzz/issues/865
2018-03-26 14:09:29 -07:00
Behdad Esfahbod c14b24fcd0 Add HB_NO_ATEXIT 2018-03-26 10:44:54 -07:00
Ebrahim Byagowi aa53cb50ba
[aat] Unprefix not essentially layout tables (#921) 2018-03-26 13:28:26 +04:30
Behdad Esfahbod a289aaff47 [aat/ltag] Whitespace 2018-03-26 01:14:07 -07:00
Ebrahim Byagowi 158f2810b2
[aat/ltag] Implement the table parsing (#911) 2018-03-26 12:04:30 +04:30
Ebrahim Byagowi 9eee38a55c
[aat/fmtx] Implement the table parsing (#910) 2018-03-25 23:56:02 +04:30
Ebrahim Byagowi fe18c471a4 [dwrite] minor 2018-03-25 18:41:26 +04:30
Behdad Esfahbod ebccd01974 More ULL fixes
Fixes https://github.com/harfbuzz/harfbuzz/issues/901
2018-03-24 17:51:55 -07:00
Behdad Esfahbod 7ec3ba21f0 Define uint64_t constants with ULL suffix
Fixes https://github.com/harfbuzz/harfbuzz/issues/901
2018-03-24 14:12:12 -07:00
Chun-wei Fan 19256bef9d hb-private.hh: Add fallback implementation for round()
For pre-C99 compilers that do not support round(), we need to have a
simplistic implementation for it, when it is not detected during build
configuration, either via CMake or autotools, by using floor() and
ceil(), which are provided in the pre-C99 compilers.

Please see discussion at commit 86a0ac2 for more details for re-adding
this patch.
2018-03-23 15:52:33 -07:00
Ebrahim Byagowi 2a23606339
Fix llvm-gcc-4.2 compile issue and add a macOS bot to test it (#899) 2018-03-23 18:37:01 +04:30
Ebrahim Byagowi 7919033ce8
[dwrite] Replace rest of 'malloc/free's with 'new/delete' (#897) 2018-03-22 16:04:38 +04:30
Garret Rieger 3f55e0e746 [subset] Check for the Null table and not nullptr to detect failure to find a table in glyf accelerator. 2018-03-20 19:47:36 -06:00
Garret Rieger 45def99eae [subset] Fix to debug message. 2018-03-20 19:47:36 -06:00
Garret Rieger 1396614040 [subset] don't use pointers returned from push after array has resized in hb-subset-glyf.cc 2018-03-20 19:47:36 -06:00
Garret Rieger 3531efdb4c [subset] Fixed out of bounds read when subsetting hdmx. 2018-03-20 19:47:36 -06:00
Garret Rieger e597436b99 [subset] Disable glyf accelerator_t methods if it didn't successfully init. 2018-03-20 19:47:36 -06:00
Garret Rieger 7251181b56 [subset] Fix infinite loop in there are more then 32 tables. 2018-03-20 19:47:36 -06:00
Garret Rieger 1a94804d35 [subset] Add a fix for segfault in hmtx/vmtx subsetting code. 2018-03-20 19:47:36 -06:00
Ebrahim Byagowi 957e775663
[dwrite] Use new again and enable the build on msys2 bots (#890) 2018-03-19 12:19:42 +03:30
Ebrahim Byagowi 8d1b4082ae
Appropriate fix for msys2 bot fail on gen-def.py (#894) 2018-03-17 01:05:03 +03:30
Garret Rieger aa9612d35f [subset] Fix fuzzing build for hb-subset-fuzzer. 2018-03-16 09:04:01 -07:00
Garret Rieger 1beb08862e [subset] First pass at setting up a fuzzing program for hb-subset. 2018-03-16 09:04:01 -07:00
Behdad Esfahbod a0dccb6188 Add NameID 2018-03-15 07:47:02 -07:00
Behdad Esfahbod 56946d21c0 [color/COLR] Simplify 2018-03-15 07:47:02 -07:00
Behdad Esfahbod 6418ae4e8a [color/COLR] Clean up 2018-03-15 07:47:02 -07:00
Behdad Esfahbod 150c53ee96 [color/COLR] Fix bad sanitize
Bad bad bad bad code. Don't do that. If compiler's not happy, understand why.
2018-03-15 07:47:02 -07:00
Behdad Esfahbod 399c800b93 [color/COLR] Clean up 2018-03-15 07:47:02 -07:00
Behdad Esfahbod 9e337341d5 [color/cbdt] Clean up 2018-03-15 07:47:02 -07:00
Behdad Esfahbod 86a0ac284f Revert "hb-private.hh: Add fallback implementation for round()"
This reverts commit b9dcbb1f83.

This is gross. Should be only done if a specific macro is defined. Not the other way
around. This fails my build as autotools companions where not added anyway.
2018-03-15 07:47:02 -07:00
Ebrahim Byagowi d4907e83ef
[dwrite] GCC/mingw/msys2 compatibility (#884) 2018-03-14 11:04:28 +03:30
Ebrahim Byagowi 93f8f89ded
[ci] Trying to fix gen-def issue on appveyor (#885) 2018-03-14 09:56:31 +03:30
Chun-wei Fan b9dcbb1f83 hb-private.hh: Add fallback implementation for round()
Add a simplistic round() implementation for our purposes, used when the
compiler does not support round() directly.
2018-03-13 20:17:52 +08:00
Ebrahim Byagowi 28f25f32fc
[ot-color/SVG] Minor (#878) 2018-03-12 14:00:11 +03:30
Behdad Esfahbod fb0f3e3767 [sbix] Clean up 2018-03-11 20:38:40 +01:00
Ebrahim Byagowi 218fa7166e
[ot-color] SVG table implementation (#874) 2018-03-10 11:13:52 +03:30
Ebrahim Byagowi 4c63c82383
[ot-color] sbix table implementation (#870) 2018-03-10 11:07:56 +03:30
Ebrahim Byagowi 62b3d8fb70
[dev-run] minor 2018-03-10 00:44:36 +03:30
Garret Rieger 39b2f69fab [subset] Drop the same tables by default as fontTools does. 2018-03-08 16:30:36 -08:00
Garret Rieger 869ccac5ab [subset] use create_sub_blob instead of manually copying the post table. 2018-03-08 11:06:49 -08:00
Garret Rieger dd10769993 [subset] drop all glyph names from the post table. 2018-03-07 11:36:54 -08:00
Garret Rieger 91867cda6a [subset] cleanup. 2018-03-07 10:17:06 -08:00
Garret Rieger 0e8f9430c8 [subset] Skip subsetting vhea. 2018-03-07 10:03:52 -08:00
Garret Rieger 64cf53d619 [subset] Subset vmtx if present. 2018-03-07 10:03:52 -08:00
Behdad Esfahbod ff2f81432b 1.7.6 2018-03-07 16:05:14 +01:00
Behdad Esfahbod ac2ece3e15 [ot] Comment out AAT include 2018-03-07 15:52:42 +01:00
Behdad Esfahbod 23a9ac9938 Remove hb-ot-color.h
So I can make a release.
2018-03-07 15:51:42 +01:00
Behdad Esfahbod 790a117007 [ot] Remove hb-ot-base.h
BASE table API will go into hb-ot-layout.h.
2018-03-07 15:31:15 +01:00
Behdad Esfahbod f014a124f5 [set] Fix algebra
Was totally b0rked. Ouch!

Fixes https://github.com/harfbuzz/harfbuzz/issues/863
2018-03-07 10:49:26 +01:00
Behdad Esfahbod 7587683cdc [set] Minor
In preparation to fix https://github.com/harfbuzz/harfbuzz/issues/863

Binary operations are sets are completely broken. Ouch.
2018-03-07 09:57:11 +01:00
Behdad Esfahbod e4cbb87bd3 Minor 2018-03-07 09:37:22 +01:00
Behdad Esfahbod c6150333c2 Sign 2018-03-07 09:27:16 +01:00
Ebrahim Byagowi 9b4a5d7ef1
[ci] Enable -Werror=unused (#862) 2018-03-07 00:23:40 +03:30
Ebrahim Byagowi 54cbe6702c
[ot-color] Further improvements on COLR/CPAL implementation (#859)
* Implemented a bsearch on get_base_glyph_record
* Made get_color_record_argb actually work
2018-03-06 16:41:08 +03:30
Ebrahim Byagowi 18d14b8e0d
[dev-run] an option to open using a GUI app 2018-03-05 14:25:11 +03:30
Ebrahim Byagowi a3e29fd38f
[aat/kerx] Add a TODO 2018-03-04 02:56:27 +03:30
Ebrahim Byagowi 0ef6ab25ab
[ot-color] Move cbdt to the namespace (#860) 2018-03-04 02:47:26 +03:30
Ebrahim Byagowi f7399796a1
Enable coverage test on autotools (#857) 2018-03-03 22:55:09 +03:30
Ebrahim Byagowi c446c23f0f
[ot-color] Move the related tables to hb-ot-color-* (#858) 2018-03-03 22:43:23 +03:30
Ebrahim Byagowi 48ed15a2bc
[COLR/CPAL] Provide enough helper for rasterization (#855) 2018-03-03 22:00:29 +03:30
Ebrahim Byagowi 432758a7ac
[COLR] Revert previous sanitization on the table
That sanitization wasn't right, firstLayerIndex is an index from beginning of the Layer Records
not the table itself.
2018-03-03 01:05:59 +03:30
Ebrahim Byagowi 71b4598ea3
[aat/kerx] Improve format 6 subtable 2018-03-02 11:04:09 +03:30
Ebrahim Byagowi b73a5a1c24
[aat/kerx] Make parsing of the table actually work (#850) 2018-03-02 00:07:26 +03:30
Ebrahim Byagowi a570edcde2
[COLR] Sanitize BaseGlyphRecord (#854) 2018-03-02 00:06:03 +03:30
Ebrahim Byagowi 7e958646a4
[CPAL] Fix version checking logic on sanitizer (#851) 2018-03-01 10:27:18 +03:30
rsheeter 588a4e0f9b
Merge pull request #845 from googlefonts/drophints
[subset] drop hints from composites
2018-02-28 13:52:29 -08:00
Rod Sheeter b3f1a045a8 [subset] kick the build 2018-02-28 11:41:24 -08:00
Rod Sheeter 20d5739923 [subset] extract a method to flip off composite instruction flag 2018-02-28 11:15:08 -08:00
Ebrahim Byagowi f671f7f0a8 [colr] Implement 2018-02-28 13:19:40 +03:30
Ebrahim Byagowi 772274625e
Merge pull request #841 from ebraminio/color
Support CPAL table
2018-02-28 12:05:49 +03:30
Ebrahim Byagowi 5b9c234043 [CPAL] Refactor and address the reviews 2018-02-28 11:25:29 +03:30
Rod Sheeter 6836a82142 [subset] remove WE_HAVE_INSTRUCTIONS from composites when dropping hints 2018-02-27 20:51:12 -08:00
Rod Sheeter ffcb5cbf71 [subset] update the test file for composite, fix an offset calculation 2018-02-27 20:17:04 -08:00
Rod Sheeter c8b230e437 Merge branch 'expand-tests' of github.com:googlefonts/harfbuzz into drophints 2018-02-27 17:25:32 -08:00
Rod Sheeter b3790a65a1 [subset] add a (failing for now) test for composite glyf hint dropping 2018-02-27 17:23:30 -08:00
Garret Rieger 921b65cbc2 [subset] minor fixes in hb-ot-maxp-table.hh 2018-02-27 14:37:18 -08:00
Garret Rieger b26db48bff [subset] whitespace for hb-ot-maxp-table.hh 2018-02-27 14:14:05 -08:00
Garret Rieger a76344da79 [subset] Add maxpV1Tail instead of defining a struct inside maxp for v1 data. 2018-02-27 14:11:36 -08:00
Garret Rieger f14d1b64c2 [subset] when dropping hints, clear hint related fields in maxp. 2018-02-27 13:49:43 -08:00
Behdad Esfahbod d7633d0a40 [BASE] More 2018-02-27 12:50:57 -08:00
Behdad Esfahbod 7a70c20fec [BASE] Clean up first 29% 2018-02-27 12:46:16 -08:00
Ebrahim Byagowi 101850f9e6 Merge with master 2018-02-27 20:17:25 +03:30
Ebrahim Byagowi f110c0c886
Merge pull request #838 from harfbuzz/BASE
BASE table
2018-02-27 11:41:12 +03:30
Ebrahim Byagowi 0ad8c663e0 Remove public API of the branch 2018-02-27 11:02:33 +03:30
rsheeter 4a1d51ef15
Merge pull request #818 from googlefonts/drophints
[subset] Drop hints
2018-02-26 20:23:41 -08:00
Rod Sheeter 903771b6c7 [subset] clearer name for trim() and better comment about composite handling, per review feedback 2018-02-26 19:50:06 -08:00
Garret Rieger 44dc36dd82 [subset] update to comment in hb-ot-os2-unicode-ranges.hh 2018-02-26 17:56:23 -08:00
Garret Rieger ad3f2f77da [subset] small cleanups in hb-ot-os2-table. 2018-02-26 17:51:27 -08:00
Garret Rieger f1c8fc3487 [subset] small updates to gen-unicode-ranges.py 2018-02-26 17:48:51 -08:00
Garret Rieger 0c0fe2ff82 [subset] Move util/generated-unicode-ranges.py to src/gen-unicode-ranges.py 2018-02-26 17:47:10 -08:00
Garret Rieger f630ae5161 [subset] unsigned int -> hb_codepoint_t. 2018-02-26 17:46:17 -08:00
Garret Rieger 6368ce4c92 [subset] const in _compare_range. 2018-02-26 17:44:39 -08:00
Garret Rieger 0be9fea0a9 [subset] Add comment to os2UnicodeRangesSorted. 2018-02-26 16:15:09 -08:00
Garret Rieger e20ab71d12 [subset] Fix incorrect index. 2018-02-26 16:13:10 -08:00
Garret Rieger 074b5a29a1 [subset] Add special case handling of bit 57 in os2 ulUnicodeRange. 2018-02-26 16:11:24 -08:00
Garret Rieger f757757eda [subset] Add cmake build def for test-unicode-ranges. 2018-02-26 16:00:33 -08:00
Garret Rieger f82f2a3e50 [subset] Rename hb-os2-unicode-ranges.cc to test-unicode-ranges.cc. 2018-02-26 16:00:33 -08:00
Garret Rieger 4014555ca0 [subset] set ulUnicodeRange[] in os2. 2018-02-26 16:00:33 -08:00
Garret Rieger a570142d0c [subset] Move hb-ot-os2-unicode-ranges into a cc file with a helper methods and tests. 2018-02-26 16:00:33 -08:00
Garret Rieger 8e81799b32 [subset] Add hb-ot-os2-unicode-ranges.hh, a map of os2 unicode ranges. 2018-02-26 16:00:33 -08:00
Ebrahim Byagowi 6c844ae8e8
[dev-run] show images using iTerm2 images feature 2018-02-26 23:04:27 +03:30
Behdad Esfahbod 28c4245e9f [aat/ankr] Define Anchor struct 2018-02-26 01:10:42 -08:00
Behdad Esfahbod e347fb908b Minor 2018-02-26 01:08:50 -08:00
Behdad Esfahbod 05fbd14e71 [aat/ankr] Minor
DEFINE_SIZE_MIN is to be used only in rare cases. For fixed-size structs
we want DEFINE_SIZE_STATIC.
2018-02-26 01:04:16 -08:00
Behdad Esfahbod f90cd9b1f5 [aat/ankr] Hook up Lookup table 2018-02-26 01:03:23 -08:00
Behdad Esfahbod c36598450e [aat/ankr] Simplify 2018-02-26 00:57:07 -08:00
Behdad Esfahbod fa3a69e233 [aat/trak] Simplify sanitize() 2018-02-26 00:32:11 -08:00
Behdad Esfahbod f0bc6c0992 [aat/trak] Clean up
We always just used "unsigned int" for counter values. There's
no use for uint16_t outside of a struct.

Also, no need for explict casting where implicit does.
2018-02-26 00:18:17 -08:00
Ebrahim Byagowi bb82f01383 [aat] trak sanitization 2018-02-26 00:15:26 -08:00
Ebrahim Byagowi becb1d9eea
[aat] minor
Ops, this was done for testing
2018-02-26 11:29:48 +03:30
Behdad Esfahbod df1c7d5b60 Minor 2018-02-25 19:06:25 -08:00
Behdad Esfahbod 6dd46fa598 [aat/trak] Minor
Maybe we should make DEFINE_* make structs uncopyable.
2018-02-25 18:54:52 -08:00
Ebrahim Byagowi ae14dd0fb0 [aat] Implement ankr 2018-02-25 17:01:39 -08:00
Behdad Esfahbod 551fa2d200 [BASE] Minor 2018-02-25 16:32:17 -08:00
Behdad Esfahbod 05699fd996 Merge remote-tracking branch 'eroux/add-base' 2018-02-24 12:03:26 -08:00
Ebrahim Byagowi cd28eb9f5d
Add -Werror=unused-function check to Travis (#832) 2018-02-24 14:17:54 +03:30
Ebrahim Byagowi 1ab16f4556
[aat] Implement trak logic (#816) 2018-02-24 12:49:42 +03:30
Behdad Esfahbod b91e8da36e Include hb-version.h in git (#825) 2018-02-24 10:21:17 +03:30
Rod Sheeter 2e3ee489f8 [subset] format tweak, doc string 2018-02-23 18:18:54 -08:00
Rod Sheeter d78393b554 Merge branch 'master' of https://github.com/harfbuzz/harfbuzz into drophints 2018-02-23 17:53:26 -08:00
Rod Sheeter 1454d82a9d [subset] keep glyph trim separate of more general get_offset 2018-02-23 17:49:23 -08:00
Rod Sheeter 0ac8c0c1e6 [subset] zero glyf and loca memory before writing so pads are clean. Test just the part of maxp we care about 2018-02-23 17:43:00 -08:00
Behdad Esfahbod dc5c7927e7 [subset] Caclculate head table checksum adjustment
Test still fails, because we do not serialize tables in the same
order that fonttools subsetter does.
2018-02-23 16:59:53 -08:00
Garret Rieger 7e5e1feb66
Merge pull request #828 from googlefonts/mem-fixes
[subset] Fix several memory leaks in subsetting.
2018-02-23 17:59:08 -07:00
Behdad Esfahbod ec2538c880 [subset] Fix checksum calc out-of-bounds access 2018-02-23 15:51:26 -08:00
Garret Rieger 99967e21c6 [subset] Fix memory leak in hb-subset-glyf. 2018-02-23 15:45:45 -08:00
Garret Rieger e61f360dc8 [subset] Fix memory leak in hb-subset-plan. 2018-02-23 15:44:21 -08:00
Garret Rieger 66b0a39079 [subset] Fix memory leak in hb-subset. 2018-02-23 15:41:52 -08:00
Garret Rieger 0fb8a5ce19 [subset] Fix memory leak in cmap subsetting. 2018-02-23 15:37:43 -08:00
Garret Rieger 4665aaa193 [subset] Fix memory leak in hmtx subsetting. 2018-02-23 15:36:14 -08:00
Garret Rieger 5a36b55fba [subset] Fix memory leak in subset face destroy. 2018-02-23 15:30:14 -08:00
Ben Boeckel d38f37b2e3 autoconf: provide a harfbuzz-config for use from CMake (#822) 2018-02-24 01:25:53 +03:30
Behdad Esfahbod e0939d811f Clean up check-defs and check-symbols (#821)
Also, call c++filt on their results.

Also build and fix and check harfbuzz-gobject.def

Also changes harfbuzz-gobject to distribute generated enum sources.
2018-02-24 00:49:34 +03:30
Rod Sheeter 9bd6d25254 [subset] clone trim logic from fonttools glyf handling 2018-02-23 13:05:58 -08:00
Behdad Esfahbod c2e4713b5b [hdmx] Fix sanitize() 2018-02-23 10:45:03 -08:00
Behdad Esfahbod 84d4bb91ce [hdmx] Minor 2018-02-23 10:38:35 -08:00
Behdad Esfahbod cf7a6e520e [hdmx] Move DeviceRecord to toplevel again
More readable.
2018-02-23 10:34:26 -08:00
Garret Rieger 96d7805a92 [subset] More complete sanitization implementation for hdmx. 2018-02-22 16:48:28 -08:00
Garret Rieger c02532a3d2 [subset] Formatting and comments in hdmx. 2018-02-22 16:40:50 -08:00
Garret Rieger 6b372f439b [subset] In hb-ot-hdmx-table, s/glyf/hdmx. 2018-02-22 15:42:39 -08:00
Garret Rieger ec302ad5bd [subset] Fail subset if a table fails to sanitize. 2018-02-22 15:42:39 -08:00
Garret Rieger aa4aa2353c [subset] Enable hdmx subsetting. 2018-02-22 15:42:39 -08:00
Garret Rieger bd18b6adf8 [subset] Move DeviceRecord inside of hdmx. 2018-02-22 15:42:39 -08:00
Garret Rieger 6704cded65 [subset] Add hdmx subsetting implementation. 2018-02-22 15:42:39 -08:00
Garret Rieger 84b68e5886 [subset] In hdmx serialize set the correct value of sizeDeviceRecord. 2018-02-22 15:42:39 -08:00
Garret Rieger dddf44279f [subset] When serializing a DeviceRecord in hdmx pad to make 32 bit aligned. 2018-02-22 15:42:39 -08:00
Garret Rieger ab7a8f3b74 [subset] Begin implementing serialize for hdmx. 2018-02-22 15:42:39 -08:00
Garret Rieger fe42862ab3 [subset] Sketch out a basic hb-ot-hdmx.hh. 2018-02-22 15:42:39 -08:00
Ebrahim Byagowi a6bd6bcee0
[dev-run] minor 2018-02-22 16:52:56 +03:30
Ebrahim Byagowi fa13a04cf3
[dev-run] Add gdb/lldb shortcuts 2018-02-22 16:48:03 +03:30
Rod Sheeter 4f07437dfe [subset] sketch out dropping in-glyf instructions. Sometimes yields differnet size glyphs than fonttools, possibly due to padding not being corrected 2018-02-21 22:23:05 -08:00
Rod Sheeter 2d0265242b [subset] keep the result of _subset 2018-02-21 17:04:24 -08:00
Behdad Esfahbod 4fb97be78d Add two more ragel-generated headers
Fixes https://github.com/harfbuzz/harfbuzz/issues/817
2018-02-21 14:38:16 -08:00
Rod Sheeter 74e0c13a4a [subset] drop hint tables if so flagged. Still need to dump glyf instructions. 2018-02-21 11:19:18 -08:00
Rod Sheeter 0bd100e144 [subset] add --hinting flag 2018-02-21 10:34:00 -08:00
Rod Sheeter 7ecca8c0a8 [subset] keep the result of _subset 2018-02-21 09:42:46 -08:00
Behdad Esfahbod eada749e46 Use HB_SET_VALUE_INVALID consistently 2018-02-21 00:35:47 -08:00
Garret Rieger 2cc845f311 [subset] fix calculation of range shiftz. Should be 16 * len - searchRange not 16 * (len - searchRange). 2018-02-20 18:36:11 -08:00
Garret Rieger 8e614ade5a [subset] Reverse table order for font serialization to match what OTS expects. 2018-02-20 18:36:11 -08:00
Garret Rieger a998eeee4a [subset] sanity check glyph data writes during glyph subsetting to ensure they are inbounds. 2018-02-20 18:01:16 -08:00
Garret Rieger 0ab73e5942 [subset] Sanity check that loca writes are inbounds. 2018-02-20 18:01:16 -08:00
Garret Rieger 73e20ec6e9
Merge pull request #812 from googlefonts/cleanup
Clean up of glyf subsetting.
2018-02-20 17:34:59 -07:00
Behdad Esfahbod 6ae4013f2e [aat] Cosmetic touch-ups to trak table 2018-02-20 15:02:25 -08:00
Behdad Esfahbod abc82b493e Add Ragel-generated files to git
I know it's bad form; I know I've said no to this multiple times...
But this is part of an experiment to see if we can make rolling HarfBuzz
into Chrome much faster. That will give us a lot more testing exposure
that currently Chrome does.

Doing this while those files are still considered ignored by our
gitignore rules; will see how that flies.
2018-02-20 14:36:14 -08:00
Garret Rieger 69e443b254 [subset] Switch to hb_blob_copy_writable_or_fail in glyf subsetting. 2018-02-20 14:29:21 -08:00
Garret Rieger e3e0ac9823 [subset] Move glyf subsetting code into hb-ot-glyf-table.hh 2018-02-20 14:07:40 -08:00
Behdad Esfahbod d1f16fce96 Don't use %zu
Some of our bots / compilers don't like it. Wasn't caught by bots because this
is only in debug code.

825ad378e0
2018-02-20 10:32:09 -08:00
Ebrahim Byagowi c7e834a2fc
[dev-run] minor 2018-02-20 17:59:04 +03:30
Ebrahim Byagowi 975c35214f
[dev-run] Support autotools builds 2018-02-20 17:49:29 +03:30
Dominik Röttsches 25136d9b72 Use %zu format specifier for size_t to fix cross platform build
Fixes Chromium Android builds, compare
https://ci.chromium.org/buildbot/tryserver.chromium.android/linux_android_rel_ng/491787
2018-02-20 14:01:15 +02:00
Ebrahim Byagowi a64eacd8a6 [aat] First dig on 'trak' 2018-02-19 13:05:03 -08:00
Behdad Esfahbod 0bff6991de Ugh. Really fix build. 2018-02-19 11:51:25 -08:00
Behdad Esfahbod 4fcbd22b18 Fix build after previous commit 2018-02-19 11:49:25 -08:00
Behdad Esfahbod 0bbf90ded0 [subset] Don't include hb-subset.h from hb.h 2018-02-19 11:39:07 -08:00
Ebrahim Byagowi fde04777d1
Check availability of entr instead now that this works with it 2018-02-19 20:00:07 +03:30
Behdad Esfahbod e2d2d81984 Limit how much work sanitize() can do
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6022
2018-02-18 17:28:53 -08:00
Behdad Esfahbod 7033fe5877 [aat] Minor 2018-02-18 17:12:04 -08:00
Behdad Esfahbod 6fa690c75a Fix debug build
Context needs to be called 'c'. The TRACE_* rely on that.
2018-02-18 16:27:59 -08:00
Behdad Esfahbod 05d1e77db8 [aat] Silence warning 2018-02-18 16:26:04 -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
Ebrahim Byagowi 79756c9039
[aat] First dig on 'kerx' (#704) 2018-02-19 03:17:44 +03:30
Behdad Esfahbod 279c70a5b3
Merge pull request #796 from ebraminio/dev-run
Add a continuous builder using fswatch
2018-02-18 14:04:33 -08:00
Ebrahim Byagowi 89b82814b6 Add a continuous builder using fswatch 2018-02-18 23:56:00 +03:30
Behdad Esfahbod 97a7110215 Fix BitScanForward() usage
Should fix Win64 bot.
2018-02-18 10:50:24 -08:00
Behdad Esfahbod fe8f40a418
Merge branch 'master' into bitops 2018-02-18 10:45:33 -08:00
David Corbett 21646cc4a6 Do not mark the first glyph as unsafe to break
Fixes #791.
2018-02-17 13:35:34 -08:00
Behdad Esfahbod e5ab34fd3a Misc fixes
Should bring bag djgpp bot.
2018-02-16 18:29:29 -08:00
Garret Rieger 2130392dcc [subset] Add support for updating reference gids in components to their new values. 2018-02-16 18:29:29 -08:00
Garret Rieger 49544eb860 [subset] Refactor composite glyf iteration code into an Iterator outside of the accelerator. 2018-02-16 18:29:29 -08:00
Garret Rieger dc6d67df13 [subset] Use gids_to_retain_sorted to produce old gid -> new gid mapping since it now has the more complete set. 2018-02-16 18:29:29 -08:00
Garret Rieger dcac9fe964 [subset] Use complex glyph closure to populate gids_to_retain_sorted. 2018-02-16 18:29:29 -08:00
Garret Rieger 58a54c9d4f [subset] add constant to get_composite and in_table methods in hb-ot-glyf-table 2018-02-16 18:29:29 -08:00
Garret Rieger 73e1434814 [subset] Add a DFS search to produce a closure of composite glyphs. 2018-02-16 18:29:29 -08:00
Garret Rieger d368414143 [subset] add helper methods to glyf accelerator for reading composite glyph information. 2018-02-16 18:29:29 -08:00
Behdad Esfahbod cd11107bb4 Another bitops fallback fix
I'm confident that all bugs are hashed out now.
2018-02-16 18:28:58 -08:00
Behdad Esfahbod 4e517ecb6b Another bitops fallback impl fix 2018-02-16 18:20:12 -08:00
Behdad Esfahbod f18b9fbf65 [set] Implement iteration using bitop intrinsics 2018-02-16 18:14:41 -08:00
Behdad Esfahbod 6a91a2eb04 Fix wide bitops implemenetation 2018-02-16 17:49:41 -08:00
Behdad Esfahbod d25c3e69e9 [set] Readjust parameters 2018-02-16 17:45:09 -08:00
Behdad Esfahbod 6d5c0bf8b1 Fix bitops fallback impl 2018-02-16 17:33:26 -08:00
Behdad Esfahbod 82eb1dac16 Flesh out other bit ops some more for 128bit as well 2018-02-16 16:52:09 -08:00
Behdad Esfahbod 864a2dddae Clean up bit functions
Compile all code-paths possible, to better catch errors.
Also enable MSVC ones on mingw which seems to support them.
2018-02-16 16:09:38 -08:00
Behdad Esfahbod 978ace6fbb Improve _hb_popcount()
Support 128bit type.
2018-02-16 16:08:45 -08:00
Behdad Esfahbod 7b5ce74047 Fix warnings 2018-02-16 15:38:02 -08:00
rsheeter 926db87455
Merge pull request #792 from googlefonts/master
Support more tables in subsetter
2018-02-16 15:27:29 -08:00
Arkady Shapkin d37310ac5d Remove checking macros __OPTIMIZE__ for MSVC
Visual C++ compiler doesn't define macros __OPTIMIZE__  when optimizations enabled
2018-02-16 12:40:11 -08:00
Rod Sheeter be0a01a676 Merge branch 'master' of https://github.com/harfbuzz/harfbuzz 2018-02-16 06:01:41 -08:00
Ebrahim Byagowi 139c9928f6
Fix hb-private.hh compile issue 2018-02-16 13:27:26 +03:30
Arkady Shapkin 6c10328eb8 Use _BitScanForward and _BitScanReverse on MSVC 2018-02-15 14:31:25 -08:00
Rod Sheeter 7acaa3b781 [subset] apparently C99 is too much to ask in 2018 2018-02-15 14:28:29 -08:00
Rod Sheeter b1740106a9 [subset] fix format specifier for size_t 2018-02-15 13:55:21 -08:00
Rod Sheeter e00c37aaae [subset] fix no matching function MIN in djgpp 2018-02-15 12:53:52 -08:00
Rod Sheeter 0758cbc4c2 [subset] correct bug introduced to get_advance 2018-02-15 11:29:01 -08:00
Rod Sheeter 3fd11f4397 [subset] remove unused decl 2018-02-15 11:15:12 -08:00
Rod Sheeter 0e088a63d1 [subset] hmtx space bracket. authors++ 2018-02-14 21:11:45 -08:00
Rod Sheeter 1725c35da0 [subset] cmap space bracket 2018-02-14 19:36:33 -08:00
Rod Sheeter e158739bfb [subset] space bracket 2018-02-14 19:22:37 -08:00
Rod Sheeter 2d6b1e2af7 [subset] maxp copy writeable fn 2018-02-14 19:14:01 -08:00
Rod Sheeter 1efecd965f [subset] hmtx use copy writeable fn instead of direct memory 2018-02-14 19:05:41 -08:00
Behdad Esfahbod b1bd0b5f50 [subset] Minor 2018-02-14 18:50:19 -08:00
Behdad Esfahbod 5ae6526ef4 [subset] Merge remote-tracking branch 'googlefonts/master' 2018-02-14 18:42:32 -08:00
Garret Rieger 0775bc0f7a [subset] Fix hhea subsetting and clean up some memory leaks. 2018-02-14 16:37:35 -08:00
Garret Rieger b56c9384bc [subset] Add missing face reference in hb-subset-plan plus ensure all struct members are cleaned up on destroy. 2018-02-14 16:05:39 -08:00
Garret Rieger e330ef3711 [subset] Restore hb_face_data_destroy to be internal. 2018-02-14 15:57:18 -08:00
Garret Rieger 3ab7d2649b [subset] Fix memory leak in hb-ot-{maxp,os2}. Plus some formatting. 2018-02-14 15:48:57 -08:00
Behdad Esfahbod 2903b2f357 Another linker tweaking
Trying to fix this warning:
cc1: warning: command line option ‘-fno-threadsafe-statics’ is valid for C++/ObjC++ but not for C

Let's see what the clang bots think of it.
2018-02-14 15:46:27 -08:00
Behdad Esfahbod e1f1f96577 [set] Tune size again
Switch from a 128+64 hierarchy, to 32+32. New page size is 1024.
This should make set iteration faster, without affecting other op
performances much.
2018-02-14 15:44:48 -08:00
Rod Sheeter 66e282df32 [subset] remove TODO that was already done 2018-02-14 15:31:13 -08:00
Rod Sheeter 4696624ad9 [subset] maxp wrong int type, note to use copy_writable_or_fail 2018-02-14 15:30:49 -08:00
Rod Sheeter 3ed70e5e64 [subset] return bool not hb_bool_t from table::subset 2018-02-14 15:24:49 -08:00
Rod Sheeter 88d56e241b [subset] Use a supplier instead of memcpy and fix a few unnecessary {}s for cmap 2018-02-14 15:20:43 -08:00
Rod Sheeter 42a80f00d5 [subset] add free 2018-02-14 15:04:35 -08:00
Rod Sheeter d463e9f6b5 [subset] Give Behdad credit again 2018-02-14 15:04:15 -08:00
Rod Sheeter fa87770372 [subset] First pass at hmtx 2018-02-14 14:53:10 -08:00
Behdad Esfahbod ccae99fdad Another try 2018-02-14 11:12:09 -08:00
Behdad Esfahbod 8c3612af65 Tweak Makefile some more 2018-02-14 10:57:34 -08:00
Behdad Esfahbod d594f947b6 [subset] Allow linking to libstdc++
We want to use it.
2018-02-14 10:55:25 -08:00
Rod Sheeter a0fe3011ba copy all cmap groups at once 2018-02-14 10:52:41 -08:00
Garret Rieger d008b62887 Merge remote-tracking branch 'upstream/master' into fixed 2018-02-14 10:38:52 -08:00
Garret Rieger 89f17e3965 [subset] capitalize dsig. 2018-02-14 10:19:50 -08:00
Garret Rieger df6d780355 [subset] Extract maxp subsetting into hb-ot-maxp-table. 2018-02-14 10:19:50 -08:00
Garret Rieger 343dfe8965 [subset] white and add inline in hb-ot-cmap-table. 2018-02-14 10:19:50 -08:00
Garret Rieger 24904383df [subset] Correct usFirstCharIndex and usLastCharIndex in OS2 table when subsetting. 2018-02-14 10:19:50 -08:00
Ebrahim Byagowi 109314cb55
Another attempt on fixing the tests on Travis (#788) 2018-02-14 21:05:11 +03:30
Behdad Esfahbod 694eaf6367 [set] Add backwards iterator
New API:
- hb_set_previous()
- hb_set_previous_range()
2018-02-14 01:00:10 -08:00
Behdad Esfahbod fe3bc524bd [set] Allow starting iteration from a non-member of the set 2018-02-13 23:51:45 -08:00
Behdad Esfahbod a989f3edec Add hb_blob_copy_writable_or_fail()
New API:
- hb_blob_copy_writable_or_fail()
2018-02-13 22:12:36 -08:00
Behdad Esfahbod 9046e92442 [subset] Rename constructor to hb_subset_input_create_or_fail()
To signify that unlike rest of library, returns nullptr on failure.
2018-02-13 22:07:12 -08:00
Behdad Esfahbod 507804479a [use] Add dump-use-data 2018-02-13 21:46:28 -08:00
Behdad Esfahbod 15ba4fbe01 [khmer] Add dump-khmer-data 2018-02-13 21:41:51 -08:00
Behdad Esfahbod effddd03bd [myanmar] Add dump-myanmar-data 2018-02-13 21:38:15 -08:00
Behdad Esfahbod c0e45b60a0 [indic] Rename print-indic-table to dump-indic-data
Makes more sense given what this prints, err, dumps.
2018-02-13 21:25:16 -08:00
Behdad Esfahbod 9b878bd216 [indic] Explicitly number indic_position_t
So it's easier to cross-reference from output of print-indic-table.
2018-02-13 21:22:47 -08:00
Behdad Esfahbod 8634846a0a More tweaking linker and linker flags 2018-02-13 21:18:00 -08:00
Behdad Esfahbod d830d3d244 [indic] Share some copy/pasta code 2018-02-13 19:01:03 -08:00
Behdad Esfahbod 397ed53e55 [indic] Add print-indic-table 2018-02-13 18:54:26 -08:00
Behdad Esfahbod fd0bde6325 [subset] Fix loca offsets
Was writing source font's offsets. Ouch.
2018-02-13 16:35:30 -08:00
Behdad Esfahbod aeed082e28 Another tweak at libstdc++ things
To fix this warning:

cc1: warning: command line option ‘-fno-threadsafe-statics’ is valid for C++/ObjC++ but not for C
2018-02-13 14:02:59 -08:00
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 d5b33f2fe1 [subset] hb_subset_input_t changes 2018-02-13 13:55:10 -08:00
Behdad Esfahbod 28e63a1287 Disable threadsafe static's for all libraries
Even in libharfbuzz-subset, we still will handle our own threadsafety
for statics.
2018-02-13 13:50:21 -08:00
Behdad Esfahbod b969a82e30 Pass no-libstdc++ flags only to libraries suppressing it 2018-02-12 20:51:26 -08:00
Behdad Esfahbod 97a2f03200 [subset] Allocate bulk memory with malloc(), not calloc()
We use calloc() to allocate simple structs and set them to zero.
For bulk memory, use malloc() that doesn't zero.
2018-02-12 18:51:10 -08:00
Behdad Esfahbod 96f1f52ea3 Use hb_face_get_upem() instead of face->get_upem()
Such that hmtx accelerator can be used from libharfbuzz-subset.
2018-02-12 18:49:38 -08:00
Behdad Esfahbod 3d66f441cc [subset] Remove unreachable code
sanitizer.sanitize never return nullptr.
2018-02-12 18:43:42 -08:00
Behdad Esfahbod 42040a273f Allow libharfbuzz-subset to link to libstdc++
We want to use it instead of reinventing hashmap...

Also, don't change linker for ICU since libicu also uses libstdc++.
2018-02-12 18:41:36 -08:00
Ebrahim Byagowi 4af3c5e258 Move linker specifying to a better place 2018-02-12 18:39:42 -08:00
Rod Sheeter d1a4d5616f output format 12 as enc 10 to match how Roboto did it 2018-02-12 16:25:32 -08:00
Rod Sheeter afb1da3a18 auto-completed the wrong gids_to_retain 2018-02-12 14:37:47 -08:00
Rod Sheeter 1330edc4fe Use functions to get new gids. Avoid 0; fonttools drops it from cmap. 2018-02-12 14:29:23 -08:00
Garret Rieger e8318188c0 [subset] Fix loca generation, was previously writing the original glyph starting offset. 2018-02-12 11:38:28 -08:00
Khaled Hosny 0b94d590d9 Rename --with-stdcpp → --with-libstdc++
Also improve wording a bit and fix make check in --with-libstdc++=yes.
2018-02-12 12:37:41 -07:00
Rod Sheeter a5713bc2cb we love all our groups 2018-02-12 11:30:57 -08:00
Rod Sheeter 692f86e569 drop GDEF, GPOS, GSUB, and dsig 2018-02-12 11:30:57 -08:00
Garret Rieger 83e1ef9215 [subset] Set the new number of glyphs in maxp. 2018-02-12 11:22:50 -08:00
Garret Rieger 427f9e4b90 Don't force loca version to long. 2018-02-12 11:18:28 -08:00
Garret Rieger 5df080bf15 Destroy the subset plan at the end of subsetting. 2018-02-12 10:15:59 -08:00
Rod Sheeter 0301e5be28 Build a working cmap format 12 2018-02-12 10:12:11 -08:00
Rod Sheeter ebd31d376d subset for real 2018-02-12 10:10:08 -08:00
Rod Sheeter 62c7d677e8 C-style comments 2018-02-12 10:09:35 -08:00
Ebrahim Byagowi 91f0d51f05
Fix symbol exporting issue on msys2 and bringing all the bots (#781) 2018-02-12 17:20:12 +03:30
Ebrahim Byagowi 133e17fe23
Minor 2018-02-12 15:24:22 +03:30
Ebrahim Byagowi 16f5b53eec
Minor, don't skip the whole test when one .def file not found 2018-02-12 15:18:13 +03:30
Ebrahim Byagowi a9b650d384
Apply check-defs.sh to -icu and -subset, toward mingw fix (#780) 2018-02-12 15:10:13 +03:30
Ebrahim Byagowi 2efc896550
Add --with-stdcpp for ossfuzzer and mupdf use (#770) 2018-02-12 12:00:07 +03:30
Behdad Esfahbod 7747bdb11b Remove linker selection from hb-ucdn
Since this is a convenience library, it's not actually linked. Or so I think.
Hoping this might fix this Appveyor failure:

https://ci.appveyor.com/project/harfbuzz/harfbuzz/build/job/9884jyb5vryja9pw

Making all in hb-ucdn
make[4]: Entering directory '/c/projects/harfbuzz/src/hb-ucdn'
  CC       libhb_ucdn_la-ucdn.lo
  GEN      libhb-ucdn.la
/bin/sh: libhb_ucdn_la-ucdn.lo: command not found
make[4]: *** [Makefile:404: libhb-ucdn.la] Error 127
make[4]: Leaving directory '/c/projects/harfbuzz/src/hb-ucdn'
make[3]: *** [Makefile:2548: all-recursive] Error 1
make[3]: Leaving directory '/c/projects/harfbuzz/src'
make[2]: *** [Makefile:1382: all] Error 2
make[2]: Leaving directory '/c/projects/harfbuzz/src'
make[1]: *** [Makefile:486: all-recursive] Error 1
make[1]: Leaving directory '/c/projects/harfbuzz'
make: *** [Makefile:418: all] Error 2
2018-02-11 19:12:52 -08:00
Behdad Esfahbod 90d1c740c3 Add MSVC to no-visibility list 2018-02-11 19:08:59 -08:00
Behdad Esfahbod 0db6c6f214 Add Sun compiler to no-visibility as well
Fixes https://github.com/harfbuzz/harfbuzz/pull/776
2018-02-11 18:29:01 -08:00
Behdad Esfahbod dde6448379 Another try at fixing multiple-defintion of NullPool
This one might do it...
2018-02-11 18:24:22 -08:00
Behdad Esfahbod 41906cd5ef [subset] Another fixup
I broke this in c31fcf4c58
2018-02-11 19:46:06 -06:00
Behdad Esfahbod cd32177a32 Try at fixing multiple-definition of NullPool
If we don't have visibility, make NullPool static.
2018-02-11 19:36:00 -06:00
Behdad Esfahbod 3d421ce307 [subset] Use auto_array_t where it does make sense
Better fix for https://github.com/harfbuzz/harfbuzz/pull/775
2018-02-11 19:01:44 -06:00
Behdad Esfahbod 9aa2eb61e6 Minor 2018-02-11 19:00:49 -06:00
Ebrahim Byagowi c8d4c2e32f
Initialize bad_indices on hb-subset (#775) 2018-02-11 13:15:44 +03:30
Ebrahim Byagowi 5845e5ca3b
fix gobject compile issue (#773) 2018-02-11 12:03:33 +03:30
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 7039803b51 Fix djgpp bot 2018-02-10 15:47:50 -06:00
Behdad Esfahbod cdab20df1e Minor 2018-02-10 15:45:17 -06:00
Ebrahim Byagowi 203b647530 Favor use of static instead HB_INTERNAL 2018-02-10 15:44:09 -06:00
Behdad Esfahbod 43314ff4c0 More fixes
test-subset-glyf still failing. No idea why :(
2018-02-10 15:40:03 -06:00
Behdad Esfahbod a981d798ea Fix more build issues
Hopefully most bots come back with this...
2018-02-10 15:19:27 -06:00
Ebrahim Byagowi 6c4ca6135a
Hide more symbols of hb-subset (#771) 2018-02-11 00:42:06 +03:30
Behdad Esfahbod c31fcf4c58 [subset] Replace auto_array with prealloced_array
auto_array has constructor/destructor. Cannot be used in POD object, as the clang
bots all noticed...
2018-02-10 14:20:10 -06:00
Behdad Esfahbod 931d67900e Fix some other bots 2018-02-10 14:11:16 -06:00
Behdad Esfahbod bfa871634c Minor 2018-02-10 14:06:53 -06:00
Ebrahim Byagowi 844f48ea9a
Fix symbol exporting and libstdc++ linkage of hb-subset (#769) 2018-02-10 23:13:12 +03:30
Behdad Esfahbod 91519c6a5b [aat] Add buffer messages 2018-02-10 13:35:17 -06:00
Behdad Esfahbod af274507c4 Minor 2018-02-10 13:25:49 -06:00
Behdad Esfahbod 570d523761 [subset] Merge remote-tracking branch 'googlefonts/master' 2018-02-10 13:24:22 -06:00
Behdad Esfahbod 71130a20fa Replace Supplier.advance with Supplier::operator+= 2018-02-10 13:15:57 -06:00
Ebrahim Byagowi ad575a5f47
Fix cast warnings on clang (#768) 2018-02-10 19:50:11 +03:30
Garret Rieger d18decd201 In glyf subsetting add suport for writing out a short loca table when possible. 2018-02-09 18:41:21 -08:00
Rod Sheeter 9275bd03ea First pass at building a cmap 2018-02-09 17:40:52 -08:00
Garret Rieger d2170d1478 Check for failures from add table. 2018-02-09 17:27:23 -08:00
Rod Sheeter 4816064c0e add missing return 2018-02-09 17:14:37 -08:00
Garret Rieger 0089443756 Keep a second set of glyph ids in subset plan which is sorted by glyph id and always has gid 0 2018-02-09 16:22:09 -08:00
Garret Rieger 3bc81558d8 Formatting for hb-subset-plan. 2018-02-09 16:06:33 -08:00
Behdad Esfahbod 8cef3a6199 Try fixing build with Sun Studio
Trying to fix:
https://circleci.com/gh/harfbuzz/harfbuzz/6635

Also part of:
https://github.com/harfbuzz/harfbuzz/issues/630
2018-02-09 16:04:23 -06:00
Garret Rieger 86aa4b3ba7 Return empty face on hb_subset failure instead of null. Plus some minor cleanups for _add_head_and_set_loca_version 2018-02-09 13:54:43 -08:00
Behdad Esfahbod d45f240e4e Typo 2018-02-09 15:51:45 -06:00
Behdad Esfahbod 3b7aa651b4 [docs] Improve UNSAFE_TO_BREAK docs 2018-02-09 15:43:20 -06:00
bungeman 671f0a7733 Documentation for HB_GLYPH_FLAG_UNSAFE_TO_BREAK.
HB_GLYPH_FLAG_UNSAFE_TO_BREAK means that the glyph with this flag is somehow affected by the previous logical glyph (the previous index in the buffer if ltr and the next index if the buffer is rtl). If these two glyphs are separated by a break (line or otherwise) then the underlying text should be re-shaped on both sides up to corresponding position in the text of some glyph not marked with this flag.
2018-02-09 15:39:45 -06:00
Garret Rieger 1582eabee6 Update head table with loca format selected by glyf+loca subsetting. 2018-02-09 12:52:08 -08:00
Garret Rieger 335bbaa66f Remove uneeded code in hb-subset. 2018-02-09 10:55:15 -08:00
Rod Sheeter 1cd98d05e0 Create the groups for a cmap format12. Does not yet build the actual table. 2018-02-08 19:39:57 -08:00
Rod Sheeter 59c658c8d5 capture codepoints sorted so we can use them for cmap later. one day we will have a map 2018-02-08 19:22:47 -08:00
Rod Sheeter 5cca0c07af fix comment 2018-02-08 19:05:46 -08:00
Rod Sheeter a19138e668 comment the serialization of table 2018-02-08 19:04:06 -08:00
Garret Rieger 5a34114f96 Add an extra entry to the end of the loca table to identify the end of the last glyph's data. 2018-02-08 18:32:24 -08:00
Garret Rieger aac7d96212 Apply per table subsetting while building the new face in hb_subset. 2018-02-08 18:18:16 -08:00
Behdad Esfahbod 9682ef135f Minor fixups 2018-02-08 17:35:57 -06:00
Garret Rieger 42234424a0 Fix include gaurds and include order in hb-subset-glyf and hb-subset-plan 2018-02-08 17:31:11 -06:00
Garret Rieger 8e9fd6f1ab Implement basic loca (long version only) subsetting. 2018-02-08 17:31:11 -06:00
Garret Rieger f9c665fed1 Update interface to hb-subset-glyf to subset glyf and loca. 2018-02-08 17:31:11 -06:00
Garret Rieger 217ed5e3c8 Cleanups in hb-subset-glyf and hb-subset-plan. 2018-02-08 17:31:11 -06:00
Rod Sheeter 13193a9b97 move to the hb_face_t dest pattern 2018-02-08 17:31:11 -06:00
Rod Sheeter 0859a00669 sketch a subset<T> and call it for cmap. Add subset to cmap, albeit not working even for the msot basic case just yet 2018-02-08 17:31:11 -06:00
Behdad Esfahbod c1ab95dd90 Fix overflow in space fallback shaping
Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=657466
2018-02-08 17:22:07 -06:00
Behdad Esfahbod b220b5a444 Avoid undefined-behavior in fallback mark positioning
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5584
2018-02-08 17:14:52 -06:00
Behdad Esfahbod 3b68a03a1c [fuzzer] Minor 2018-02-08 17:00:37 -06:00
Behdad Esfahbod 5021ba2a21 [aat] Minor 2018-02-08 15:11:28 -06:00
Behdad Esfahbod 77ad8b5c8b TODO 2018-02-07 21:54:33 -06:00
Behdad Esfahbod 941bbd9f25 [subset] Fix thinko 2018-02-07 21:49:01 -06:00
Behdad Esfahbod 931f8b7eb5 Fix another thinko 2018-02-07 21:42:03 -06:00
Behdad Esfahbod 39b86695cf [subset] Fix thinko 2018-02-07 21:37:03 -06:00
Behdad Esfahbod eeffabc875 Build 2018-02-07 21:34:05 -06:00
Behdad Esfahbod c479a59988 [subset] Assemble font 2018-02-07 21:26:04 -06:00
Behdad Esfahbod 34ac3548b7 [set] Respect stride
Ouch!
2018-02-07 18:07:45 -06:00
Behdad Esfahbod 577becaf7b [subset] Fixup 2018-02-07 17:38:40 -06:00
Behdad Esfahbod c9acab3cfb Whitespace 2018-02-07 17:28:43 -06:00
Behdad Esfahbod 7fd0b61dee [subset] Create new face and copy all tables to it
test-subset fails now because subset-face does not know how to compile itself.
2018-02-07 17:28:43 -06:00
Garret Rieger 4e1abe2ce0 Refactor subset glyf to remove multiple calls to glyf.fini() 2018-02-07 17:28:43 -06:00
Garret Rieger 0a5d1440f8 Add implementation of glyf subsetting. 2018-02-07 17:28:43 -06:00
Garret Rieger 05d65baa1b Extract glyf offset calculation into it's own method. 2018-02-07 17:28:43 -06:00
Behdad Esfahbod 6d7c6e19dc Fix two undefined-behavior issues
Fixes https://github.com/harfbuzz/harfbuzz/issues/761
Fixes https://github.com/harfbuzz/harfbuzz/issues/762
2018-02-07 14:09:56 -06:00
Behdad Esfahbod b87cbe2bec Try fixing build for platforms that have no visibility attributes 2018-02-07 14:11:26 -05:00
Behdad Esfahbod 6804b61d2e [subset] Add hb_subset_face
It's a hb_face_t that has add_table() and in the future knows how to
compile itself into a font blob.
2018-02-07 13:47:35 -05:00
Behdad Esfahbod af02812fc5 [subset] Change hb_subset API to remove hb_subset_face_t 2018-02-07 13:07:46 -05:00
Behdad Esfahbod 2da0d87e76 Remove NullPool visibility hack
We keep a separate private NullPool in libharfbuzz-subset.so
This can fire back later since now there are two separate null objects,
and comparisons to the null pool can be confused.  Something to deal
with when it comes up. Ouch!
2018-02-07 12:44:35 -05:00
Rod Sheeter b95aa204ee glyph ids to retain should most likely keep the glyph id not the codepoint 2018-02-07 12:41:21 -05:00
Rod Sheeter 91428713bd Remove \ns leftover from fprintf 2018-02-07 12:41:21 -05:00
Rod Sheeter eb485bb9e9 Horrid hack to assign new gids. Use DEBUG_MSG over fprintf 2018-02-07 12:41:21 -05:00
Rod Sheeter 8b80cbb1dd Add a subset debug category 2018-02-07 12:41:21 -05:00
Behdad Esfahbod ee433d36fa [aat] Set debug lookup_index 2018-02-07 12:41:21 -05:00
Rod Sheeter 38df1ec8e0 TEMPORARY: remove HB_INTERNAL from null pool so subset builds again 2018-02-07 12:41:21 -05:00
Garret Rieger 53aa0e9542 Add an instance of glyf::accelerator_t to hb-subset-glyf. 2018-02-07 12:41:21 -05:00
Rod Sheeter ef62dfed3f add back assert_pod 2018-02-07 12:41:21 -05:00
Rod Sheeter d0ce3c66e2 Resolve codepoints:glyph ids. Does not compile; undefined reference to OT::_hb_NullPool 2018-02-07 12:41:21 -05:00
Garret Rieger 6a45e5df24 Add skeleton of hb-subset-glyf, call if from hb_subset(...) 2018-02-07 12:41:21 -05:00
Garret Rieger 31ec3c2ec4 Create a subset plan in hb_subset. 2018-02-07 12:41:21 -05:00
Garret Rieger 25e9173fe8 Make hb-subset-plan private. 2018-02-07 12:41:21 -05:00
Garret Rieger af46a4da5a Move definition of hb_subset_input into hb-subset-private.hh. 2018-02-07 12:41:21 -05:00
Garret Rieger 7481f0ce21 Add codepoints to subset input. 2018-02-07 12:41:21 -05:00
Garret Rieger 1cfe650f02 Add a basic sketch of hb-subset-plan. 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 2971e9da49 [aat] Adjust unsafe-to-break logic some more
I believe I'm happy with it now.
2018-02-06 11:48:04 -05:00
Behdad Esfahbod f49256d80f [aat] Simplify unsafe-to-break logic 2018-02-06 11:39:36 -05:00
Behdad Esfahbod cc1e0840ba [buffer] Tweak diff re glyph_flags again
We expect the buffer to have no flags that the reference doesn't...
Meh. Makes MORX tests pass now. Need to better define the behavior.
2018-02-06 10:20:48 -05:00
Ebrahim Byagowi d49ae5154e Fix hb-buffer logic error 2018-02-06 10:13:11 -05:00
Behdad Esfahbod f41b92134a Fix fallthrough compiler warning with gcc >= 7
Fixes https://github.com/harfbuzz/harfbuzz/issues/755
2018-02-05 19:51:09 -05:00
Behdad Esfahbod 0ff007daaa [subset] Minor 2018-02-05 19:36:38 -05:00
Behdad Esfahbod ae39fc8171 [subset] Build hb-subset into separate libharfbuzz-subset.so 2018-02-04 20:18:52 -05:00
Behdad Esfahbod 257022b178
Merge pull request #745 from googlefonts/master
Interface for hb_subset, skeleton for the hb-subset cli, and basic testing rigging.
2018-02-04 20:01:35 -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
Garret Rieger f83a43b561 Add CMake configuration for all of the new subsetting code. 2018-02-04 12:57:34 -08:00
Garret Rieger 34fa7b3ad2 Whitespace 2018-02-04 12:57:34 -08:00
Garret Rieger 8c3a672737 Get test-subset to pass. 2018-02-04 12:57:34 -08:00
Garret Rieger 74d39ed263 Attach add a hb_face_t to hb_subset_face_t. 2018-02-04 12:57:34 -08:00
Garret Rieger a2965f2ea5 Add a basic implementation of hb-subset to enable compilation of test-subset. 2018-02-04 12:57:33 -08:00
Garret Rieger cf403e1a53 Add hb-subset.h to hb.h 2018-02-04 12:57:33 -08:00
Garret Rieger c02573516c Fix typo in hb-subset.h 2018-02-04 12:57:33 -08:00
Rod Sheeter 9ccb8366f6 Start to sketch APIs for subsetting 2018-02-04 12:57:33 -08: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
Bruce Mitchener e8859fca3e Enable use of atexit() on macOS and related platforms.
The atexit() man page indicates that this is expected to behave
in the expected way on unloading of shared libraries.
2018-02-03 19:20:40 -08:00
Bruce Mitchener a89573770b Use nullptr, not NULL. 2018-02-03 21:26:58 +02:00
David Corbett ccb0367dae Let VS1 follow U+1031 MYANMAR VOWEL SIGN E 2018-02-02 12:41:07 -08:00
punchcutter c6dbf6e77c Allow optional ZWJ in virama terminated cluster 2018-01-31 14:16:25 -08:00
Bruce Mitchener dae20fb5a7 Use nullptr instead of 0. 2018-01-31 08:18:48 -08:00
Bruce Mitchener 90218fa93c Fix typos. 2018-01-31 08:18:15 -08:00
Bruce Mitchener 148ca61075 [ot-layout] Fix nullptr dereference.
If the `calloc` for `gsub_accels` or `gpos_accels` fails, then the
unlikely branch afterwards can be taken, which frees up the
`hb_ot_layout_t`, but since those fields can now be `nullptr`, then
we don't want to dereference them.
2018-01-31 08:05:25 -08:00
Bruce Mitchener 0c66043a92 [coretext] Fix memory leaks.
In `reference_table`, if the data is empty and we return early,
we still need to release the data object.

In `hb_coretext_shape`, there two edge cases where an early
return should release the attributed string.
2018-01-31 08:04:15 -08:00
Behdad Esfahbod e89df6e1ae [aat] Limit number of DontAdvance transitions
Remove the faulty loop-detection logic. Use max-ops for breaking
out of infinite loops or heavy work.

https://twitter.com/behdadesfahbod/status/958065026262183936
2018-01-30 11:01:18 -08:00
Ebrahim Byagowi 55cae0d72e
[test] Use 'otool -L' where ldd doesn't exist (macOS) (#732) 2018-01-29 18:05:24 +03:30
David Corbett 2ec7dd1f6c Fix Travis build on macOS (#731) 2018-01-29 02:18:28 +03:30
Behdad Esfahbod 12757b6929 Misc warning fixes
Fixes https://github.com/harfbuzz/harfbuzz/issues/712
2018-01-26 18:14:05 -08:00
bungeman 85be365ed9 Use KernSubTableFormat2::rightClassTable
Issue originally reported at http://cppfiles.com/chromium.txt .

This fixes what appears to be a copy - paste issue which causes both
KernSubTableFormat2::rightClassTable and the 'right' argument to
KernSubTableFormat2::get_kerning to go unused.
2018-01-26 15:20:18 -08:00
Bruce Mitchener 19a93fcf19 Fix typos. 2018-01-21 10:33:54 -08: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 f07ce661a2 [aat] Embed a sanitizer context in hb_aat_apply_context_t
For run-time checking.
2018-01-19 16:52:01 -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 94b49beee9 Whitespace 2018-01-19 16:40:13 -08:00
Cosimo Lupo c8f2a4f5b9 hb-common.cc: Hatran script is right-to-left (#714)
"Hatran is written from right to left horizontally"

http://www.unicode.org/L2/L2012/12312-n4324-hatran.pdf

This ancient script was added with Unicode 8.0.

Also this spreadsheet (referenced in an inline comment in the
source code) has it as RTL: http://goo.gl/x9ilM
2018-01-19 01:19:40 +03:30
Ebrahim Byagowi 00806149b9
Improve avoiding C++ linkage, definition creation and cmake tests (#710) 2018-01-19 01:12:31 +03:30
Behdad Esfahbod 461a605fde [aat] Allocate set dynamically 2018-01-17 10:02:48 -08:00
Behdad Esfahbod 949f6af289 Disallow sanitize recursing into Extension subtables multiple times
Fixes https://oss-fuzz.com/v2/testcase-detail/5216838347653120
which is a stack overflow, not by way of infinite recursion, just
being deep.  That's disallowed anyway, so catch it as it happens,
not afterwards.
2018-01-15 20:44:10 -05:00
Behdad Esfahbod bcb6f1ae0a Whitespace 2018-01-15 20:34:05 -05:00
Behdad Esfahbod 12fffce10e [aat] Sanitize classTable in StateTable 2018-01-15 15:41:51 -05: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 c9e12a2b9b Fix set initializer 2018-01-13 17:05:12 +00: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 ee16b9d8d3 Revert accidental morx enablement 2018-01-12 11:28:09 +01:00
Behdad Esfahbod cdfa801ff4 [aat] Tweak previous commit 2018-01-12 11:12:20 +01:00
Behdad Esfahbod f7600228a4 [aat] Detect infinite-loops in state machine 2018-01-12 11:09:21 +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
Ting-Wei Lan e3a15d0c6d Update _POSIX_C_SOURCE to the latest version
Defining _POSIX_C_SOURCE to an old version on FreeBSD can cause C99 to
be disabled in libc.
2018-01-12 09:19:41 +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 9b82aa19d8 More warning fixes 2018-01-11 18:19:42 +01:00
Behdad Esfahbod 680cbc2eb3 [aat] Sanitize StateTable 2018-01-11 18:15:53 +01:00
Behdad Esfahbod 0e3b3379a0 [aat] Actually fix d887f93148 2018-01-11 18:01:10 +01:00
Behdad Esfahbod 3f291ffd5a [buffer] Fix compiler warnings
line 323: Warning: info hides hb_buffer_t::info
...
2018-01-11 17:57:46 +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