Commit Graph

5079 Commits

Author SHA1 Message Date
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
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 994eb7744c [buffer] Fix crash 2018-01-11 11:37:12 +01:00
Behdad Esfahbod 7c32e01d04 Minor 2018-01-11 10:47:31 +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
Ebrahim Byagowi 5dbbd0fdb9
Move the #define of _GNU_SOURCE to the top of hb-private.hh (#697)
This fixes the build on Cygwin.
2018-01-11 12:33:22 +03:30
Behdad Esfahbod 80fd574320 [aat] Add Class subtable thingy
From old 'mort' table.
2018-01-10 13:58:41 +01:00
Khaled Hosny 0b22da9541 Improve HB_BUFFER_SERIALIZE_FLAG_NO_ADVANCES docs
Add the note about absolute glyph positions from the commit message.
2018-01-10 07:12:07 +02:00
Behdad Esfahbod 188ee6e5ee Calculate anchor positions in float, then round
Hoping to reduce rounding error, to make tests happier...
No luck.
2018-01-10 05:13:47 +01:00
Behdad Esfahbod 7cdd6ab068 Round, instead of floor, when applying variations
Hoping this would fix remaining text-rendering-tests failures,
but so far no luck.
2018-01-10 04:44:33 +01:00
Behdad Esfahbod 3b1e97f364 Add HB_BUFFER_FLAG_REMOVE_DEFAULT_IGNORABLES
New API:
HB_BUFFER_FLAG_REMOVE_DEFAULT_IGNORABLES
hb-shape / hb-view --remove-default-ignorables

One more text-rendering-tests test passing.  Eleven failing.
2018-01-10 03:36:03 +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 0ed69c9462 Disable processing of morx table in ot shaper
So I can merge this to master...
2018-01-10 02:50:49 +01:00
Behdad Esfahbod 5f94b4cc39 [kern] Mark unsafe-to-break 2018-01-10 02:50:49 +01:00
Behdad Esfahbod 71fd6325b6 Add option to buffer serialization to not output glyph advances
When advances are not printed, glyph offsets reflect absolute glyph
positions.

New API:
HB_BUFFER_SERIALIZE_FLAG_NO_ADVANCES
hb-shape --no-advances
2018-01-10 02:50:49 +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 4cf3ab1d81 Minor 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 4646a80a87 Minor 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
Behdad Esfahbod 0473d95e27 [ft] Use FT_Done_MM_Var() if available 2018-01-08 10:07:46 +00:00
Behdad Esfahbod 66d7beff96 [khmer] Relax!
Apparently we don't use OT_A either.
2018-01-05 18:10:25 +00:00
Behdad Esfahbod db0207baff [khmer] Drop another joiner 2018-01-05 18:06:00 +00:00
Behdad Esfahbod 90affe831f [khmer] Shuffle 2018-01-05 18:04:56 +00:00
Behdad Esfahbod 65795e3ca2 [khmer] Simplify grammar some more
Numbers down (from 38):

KHMER: 299090 out of 299124 tests passed. 34 failed (0.0113665%)
2018-01-05 18:03:00 +00:00
Behdad Esfahbod e13ee93731 [khmer] Clean 2018-01-05 18:01:01 +00:00
Behdad Esfahbod a71c7eb2ca [khmer] Limit number of joiners 2018-01-05 17:59:43 +00:00
Behdad Esfahbod 574e42e1cf [khmer] Relax number of consonants / matras allowed
New numbers (down from 39):

KHMER: 299086 out of 299124 tests passed. 38 failed (0.0127038%)
2018-01-05 17:58:02 +00:00
Behdad Esfahbod 80c870bcda [khmer] Allow Independent Vowels where stacked consonants are allowed
New numbers (down from 44):

KHMER: 299085 out of 299124 tests passed. 39 failed (0.0130381%)
2018-01-05 17:54:52 +00:00
Behdad Esfahbod 9bd486c480 [khmer] Drop some more joiners 2018-01-05 17:47:35 +00:00
Behdad Esfahbod 5278265853 [khmer] Drop some more 2018-01-05 17:46:49 +00:00
Behdad Esfahbod efefd87f33 [khmer] Drop some more grammar 2018-01-05 17:45:48 +00:00
Behdad Esfahbod 82e6bf8e0c [khmer] Drop some more from grammar 2018-01-05 17:44:18 +00:00
Behdad Esfahbod 957e8ea8a9 [khmer] Drop final_halant_group 2018-01-05 17:43:31 +00:00
Behdad Esfahbod bbfdbbdc5e Minor 2018-01-05 17:34:26 +00:00
Behdad Esfahbod f6df251521 [indic] Remove unused OT_VD category 2018-01-05 17:27:48 +00:00
Behdad Esfahbod e6618f3bdf [khmer] Shave off some more from the grammar 2018-01-05 17:27:42 +00:00
Behdad Esfahbod 014494d5c0 [khmer] Remove unused symbol clusters 2018-01-05 17:18:12 +00:00
Behdad Esfahbod bbac984b93 Minor 2018-01-05 17:15:31 +00:00
Behdad Esfahbod 185b68946a [khmer] Remove medials from grammar 2018-01-05 17:14:27 +00:00
Behdad Esfahbod c265dffdf6 [khmer] Better fix for dangling final Coeng
This is how 1471cfee3b should have
been done.
2018-01-05 17:06:29 +00:00
Behdad Esfahbod e3fdf1fc2f [khmer] Remove reph/repha support from grammar 2018-01-05 17:05:53 +00:00
Behdad Esfahbod 0d3a274de1 [khmer] Remove forced_rakar from grammar
Used by Sinhala only.
2018-01-05 17:01:37 +00:00
Behdad Esfahbod 1471cfee3b [khmer] Allow a dangling final Coeng after matras
Uniscribe seems to allow that.  New numbers:

KHMER: 299080 out of 299124 tests passed. 44 failed (0.0147096%)
2018-01-05 16:34:20 +00:00
Behdad Esfahbod 9eaf077ded [khmer] Remove some more unused code 2018-01-05 16:28:00 +00:00
Behdad Esfahbod bfad6ab897 [khmer] Remove features not used by Khmer 2018-01-05 16:13:09 +00:00
Behdad Esfahbod 92a99ce084 [khmer] Remove rphf feature 2018-01-05 16:08:44 +00:00
Behdad Esfahbod 238b90e77c [khmer] Remove non-Khmer matra positioning code 2018-01-05 16:06:53 +00:00
Behdad Esfahbod f8553c898a [khmer] Remove indic_config_t 2018-01-05 16:04:02 +00:00
Behdad Esfahbod a119a8bce5 [khmer] Remove indic_config->reph_mode 2018-01-05 16:02:55 +00:00
Behdad Esfahbod c135324af1 [khmer] Remove indic_config->reph_pos 2018-01-05 16:02:55 +00:00
Behdad Esfahbod ffcd6c7efd [khmer] Remove indic_config->base_pos 2018-01-05 15:50:05 +00:00
Behdad Esfahbod 0c91638d48 [khmer] Remove other scripts 2018-01-05 15:45:30 +00:00
Behdad Esfahbod 4c0199c573 [khmer] Remove indic_config->script 2018-01-05 15:43:48 +00:00
Behdad Esfahbod 9b135d9524 [khmer] Remove indic_config->virama 2018-01-05 15:43:11 +00:00
Behdad Esfahbod 7eb3ac29d3 [khmer] Remove indic_config->has_old_spec 2018-01-05 15:41:31 +00:00
Behdad Esfahbod 961ebf85f1 [khmer] Remove Halant from Khmer shaper 2018-01-05 15:36:53 +00:00
Behdad Esfahbod 9761f9d782 [indic] Remove more Khmer-specific stuff from Indic shaper
No numbers changed.
2018-01-05 15:33:11 +00:00
Behdad Esfahbod 0758953644 [indic] Remove main Khmer stuff 2018-01-05 15:08:28 +00:00
Behdad Esfahbod dcf4d95fea [khmer] Split off Khmer shaper from Indic
Towards fixing https://github.com/harfbuzz/harfbuzz/issues/667
The Khmer spec is different enough from other Indic ones to require
its own grammar.

No change in functionality.  Test numbers are:

BENGALI: 353725 out of 354188 tests passed. 463 failed (0.130722%)
DEVANAGARI: 707307 out of 707394 tests passed. 87 failed (0.0122987%)
GUJARATI: 366355 out of 366457 tests passed. 102 failed (0.0278341%)
GURMUKHI: 60729 out of 60747 tests passed. 18 failed (0.0296311%)
KANNADA: 951300 out of 951913 tests passed. 613 failed (0.0643966%)
KHMER: 299071 out of 299124 tests passed. 53 failed (0.0177184%)
MALAYALAM: 1048136 out of 1048334 tests passed. 198 failed (0.0188871%)
ORIYA: 42320 out of 42329 tests passed. 9 failed (0.021262%)
SINHALA: 271662 out of 271847 tests passed. 185 failed (0.068053%)
TAMIL: 1091754 out of 1091754 tests passed. 0 failed (0%)
TELUGU: 970555 out of 970573 tests passed. 18 failed (0.00185457%)
2018-01-05 14:54:31 +00:00
Behdad Esfahbod 1e05ea79d0 [ot] Short-circuit base instance advance variation 2018-01-05 14:01:37 +00:00
Behdad Esfahbod 54b2b93722 [ot] Fix VariationStore evaluation algorithm
Ouch!  Missing coords should still be evaluated as coord=0, which
most of the time results in a factor of 0.  We were skipping these,
which was equivalent to a factor of 1.

Fixes https://github.com/harfbuzz/harfbuzz/issues/652
2018-01-05 13:20:21 +00:00
Behdad Esfahbod a3afdd1e08 Minor 2018-01-05 13:17:02 +00:00
Behdad Esfahbod cb43bdbc2f [ft] If there's no variations set, don't set them on hb-font 2018-01-05 13:06:25 +00:00
Behdad Esfahbod 127bcc6ece Merge remote-tracking branch 'fdo/master' 2018-01-05 12:50:22 +00:00
Behdad Esfahbod 8c0d1916a4 Improve CGJ skipping logic
Previously we made CGJ unskippable.  Now, if CGJ did NOT prevent
any reordering, allow skipping over it.  To make this work we
had to make changes to the Arabic mark reordering algorithm
implementation to renumber moved MCM marks.  See comments.

Fixes https://github.com/harfbuzz/harfbuzz/issues/554
2018-01-05 12:48:19 +00:00
Ebrahim Byagowi 72bec1cd09
Improve tests (#679) 2018-01-05 12:42:20 +03:30
Behdad Esfahbod 293e443529 Minor 2018-01-04 16:06:25 +00:00
Bruce Mitchener 8a0952db7e atomics: Favor compiler primitives over macOS APIs. (#676)
In macOS 10.12, the `OSMemoryBarrier` and related APIs were deprecated
in favor of using `std::atomic`. On the way to supporting `std::atomic`,
we can favor using the "Intel primitives" which are also available on
macOS.
2018-01-04 15:10:10 +03:30
Ebrahim Byagowi 5ed26fc5bd
[cmake] Run src/ tests (#675) 2018-01-04 10:11:34 +03:30
Behdad Esfahbod f8daeef4c4 [use] Simplify more 2018-01-03 14:27:34 +00:00
Behdad Esfahbod 877d15e73c [use] Simplify
Fixes https://github.com/harfbuzz/harfbuzz/pull/661
2018-01-03 14:24:44 +00:00
Behdad Esfahbod 308f419215 [use] Fix Brahmi Number Joiner 1107F
Fixes https://github.com/harfbuzz/harfbuzz/pull/660
2018-01-03 14:22:07 +00:00
Bruce Mitchener 85ec6d3443 Fix typos. 2018-01-02 13:26:44 -05:00
David Corbett 7bfdf1a941 Forbid Batak killers after vowel signs 2017-12-24 14:21:22 -08:00
Behdad Esfahbod 72ecaae0ad [use] Allow ZWJ before/after Halant
https://github.com/harfbuzz/harfbuzz/issues/542#issuecomment-353169729
2017-12-24 16:05:07 -05:00
Behdad Esfahbod bc92245b68 Minor 2017-12-24 15:54:58 -05:00
Volker H. Simonis a9432bde7e HarfBuzz 1.7.1 and later don't compile on AIX with xlC (#655) 2017-12-19 20:22:24 -05:00
Behdad Esfahbod 2fe5f885b6 [set] Handle nil set in add_range() / add_sorted_array()
Fixes https://github.com/harfbuzz/harfbuzz/issues/657
2017-12-19 14:48:26 -05:00
Behdad Esfahbod 1245395a60 [coretext] In hb_coretext_font_create() set ptem
Otherwise setting the CTFont was ineffective as it would have been
recreated anyway unless font size was set to 18 CSS points.
2017-12-17 12:33:08 -05:00
Behdad Esfahbod 493a005d95 [set] In add_sorted_array(), bail if data is not sorted 2017-12-16 11:49:39 -05:00
Behdad Esfahbod a7bd6d7a4c [collect_glyphs] Bail if input data looks like garbage
Specificaly, when a range or sorted array has unexpected order, we take that as
font data being garbage and bail out.  This fixes significant slowdown on a bad
version of Chandas font which has a 600KB GPOS with garbage inside.

Later on, I like to add a maximum-work counter for collect_glyphs to protect
against malicious fonts as well.

Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=794896
2017-12-16 11:39:32 -05:00
Behdad Esfahbod 1ce7d6e215 [set] Optimize add_array() / add_sorted_array()
Does page lookup as needed.
2017-12-16 11:39:11 -05:00
Behdad Esfahbod 71e6adf1e2 [collect_glyphs] handle ClassDef better 2017-12-16 11:07:37 -05:00
Behdad Esfahbod 87cc5a65cb [collect_glyphs] In PairPosFornat2 do not collect classDef1
The coverage already covered that.
2017-12-16 06:18:07 -08:00
Behdad Esfahbod 81f27df4d9 More work towards improving collect_glyphs() against bad input
The three "XXXXX"'s should be switched to false.  Doing that separately for ease
of bisecting...
2017-12-16 06:12:06 -08:00
Behdad Esfahbod 5d02572034 [set] Add add_sorted_array()
Not optimized to use sortedness yet.  Also start putting in place infra
to faster reject bad data.

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

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

Part of https://bugs.chromium.org/p/chromium/issues/detail?id=794896
2017-12-14 19:35:47 -08:00
Behdad Esfahbod 9d6511a734 [set] Reduce number of preallocated pages from 8 to 1
Now that pagesize is 8192, this feels better.
2017-12-14 19:07:17 -08:00
Behdad Esfahbod ae2e2b068e Fix partial tracing debug builds 2017-12-14 19:07:17 -08:00
Behdad Esfahbod 9daa88cd79 Minor 2017-12-14 19:07:17 -08:00
Behdad Esfahbod f424a34223 [set] Change pagesize from 512 bits to 8192 bits
Fixes perf regression on some heavy fonts in Chrome's FT+HB
interaction.

See:
https://bugs.chromium.org/p/chromium/issues/detail?id=782220

More work to be done:
https://bugs.chromium.org/p/chromium/issues/detail?id=794896
2017-12-14 13:30:38 -08:00
Behdad Esfahbod 0fe62c1f33 [set] Add add_array()
To be used to optimize adding a whole bunch of (sorted) items at the same time,
as in CoverageFormat1.
2017-12-14 10:39:00 -08:00
Behdad Esfahbod 03b7a221f7 [debug] Use %p to print pointers
Fixes https://github.com/harfbuzz/harfbuzz/issues/640
2017-12-05 13:13:58 -08:00
Nathan Willis 0dc03ef757 Indic: always hyphenate pre-base-reordering, for clarity. 2017-12-05 11:29:43 -08:00
Behdad Esfahbod be59f3cbf4 Silence unused-variables warning on MSVC
Fixes https://github.com/harfbuzz/harfbuzz/issues/635
2017-12-05 09:01:28 -08:00
David Corbett 80c1b01f05 Allow digits in language system tags 2017-12-05 08:56:41 -08:00
David Corbett 85bb89a88b Fix string matching in parse_bool 2017-12-04 13:10:16 -08:00
Olivier Blin 0fd89dc61c [hb-ft] Fix build when Multiple Master font support is disabled in freetype
FT_Set_Var_Blend_Coordinates() is not available when "Multiple Master
font interface" is disabled in freetype's modules.cfg
2017-12-04 10:52:06 -08:00
Behdad Esfahbod eeb26d21d4 [set] Actually commit fixes mentioned in previous commit! 2017-12-02 15:22:04 -08:00
Behdad Esfahbod 0744149cda [set] Protect against bad input in hb_set_add_range() 2017-12-02 15:06:15 -08:00
Behdad Esfahbod d5e29303db [coretext] Add hb_coretext_font_create()
Fixes https://github.com/harfbuzz/harfbuzz/issues/628

New API:
hb_coretext_font_create()
2017-12-02 14:52:57 -08:00
Behdad Esfahbod 9d0194b3a8 [set] Optimize add_range() some more
It's as good as it gets, and seems to be on par with previous set implementation
in my benchmark.

Would be great if someone can double-check my bitops.
2017-12-01 13:56:06 -08:00
Behdad Esfahbod 438c325a25 [set] Optimize add_range()
With new set implementation, this became really costy.  Optimize it.
There's more to be done, but this shaves off most of the fat.

Part of fixing https://bugs.chromium.org/p/chromium/issues/detail?id=782220
2017-12-01 13:34:14 -08:00
Behdad Esfahbod be9e307a88 [ot] Ensure layout in hb_ot_layout_table_get_lookup_count() 2017-12-01 12:37:05 -08:00
Behdad Esfahbod 16fba5b215 [ot] Fix Extension type recurse to disallow recursing to another Extension
Particularly hazardous if the second layer mixes forward and backward lookups.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4336
2017-11-29 16:08:11 -08:00
David Corbett 9f259769a6 Categorize U+A8B4 as Consonant_Medial 2017-11-21 13:48:32 -08:00
Behdad Esfahbod 8d55340593 Fix fallback positioning of double diacritic marks
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=787284
2017-11-20 19:43:22 -08:00
David Corbett 87d74605f5 Categorize U+0C80 as Consonant_Placeholder 2017-11-20 13:10:28 -08:00
ebraminio 7c6937e7c7
Move all references of old url to the new address (#622) 2017-11-20 14:49:22 -05:00
Behdad Esfahbod baf7779d2d Limit how much recursion GSUB/GPOS does
This only counts recursions right now.  Good start.

Hopefully...
Fixes https://github.com/behdad/harfbuzz/issues/429
2017-11-14 21:55:37 -08:00
Behdad Esfahbod 173dab6300 Minor move 2017-11-14 21:27:24 -08:00
Behdad Esfahbod c6173a392c Add Offset16 and Offset32 2017-11-14 21:09:03 -08:00
Behdad Esfahbod 6f335ed1e5 Replace USHORT/SHORT/ULONG/etc with UINT16/INT16/UINT32/etc 2017-11-14 21:06:07 -08:00
Behdad Esfahbod a130ee6df5 Remove a couple of unused consts 2017-11-14 20:30:03 -08:00
Behdad Esfahbod e20e47eaa1 [glyf] Try fixing undefined-behavior
Might fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1463
2017-11-14 20:25:29 -08:00
Behdad Esfahbod 7b40876a58 [ot] Remove unneeded TODO item
Looks like hb-ot-font is complete after all!

CFF font names and CFF glyph metrics don't work though...
2017-11-14 20:22:05 -08:00
Behdad Esfahbod eab4feb5e2 [hmtx] Use curiously recurring template pattern
https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern
2017-11-14 20:17:15 -08:00
Behdad Esfahbod 977ddff1f1 [ot] Move hb_ot_face_cmap_accelerator_t 2017-11-14 20:06:19 -08:00
Behdad Esfahbod a7f15959b5 Shuffle 2017-11-14 20:02:24 -08:00
Behdad Esfahbod a85d7ead04 [ot] Move hb_ot_face_metrics_accelerator_t 2017-11-14 20:00:34 -08:00
Behdad Esfahbod f00a94e1ec Adjust privacy for recent changes 2017-11-14 19:54:48 -08:00
Behdad Esfahbod 7e2839c438 [ot] Move hb_ot_face_glyf_accelerator_t 2017-11-14 19:52:29 -08:00
Behdad Esfahbod c4e18e54dc [ot] Move hb_ot_face_cbdt_accelerator_t 2017-11-14 19:52:26 -08:00
Behdad Esfahbod 9b04b0384f [ot] Fold hb_ot_face_post_accelerator_t 2017-11-14 19:31:50 -08:00
Behdad Esfahbod 702d86ba6b [ot] Fold hb_ot_face_kern_accelerator_t 2017-11-14 19:25:51 -08:00
Behdad Esfahbod 909de95a11 Minor build fix 2017-11-14 16:22:52 -08:00
Behdad Esfahbod e5930722d4 Fix invalid buffer access in OOM times
Hopefully fully fixes
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1856
2017-11-14 15:47:55 -08:00
Behdad Esfahbod fcd6c338ff Fix more compiler warnings 2017-11-14 15:04:19 -08:00
Behdad Esfahbod 7fdf16b2ce Fix compiler warning 2017-11-14 15:04:19 -08:00
David Corbett 87f0ad183c Allow U+20F0 in USE clusters 2017-11-14 15:04:10 -08:00
Behdad Esfahbod 93f7c1652a Revert "[glib/ucdn/icu/ft/ot] Make returned funcs inert"
This reverts commit 5daf3bd449.

If other atexit callbacks try to destruct the objects we destruct
in atexit callbacks, bad things will happen.

I'll come up with some other way to catch premature destruction
of HB-owned objects.

Fixes https://github.com/behdad/harfbuzz/issues/618
2017-11-14 10:59:54 -08:00
Behdad Esfahbod c48475f33a Whitespace 2017-11-13 20:26:29 -08:00
Behdad Esfahbod 83d6802736 Clean up GlyphID
After 4a27c17ea0 we do not need
the special GlyphID.cmp(hb_codepoint_t), so just make GlyphID
a typedef.

Fixes https://github.com/behdad/harfbuzz/issues/612
2017-11-13 20:25:02 -08:00
Behdad Esfahbod 7f39f57614 Implement strtod_l() on MSVC
Patch from Jean Ghali on mailing list.
2017-11-13 15:04:13 -08:00
Behdad Esfahbod e4da380200 [coretext/uniscribe/directwrite/graphite/fallback] Update for unsafe-to-break
Fixes https://github.com/behdad/harfbuzz/issues/615

We'll see which bots I broke.
2017-11-10 17:14:27 -08:00
Martin Hosken 4de03a1585 Fix graphite intergration reordered clusters problem 2017-11-10 16:24:06 -08:00
Behdad Esfahbod 8eed9cb11e [kern] Fix invalid memory access if offset is zero
If offset is zero, we return Null() object.  Wasn't prepared for that.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4088
2017-11-09 18:09:40 -08:00
Behdad Esfahbod c4f4c0a2fa Fix indexing in unsafe-to-break marking for 'stch' feature
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4099
2017-11-08 17:04:31 -08:00
David Corbett 5a9cba9744 Mark non-initial left matras as unsafe to break 2017-11-08 19:12:10 -05:00
Behdad Esfahbod a615030683 [kern] Implement format-2 kern subtable 2017-11-06 15:40:07 -05:00
Behdad Esfahbod 82a38d1f7a [kern] Allow subtables longer than 64kb
Apparently calibri.ttf does this:
https://github.com/fonttools/fonttools/pull/1094#discussion_r148933791
2017-11-06 15:28:24 -05:00
Behdad Esfahbod 625ae08fce [kern] Towards implementing format-2 2017-11-06 15:06:30 -05:00
David Corbett 74e82adaea Mark glyphs involved in 'stch' as unsafe to break 2017-11-06 15:06:23 -05:00
Behdad Esfahbod 5aad819433 Simplify tracing code when tracing is disabled
Fixes https://github.com/behdad/harfbuzz/pull/605
2017-11-03 17:18:17 -04:00
Behdad Esfahbod 40ec3bbb55 Consolidate debug stuff into hb-debug.hh
Part of fixing https://github.com/behdad/harfbuzz/pull/605
2017-11-03 17:18:17 -04:00
Behdad Esfahbod 384862d7ee Remove NO_COPY() 2017-11-03 17:18:17 -04:00
Unknown 97145df249 Trivial typos
Found using `codespell -i 3 -w -I '../harf-whitelist.txt'`
whereas the whitelist contents were:
```
beng
iff
pres
ot
te
teh
```
2017-11-03 15:31:21 +02:00
Behdad Esfahbod 4b3278ef8d [ot] Hook up horizontal kerning to kern table
Seems to work.  Yay!

Still to do: run kerning if GPOS doesn't have 'kern' feature.
2017-11-01 19:41:29 -06:00
Behdad Esfahbod 77acc1106e [kern] More...
Almost there.
2017-11-01 19:40:51 -06:00
Behdad Esfahbod 49c0f35580 [kern] See if this helps with making VS bot happy 2017-11-01 18:16:07 -06:00
Behdad Esfahbod 2c439210c9 [uniscribe] Fix a couple of VS warnings 2017-11-01 18:13:35 -06:00
Behdad Esfahbod 4c43a23bf4 [kern] Implement Format0 2017-11-01 18:12:26 -06:00
Behdad Esfahbod ac3d937c6c [kern] Implement some more 2017-11-01 17:54:56 -06:00
Behdad Esfahbod 2a16f647ae [kern] Start implementing kern table
Pushing this out early to catch bot errors since I'm using template tricks
we were not using in HarfBuzz before.
2017-11-01 17:32:34 -06:00
ebraminio 102f5ead49
Enable PSVita (arm-none-eabi) compile again and add it to CI (#594) 2017-11-01 02:10:18 -07:00
Behdad Esfahbod 92bb508642 [indic] Use mutable for virama_glyph 2017-10-31 22:58:03 -06:00
Behdad Esfahbod 6c04dcb28d Use bsearch() for large SFNT table directories 2017-10-31 20:11:00 -06:00
Behdad Esfahbod b0e33da02d Add BinSearchArrayOf<> 2017-10-31 20:05:37 -06:00
Behdad Esfahbod aca378f51e Sanitize (Headless)ArrayOf()::len to ensure it doesn't use offsets 2017-10-31 18:11:10 -06:00
Behdad Esfahbod 5f04711314 Fix HeadlessArrayOf::sanitize_shallow() 2017-10-31 18:10:40 -06:00
Behdad Esfahbod 7ce9f397d1 Rename hb-sort-r.hh -> hb-dsalgs.hh 2017-10-31 16:54:31 -06:00
Behdad Esfahbod 8eaff980fc Remove HB_TAG_CHAR4 2017-10-31 16:54:31 -06:00
David Corbett d016c5bdb9 Categorize Grantha candrabindu for use in Tamil 2017-10-31 16:54:23 -06:00
Behdad Esfahbod 0feff4ba7b Simplify hb-sort-r.hh
See https://github.com/behdad/harfbuzz/pull/592
2017-10-31 14:02:54 -06:00
Behdad Esfahbod c290ba5b7d Define _GNU_SOURCE
Might help with https://github.com/behdad/harfbuzz/pull/592
Ie. bringing in qsort_r() prototype always.
2017-10-31 13:18:21 -06:00
Behdad Esfahbod 98acdde3c6 [coretext/uniscribe] Fix build
https://travis-ci.org/behdad/harfbuzz/jobs/295039536#L3468
https://ci.appveyor.com/project/behdad/harfbuzz/build/1.0.697/job/dr1ujlntxafeqbej#L142
2017-10-31 11:17:43 -06:00
Behdad Esfahbod ec86cc5e55 Fix Windows build
(And prevent it from happening in the future.)
2017-10-30 14:11:59 -06:00
Behdad Esfahbod e35a763c07 [post] Implement glyph_from_name()
This concludes https://github.com/behdad/harfbuzz/pull/568
2017-10-30 13:15:05 -06:00
Behdad Esfahbod 6c738f353e Make string-array return hb_string_t 2017-10-30 12:21:44 -06:00
Behdad Esfahbod e1a37f3db4 Add hb_string_t 2017-10-30 11:42:28 -06:00
Behdad Esfahbod 21ac567858 Fix tests 2017-10-30 09:48:09 -06:00
Behdad Esfahbod 0f8b5aa1bc [post] Minor; towards implementing get_glyph_from_name() 2017-10-30 09:46:36 -06:00
Behdad Esfahbod 977679f229 Add hb_bsearch_r() 2017-10-29 17:33:32 -06:00
Behdad Esfahbod 0712e915b4 Remove hb_compare_func_t 2017-10-29 17:01:47 -06:00
Behdad Esfahbod 538da7496d Add hb-sort-r, a portable qsort_r() replacement 2017-10-29 16:38:58 -06:00
Behdad Esfahbod 923a8f520a Fix up 5de83fab94 2017-10-29 15:00:54 -06:00
Behdad Esfahbod b98c7c3f1f [post] Minor 2017-10-29 14:52:52 -06:00
Behdad Esfahbod 5de83fab94 [ot] Speed up get_glyph_name()
get_glyph_from_name() coming soon.
2017-10-28 19:54:04 -06:00
Behdad Esfahbod feadee079e [post] Refactor a bit, use our data types 2017-10-28 16:58:56 -06:00
Behdad Esfahbod 5014c60afa More nullptr fix
Fixes https://github.com/behdad/harfbuzz/issues/585
2017-10-28 12:00:49 -06:00
Behdad Esfahbod 5daf3bd449 [glib/ucdn/icu/ft/ot] Make returned funcs inert
Such that client cannot accidentally destroy them, even though that
will be a bug in their code...
2017-10-27 16:37:11 -06:00
Behdad Esfahbod bfa7f37a73 Fix previous commit
Oops.
2017-10-27 16:03:51 -06:00
Behdad Esfahbod 8864864b62 [glib/icu/ucdn] Make the funcs object allocated on demand 2017-10-27 15:26:45 -06:00
Behdad Esfahbod af3f72f9eb Correctly mark NullPool const
Saves some more code size as well!
2017-10-27 15:14:44 -06:00
Behdad Esfahbod 51f4d4d5cd Reduce prealloced number of user-data items from 2 to 1
Even 1 is too many but putting 0 breaks compile.  Saves 3k in .so
2017-10-27 15:09:22 -06:00
Behdad Esfahbod 3205de7906 Make the NullPool HB_INTERNAL shared
Saves 2k of .bss section.
2017-10-27 15:01:40 -06:00
Behdad Esfahbod 7036f1d22c [ot] Remove shaper name
In ten years we never used them...
2017-10-27 14:42:59 -06:00
Behdad Esfahbod 4a27c17ea0 Fix IntType.cmp() to avoid narrowing down integer types
Fixes https://github.com/behdad/harfbuzz/issues/571
2017-10-27 14:29:12 -06:00
Behdad Esfahbod 62e312ead8 Use NULL instead of polyfill, if nullptr is not available
Part of fixing https://github.com/behdad/harfbuzz/issues/585
2017-10-27 09:29:20 -06:00
Behdad Esfahbod 17f40b7cad Include hb-private.hh more consistently
Part of fixing https://github.com/behdad/harfbuzz/issues/585
2017-10-27 09:22:42 -06:00
Behdad Esfahbod 42d518513c Towards compiling with pre-C++11 compilers and nullptr fallback
https://github.com/behdad/harfbuzz/issues/585
2017-10-27 00:25:11 -06:00
Behdad Esfahbod 0e9256984e [post] Make format1 names array avoid relocations 2017-10-26 20:34:04 -06:00
Behdad Esfahbod 2a74968044 Add hb-string-array.hh
Used to build static string arrays that use no relocation.
2017-10-26 20:32:16 -06:00
Behdad Esfahbod 6f08b12bc3 Minor 2017-10-26 18:23:03 -06:00
Jonathan Kew dfd234a97d [set] Fix page_map[] indexing in backward loop.
Fixes https://github.com/behdad/harfbuzz/issues/579.
2017-10-26 12:33:05 -05:00
Jonathan Kew d511cfb557 [set] Bugfix for hb_set_next 2017-10-26 12:30:52 -05:00
Behdad Esfahbod 92bac64bd2 [post] Oops!
https://ci.appveyor.com/project/behdad/harfbuzz/build/1.0.668/job/ikfj8peowgrp059t
2017-10-25 18:22:47 -06:00
Behdad Esfahbod 543bd58d7a [post] Touch up and fixes
The get_glyph_from_name() is incorrect; needs fixing.
2017-10-25 18:01:03 -06:00
Khaled Hosny d9e166f74c [ot-font] Implement hb_ot_get_glyph_from_name 2017-10-25 19:29:51 -04:00
Khaled Hosny 9d4d2fb9af [ot-font] Implement hb_ot_get_glyph_name
Turns out we already have support for “post” table, it just needed to be
activated and put in use.
2017-10-25 19:29:51 -04:00
Behdad Esfahbod 33ca3b67bf Check for headers in builddir first, in check-*.sh
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=103346
2017-10-25 12:09:11 -04:00
Behdad Esfahbod 9ac2e5c6c0 check-externs.sh: Make output more verbose
Trying to figure out why this is failing on some Debian bots:
https://bugs.freedesktop.org/show_bug.cgi?id=103346

Maybe I should check for GNU grep specifically now that I'm using -n as well.
2017-10-24 10:06:25 -04:00
Behdad Esfahbod 30a591e3ce [set] Rewrite another way :P 2017-10-23 14:29:20 -04:00
Behdad Esfahbod 8170801d78 [set] Fix crash
Ouch!  That's what happens when one plays with increment/decrement operators!

Fixes https://github.com/behdad/harfbuzz/issues/578
2017-10-23 14:29:14 -04:00
Behdad Esfahbod 2ee710e02f Minor 2017-10-23 08:37:48 -04:00
Behdad Esfahbod dd33e4e96b [set] Don't use major()
Fixes https://github.com/behdad/harfbuzz/issues/577
2017-10-23 08:36:40 -04:00
Behdad Esfahbod d0f0ff85b9 [set] Don't use PAGE_SIZE
Fixes https://github.com/behdad/harfbuzz/issues/576
2017-10-23 08:34:30 -04:00
Behdad Esfahbod ce97945440 [icu] Fix error check 2017-10-22 18:23:38 -04:00
Behdad Esfahbod 8b9d9b71b0 Fix set initialization issues 2017-10-22 17:48:06 -04:00
Behdad Esfahbod ced86da7dd Another try at fixing mingw32 build bot fail 2017-10-22 17:06:10 -04:00
ebraminio d45a2138d9 Merge pull request #572 from fanc999/master.msvc
builds: Support HarfBuzz-GObject and introspection in CMake builds
2017-10-21 10:19:55 +03:30
Behdad Esfahbod d8adaa97fb Another try at fixing build bots
hb-ot-shape.cc:287:18: error: comparison of constant 32 with expression of type 'hb_unicode_general_category_t' is always true [-Werror,-Wtautological-constant-out-of-range-compare]
2017-10-20 13:57:43 -04:00
Behdad Esfahbod 6058f98825 Remove FLAG_SAFE()
No flag is safe, over time... See previous commit.
2017-10-19 11:39:52 -07:00
Behdad Esfahbod 7c561dacc3 [myanmar] Fix unsafe usage of FLAG_SAFE()
The commit f559c63307 caused
"undefined-shift" errors in Myanmar shaper as we changed the
numeric value of type D from 19 to 32 there, making the
"FLAG_SAFE (info.myanmar_category())" wrong.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3546
2017-10-19 11:35:51 -07:00
Chun-wei Fan 162575f2c6 CMake builds: Fix builds
Include the fallback sources in the build, and update
src/Makefile.sources so that it can be read by the CMake build files.

Fix a typo in the DirectWrite configure option so that we can properly
enable DirectWrite builds.

Also, when building the utility program, install them as well.
2017-10-18 22:48:18 +08:00
Behdad Esfahbod d6f612fac8 [bsearch] Micro-optimization 2017-10-17 16:32:12 -07:00
Fredrik Roubert 41b1984be9 Switch from ICU deprecated unorm_normalize to unorm2_normalize. (#569)
The new unorm2_normalize has been public API since ICU 4.4, while
the old unorm_normalize has been deprecated since ICU 56.

Now, beginning with ICU 60, unorm_normalize will also be annotated
U_DEPRECATED and trigger the compiler -Wdeprecated-declarations warning.
2017-10-17 15:06:31 -07:00
Behdad Esfahbod ba8b569607 Try fixing build on VC
c:\projects\harfbuzz\src\hb-set-private.hh(151): error C2327: 'hb_set_t::page_t::v': is not a type name, static, or enumerator [C:\projects\harfbuzz\build\harfbuzz.vcxproj]
2017-10-17 11:16:36 -07:00
Behdad Esfahbod 80cc0a7e3e [coretext] Fix build
error: static_assert expression is not an integral constant expression
2017-10-17 11:14:48 -07:00
Behdad Esfahbod a11249ee93 [set] Fix merge logic 2017-10-16 01:33:32 -04:00
Behdad Esfahbod ab8f327eb4 Ouch. 2017-10-15 18:21:35 -04:00
Behdad Esfahbod bb9917913f [set] Disable vectorization
Fixes clang "non-const reference cannot bind to vector element" error.
2017-10-15 18:20:25 -04:00
Behdad Esfahbod 221ce6c18f Fix bots 2017-10-15 17:58:58 -04:00
Behdad Esfahbod 0cf7d957b7 [set] Remove TODO items not worth pursuing 2017-10-15 17:01:31 -04:00
Behdad Esfahbod 10d43658e7 [set] Speed up intersects() 2017-10-15 16:56:05 -04:00
Behdad Esfahbod 56ef4e0c52 Simplify hb_prealloced_array_t initialization 2017-10-15 16:38:29 -04:00
Behdad Esfahbod 7737e87ac4 Properly detect vector_size attribute and use fallback otherwise 2017-10-15 16:21:03 -04:00
Behdad Esfahbod f8a0ec50e2 [set] Add fallback implementation of int-vector type 2017-10-15 16:10:35 -04:00
Behdad Esfahbod deed4a48d1 Faster hb_set_t
Fixes https://github.com/behdad/harfbuzz/pull/23
2017-10-15 16:45:33 -03:00
Behdad Esfahbod 1d3971200b Deprecate hb_set_invert() 2017-10-15 16:28:34 -03:00
Behdad Esfahbod 5e74044b6b Add bfind() to prealloaced_array_t 2017-10-15 16:28:34 -03:00
Behdad Esfahbod db5f7ef189 Inline another bsearch() 2017-10-15 16:28:34 -03:00
Behdad Esfahbod 6fb4ac73f9 Add popcount for 64bit ints 2017-10-15 16:00:09 +02:00
Behdad Esfahbod 473b17af4d Remove unused hb_cache_t 2017-10-15 14:11:09 +02:00
Behdad Esfahbod a433e60a43 Remove unused hb_frozen_set_t 2017-10-15 14:09:46 +02:00
Behdad Esfahbod 826a1daf2f Move set-digests into their own header file 2017-10-15 14:09:05 +02:00
Behdad Esfahbod 3c13e153fe Try fixing AppVeyor bots 2017-10-15 14:02:58 +02:00
Behdad Esfahbod 7e3015a315 Fix warnings 2017-10-15 12:13:19 +02:00
Behdad Esfahbod dbdbfe3d7b Use nullptr instead of NULL 2017-10-15 12:11:08 +02:00
Behdad Esfahbod fbb937b680 Don't use NULL in public headers 2017-10-15 12:04:16 +02:00
Behdad Esfahbod c3448e8d21 Use static_assert instead of custom ASSERT_STATIC 2017-10-15 12:02:00 +02:00
Behdad Esfahbod 76dcbf8b23 Add polyfill for static_assert and nullptr
Also fix hb_assert_constant_t.
2017-10-15 11:24:35 +02:00
Behdad Esfahbod 81e2b9b8a9 Never skip over CGJ
We might want to tweak this some more.  For now, never skipping over
it is better behavior than always skipping.

Part of https://github.com/behdad/harfbuzz/issues/554
2017-10-15 10:49:06 +02:00
Behdad Esfahbod 74f1b88e37 [ucdn] Fix compiler warnings 2017-10-13 11:01:55 +02:00
Behdad Esfahbod c2cf68dbdf [coretext] Fix build 2017-10-13 10:30:19 +02:00
Behdad Esfahbod 95883fc5d4 [coretext] Pass correct font size to CoreText
CoreText "point"s are not typographic points, but CSS pixels.  Ie.
they are 96 per inch, not 72 per inch.
2017-10-13 10:22:20 +02:00
Behdad Esfahbod 4f9a83ec21 Merge remote-tracking branch 'origin/master' 2017-10-12 14:08:58 +02:00
Behdad Esfahbod fa48ccbe12 [indic] Special-case Kannada Ra,H,ZWJ sequence
Fixes https://github.com/behdad/harfbuzz/issues/435
2017-10-12 14:07:37 +02:00
n8willis 40b05d7b77 Replacing 'cluster' with 'syllable' when comments describe certain Indic shaping behavior (#563)
* Clarified wording of syllable/cluster behavior in Uniscribe in final_reordering; changed one other probable typo.

* Additional syllable/cluster swap in comments for final reordering and for initial-reordering matra decomposition.
2017-10-12 13:48:48 +02:00
Behdad Esfahbod 8923033eb2 [coretext] Use fabs() to silence compiler warning 2017-10-12 12:02:04 +02:00
Dominik Röttsches dd4b321b4a [coretext] Activate tracking for system fonts
Another attempt at fully fixing
https://github.com/behdad/harfbuzz/issues/360
2017-10-12 11:54:17 +02:00
Behdad Esfahbod 6a2cbc6ef5 [coretext] Use fabsf() instead of abs()
Fixes bots.

Link libharfbuzz.so with -lm.  Surprising that we survived without
it so far!
2017-10-12 10:46:09 +02:00
Behdad Esfahbod 4e4781319b [ft] Add hb_ft_font_changed()
When the font size or variations settings on underlying FT_Face change,
one can call hb_ft_font_changed() and continue using hb_font created using
hb_ft_font_create().

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

New API:
hb_ft_font_changed()
2017-10-12 10:33:16 +02:00
Behdad Esfahbod 94b3cafc3a Add hb_face_get_table_tags()
New API:
hb_face_get_table_tags()

Fixes https://github.com/behdad/harfbuzz/issues/560
2017-10-11 17:22:44 +02:00
Behdad Esfahbod e1b6d92302 Remove cast of functions to (hb_destroy_func_t)
Fixes https://github.com/behdad/harfbuzz/issues/474
2017-10-11 15:51:31 +02:00
Behdad Esfahbod 717fcb51dd [coretext] Minor 2017-10-11 15:38:21 +02:00
Behdad Esfahbod 374bb48d90 Change ptem API to make 0 mean unset 2017-10-11 15:37:50 +02:00
Behdad Esfahbod 06c14225b2 [coretext] Minor 2017-10-11 15:29:53 +02:00
Behdad Esfahbod a4b46212c5 [coretext] Adjust font size check for 0 2017-10-11 15:29:22 +02:00
Behdad Esfahbod 269cf1ca82 Correctly initialize ptem 2017-10-11 15:24:22 +02:00
Behdad Esfahbod 84686bf4c7 [coretext-aat] Also pass through CoreText if font has kerx table
SFNSText has kerx table which apparently is applied.
2017-10-11 15:02:48 +02:00
Behdad Esfahbod 296d0134c9 [coretext] Change default point size to 12 2017-10-11 14:09:30 +02:00
Dominik Röttsches a5ebe1d4ae [coretext] Recreate CTFont if pt size changed
Attempt at fixing #360
2017-10-11 13:33:05 +02:00
Dominik Röttsches db7a73ce07 [coretext] Fix build 2017-10-11 13:24:48 +02:00
Behdad Esfahbod f334130756 [coretext] Another try 2017-10-11 13:17:46 +02:00
Behdad Esfahbod a8e466c3c1 [coretext] Move CT_Font to font data
Towards implementing optical sizing.  Untested; won't compile.

https://github.com/behdad/harfbuzz/issues/360
2017-10-11 13:05:59 +02:00
Behdad Esfahbod f9b4c6570a [coretext] Move font size to a macro 2017-10-11 12:51:25 +02:00
Behdad Esfahbod 8d450dd188 Infrastructure for creating CTFont with correct font size
https://github.com/behdad/harfbuzz/issues/360
2017-10-11 12:43:46 +02:00
Behdad Esfahbod 16d02a58cf [coretext] Change default font size from 36 to 18 2017-10-11 12:28:06 +02:00
Behdad Esfahbod c0c2dbc871 Remove dirty tracking
Turns out I don't need this to resolve CoreText optical sizing
issue after all.

https://github.com/behdad/harfbuzz/issues/360
2017-10-11 12:23:35 +02:00
Behdad Esfahbod b57f18da70 Add hb_font_[sg]et_ptem() to set/get point size on font
New API:
hb_font_set_ptem()
hb_font_get_ptem()

Needed for hb-coretext optical sizing:
https://github.com/behdad/harfbuzz/issues/360
2017-10-11 11:47:47 +02:00
Behdad Esfahbod 3f9370d9e5 Fix TODO item 2017-10-11 11:34:53 +02:00
Behdad Esfahbod 5f50f8837f [arabic] Fix cluster merging 2017-10-07 13:17:33 +02:00
Behdad Esfahbod c2545b9215 Add check for HB_EXTERNs
https://github.com/behdad/harfbuzz/pull/555
2017-10-07 12:57:30 +02:00
fanc999 48a9406839 Fix build of HarfBuzz tools and HarfBuzz-GObject on Visual Studio (#555)
* hb-buffer.h: Mark hb_buffer_diff() for export

This will fix the tools builds on Visual Studio, as the symbol is used
by the tools.

* build: Adapt NMake Makefiles for GLib 2.53.4 or later

glib-mkenums was ported from a PERL script to a Python script, so we
need to update how we generate the enum sources for HarfBuzz-GObject in
the NMake builds.  Let this be known in the build documentation for MSVC
builds.

One of the problems with the underlying cmd.exe that the NMake Makefiles
run on is that shebang lines are not recognized, so we need to to test
run the script with Python and see whether it succeeded by outputing a
source file that is larger than 0 in file size (since running the PERL
version of the script will clearly fail and cause an empty file to be
created).

If it succeeds, we then run a small Python utility script that makes the
necessary string replacements, and we are done.  If that fails, then we
run the glib-mkenums script with PERL, and do the replacements with the
PERL one-liners as we did before.

We need to make replace.py use latin-1 encoding when using Python 3.x to
cope with the copyright sign that is in the generated enum sources.
2017-10-07 12:57:14 +02:00
Behdad Esfahbod c9e2cf6f55 [ot] Remove 'mal' and 'gle' lang tags
Fixes https://github.com/behdad/harfbuzz/issues/477
2017-10-04 16:59:22 +02:00
Behdad Esfahbod 621c49cb86 Improve performance of ligature component matching
This O(N^2) was introduced in 8b2c94c43f.
Make it O(N).
2017-10-04 15:06:48 +02:00
Behdad Esfahbod ab8d70ec70 [arabic] Implement Unicode Arabic Mark Ordering Algorithm UTR#53
Fixes https://github.com/behdad/harfbuzz/issues/509
2017-10-04 14:47:10 +02:00
Behdad Esfahbod b6fe0ab636 Add info_cc() convenience macro 2017-10-04 13:37:08 +02:00
Behdad Esfahbod 7f9e7f8689 Adjust normalizer for out-of-order marks
We are going to implement Unicode Arabic Mark Ordering Algorithm:

  http://www.unicode.org/reports/tr53/tr53-1.pdf

which will reorder marks out of their sorted ccc order.  Adjust
normalizer to stop combining as soon as dangerous ordering is
detected.
2017-10-04 13:20:33 +02:00
Behdad Esfahbod a252ad61f0 Minor 2017-10-04 13:07:08 +02:00
Behdad Esfahbod 4c05a405ac Revert "Treat HAMZA ABOVE similar to SHADD for sorting purposes"
This reverts commit 5a33057576.

Proper fix coming soon.
2017-10-04 13:06:51 +02:00
Behdad Esfahbod d695cacbf4 Shorthand format controls should not be ignored
Fixes https://github.com/behdad/harfbuzz/issues/503
2017-10-04 11:33:47 +02:00
Behdad Esfahbod 50e95229d7 Add Chinantec language tags
Fixes https://github.com/behdad/harfbuzz/issues/516
2017-10-04 11:28:04 +02:00
Behdad Esfahbod 9786fcd8fd Fix GPOS v_origin ordering
This should affect mark attachment in vertical text.  I have no font to test,
but this sounds the right order.

Noticed while debugging https://github.com/behdad/harfbuzz/issues/532
2017-10-03 17:22:43 +02:00
Behdad Esfahbod 63db692fa9 [indic] Fix shaping of U+0AFB GUJARATI SIGN SHADDA
Fixes https://github.com/behdad/harfbuzz/issues/552
2017-10-03 16:00:18 +02:00
Behdad Esfahbod f559c63307 [indic] Implement Consonent_With_Stacker
Fixes https://github.com/behdad/harfbuzz/issues/528
2017-10-03 15:20:07 +02:00
Behdad Esfahbod e07669fc43 [use] Implement Consonant_With_Stacker
Related to https://github.com/behdad/harfbuzz/issues/528
2017-10-03 14:57:14 +02:00
Behdad Esfahbod 5d98de1f38 Tweak mark-base attachment
Apparently a base glyph can also become an attached component of a
ligature if the ligature-forming lookup used IgnoreBase.  This was
being confused with a non-first component of a MultipleSubst and
hence not matched for mark-attachment.  Tweak test to fix.

Fixes https://github.com/behdad/harfbuzz/issues/543
2017-10-03 13:49:40 +02:00
Behdad Esfahbod c44657a05d Tweak input matching some more
Followup to 8b2c94c43f

Allow matching sequences of marks attached to different ligatures,
as supposedly the base of the subsequent marks were already jumped
over.
2017-10-03 13:14:17 +02:00
Behdad Esfahbod 8b2c94c43f Tweak ligature component matching for ligature formation
If two marks want to ligate and they belong to different components of the
same ligature glyph, and said ligature glyph is to be ignored according to
mark-filtering rules, then allow.

Example Burmese senquence:

  U+1004,U+103A,U+1039,U+101B,U+103D,U+102D

Test font provided by Norbert Lindenberg.

Fixes https://github.com/behdad/harfbuzz/issues/545
2017-10-02 20:03:35 +02:00
Behdad Esfahbod 71c0a1429d [indic] Fix shaping of U+0A51
Mark it as matra below to allow the sequence U+0A15, U+0A51, U+0A47.
Oh well...

Fixes https://github.com/behdad/harfbuzz/issues/524
2017-10-02 18:57:03 +02:00
Behdad Esfahbod 6eb8950e62 [ucdn] Oops! 2017-10-02 18:30:05 +02:00
Behdad Esfahbod cbec0cd65e Remove some really old cruft 2017-10-02 18:26:52 +02:00
Behdad Esfahbod b3dff7720c [ucdn] Update README 2017-10-02 18:22:51 +02:00
Behdad Esfahbod 57c55ef834 [ot] Improve shaper selection heuristic 2017-10-02 18:21:27 +02:00
Behdad Esfahbod 5680ef884c [use] Hack to fix shaping of U+1A7F
Fixes https://github.com/behdad/harfbuzz/issues/525
2017-10-02 18:20:51 +02:00
Behdad Esfahbod 0faa16a253 [ucdn] Update to Unicode 10
Update to commit c000ebf79c095a7d58cf90090bde5715592c4834
plus this bug-fix: https://github.com/grigorig/ucdn/issues/18
2017-10-02 17:15:46 +02:00
Behdad Esfahbod ea535a1dfa [use] Update to Unicode 10 2017-10-02 17:02:39 +02:00
Behdad Esfahbod 29c244aff6 Minor 2017-10-02 16:36:21 +02:00
Behdad Esfahbod 1535f8c672 Add Unicode 10 scripts 2017-10-02 16:12:18 +02:00
Behdad Esfahbod bdbe974f52 [indic] Update table to Unicode 10 2017-10-02 10:00:31 -04:00
Behdad Esfahbod 819cc36049 [indic] Move manual code out of generated table 2017-10-02 09:03:16 -04:00
Behdad Esfahbod da4866f717 [arabic] Update table to Unicode 10 data 2017-10-02 08:57:06 -04:00
Behdad Esfahbod 1a0a356a0f [indic] Categorize U+0980 BENGALI ANJI as placeholder
Fixes https://github.com/behdad/harfbuzz/issues/538
2017-10-02 08:49:23 -04:00
jfkthame 19e77e01bc [shape-plan] Don't look for a cached plan if variation coords are specified. Fixes #549. (#550)
This is a temporary hack just to avoid incorrect shaping results, pending proper support
for caching shape-plans with variation coordinates.
2017-10-02 08:08:49 -04:00
mhosken 66128d3cfb Fix missing xscale in rtl graphite unpacking (#541)
* Fix missing xscale in rtl graphite unpacking

* Oops didn't need to mess with yscale
2017-09-26 14:29:45 -04:00
Behdad Esfahbod 3ca69c8c32 Use strtod_l() to correctly parse decimal numbers in French & other locales
Test with, eg.:
$ LC_ALL=fr_FR.utf-8 ./hb-view NotoSansArabic-VF.ttf بهداد --variations wght=1.2
2017-09-14 20:50:35 -04:00
Behdad Esfahbod d03f11f246 Fix buffer_diff for empty buffers
If buffers are empty, content type should be ignored.

This fixes last of the failing tests: fuzzed.tests.  Green again!
2017-09-04 20:14:13 -07:00
Behdad Esfahbod 7cc348041d [unsafe-to-break] Fix unsafe-to-break for cluster-level=1
Fixes tests/shaping/tests/cluster.tests
2017-09-04 20:06:21 -07:00
Behdad Esfahbod 06cb162cd7 [indic] Treat Consonant_With_Stacker as consonant
Fixes https://github.com/behdad/harfbuzz/issues/528
"Kannada JIHVAMULIYA and UPADHMANIYA insert dotted circles"
2017-09-01 10:34:56 -07:00
Behdad Esfahbod c449d2d8c9 [unsafe-to-break] Mark during fraction-slash formation
Fixes tests/automatic-fractions.tests
2017-08-30 17:28:22 -07:00
Behdad Esfahbod 099472e08b hb_buffer_diff() tweak
I like to have a mode where CONTAINS_NOTDEF and CONTAINS_DOTTEDCIRCLE are not
returned.  Abused a value of -1 for that.  hb-shape now uses it.  Fixes two
of the six tests failing with --verify in test/shaping/run-tests.sh.
2017-08-30 16:45:06 -07:00
Behdad Esfahbod 224d20e4e1 [docs] Minor 2017-08-23 14:49:10 -07:00
Behdad Esfahbod b2dd0c1c32 Add hb_glyph_info_get_glyph_flags()
New API.
2017-08-23 13:12:54 -07:00
Behdad Esfahbod 3e8f4f1452 Rename HB_BUFFER_DIFF_FLAG_MASK_MISMATCH to HB_BUFFER_DIFF_FLAG_GLYPH_FLAGS_MISMATCH 2017-08-22 17:56:25 -07:00
Behdad Esfahbod 8820ba29df Fix warning about "may be used uninitialized" 2017-08-15 17:12:21 -07:00
Emil A Eklund (eae) 91770e1c56 Fix signed/unsigned warning (#522)
Change hb_buffer_diff to explicitly cast result of abs to unsigned when
comparing with position_fuzz to avoid unsafe signed/unsigned comparions
warnings on windows.
2017-08-15 16:25:18 -07:00
Behdad Esfahbod 587f15ece3 Minor 2017-08-14 15:23:10 -07:00
Behdad Esfahbod 338e61ad1b Fix typo 2017-08-14 12:36:38 -07:00
Jonathan Kew 331d66c7fe Add function to compare two buffers
Based on patch from Jonathan Kew.

Needs more cleaning up and documentation.

New API:
hb_buffer_diff_flags_t
hb_buffer_diff()
2017-08-14 11:44:12 -07:00
Behdad Esfahbod 219af509ef [graphite2] Fix warning 2017-08-13 15:10:26 -07:00
Behdad Esfahbod 239119a631 [unsafe-to-break] Mark all positions as unsafe in alternative shapers 2017-08-13 15:08:34 -07:00
Behdad Esfahbod 05fabbd03e [unsafe-to-break] Towards verifying unsafe-to-break in --verify
We break and shape fragments and reconstruct shape result from them.
Remains to compare to original buffer.  Going to add some buffer
comparison API and use here, instead of open-coding.
2017-08-11 20:00:55 -07:00
Behdad Esfahbod 6ce25f57c6 Fix hb_buffer_append()
Ouch!
2017-08-11 19:31:05 -07:00
Behdad Esfahbod 1c17c2bde5 [unsafe-to-break] Copy flag to all glyphs in a cluster
Makes consumption easier.
2017-08-11 19:06:07 -07:00
Behdad Esfahbod ec104e5912 [unsafe-to-break] Mark unsafe is cluster merging is disabled
We were relying on cluster merges not requiring unsafe flagging because
they get merged.  If cluster level requests no merging, then we flag
unsafe when merge would have happened.
2017-08-11 18:24:27 -07:00
Behdad Esfahbod 39a9749430 New API: hb_buffer_append() 2017-08-11 15:52:06 -07:00
Behdad Esfahbod 14a639ea59 [unsafe-to-break] Fix Use-of-uninitialized-value in unsafe_to_break_set_mask
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3011
2017-08-11 11:30:39 -07:00
Behdad Esfahbod e43aad5552 [unsafe-to-break] Flag in Thai PUA shaping 2017-08-10 20:54:15 -07:00
Behdad Esfahbod eae009602b [unsafe-to-break] Flag in Hangul shaper 2017-08-10 20:50:48 -07:00
Behdad Esfahbod b65aa1cd47 [unsafe-to-break] Flag during mark attachment 2017-08-10 20:32:02 -07:00
Behdad Esfahbod 882ebdadd6 [unsafe-to-break] Flag during cursive positioning 2017-08-10 20:23:17 -07:00
Behdad Esfahbod 2d158ca376 [unsafe-to-break] Flag during kerning 2017-08-10 20:20:30 -07:00
Behdad Esfahbod a7c4972cce [unsafe-to-break] Flag during fallback positioning 2017-08-10 20:16:15 -07:00
Behdad Esfahbod e2a2b5b229 [unsafe-to-break] Be careful with flag propagation when merging clusters 2017-08-10 20:11:35 -07:00
Behdad Esfahbod f2868c2008 Set mask to 0, instead of 1, by default
This shouldn't matter.
2017-08-10 20:10:53 -07:00
Behdad Esfahbod 9e005c5d86 [unsafe-to-break] Mark Indic-like clusters as unsafe-to-break 2017-08-10 20:10:53 -07:00
Behdad Esfahbod 5287ccc935 [unsafe-to-break] Allocate public bits from 0 2017-08-10 15:02:34 -07:00
Behdad Esfahbod 91ce0c45d6 [safe-to-break] Fix logic when there is no out-buffer 2017-08-10 15:02:34 -07:00
Behdad Esfahbod a043c99f77 [unsafe-to-break] Simplify logic
Always use the algorithm for non-monotone case.  It's more robust.
2017-08-10 15:02:34 -07:00
Behdad Esfahbod 40bd7e9a1c [unsafe-to-break] Add UNSAFE_TO_BREAK flag
Not all shapers code is updated to set this properly.
GSUB and Arabic shaper are updated.
GPOS and other shapers are NOT.

Fixes https://github.com/behdad/harfbuzz/issues/224
2017-08-10 15:02:28 -07:00
Behdad Esfahbod ac8c4e56d8 [ft] Fix theoretical leak 2017-08-09 22:05:08 -07:00
Behdad Esfahbod 5a33057576 Treat HAMZA ABOVE similar to SHADD for sorting purposes
Part of https://github.com/behdad/harfbuzz/issues/509
2017-08-09 17:23:28 -07:00
Behdad Esfahbod 68af14d5cc Protect against div-by-zero in CBDT extent code
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1452#c5

CC https://github.com/behdad/harfbuzz/issues/139
2017-08-09 17:09:21 -07:00
Behdad Esfahbod 5dc30451b8 Two fixes to avar mapping
1. Handle segment with two entries correctly,

2. Fix rounding math.  Ouch!

Fixes https://github.com/behdad/harfbuzz/issues/521
2017-08-07 21:37:07 -07:00
Behdad Esfahbod dc2c418e39 [check-defs/symbols.sh] Drop empty-symbol lines
Fixes https://github.com/behdad/harfbuzz/issues/510
2017-08-03 12:34:15 +01:00
Ebrahim Byagowi 65f64d1400 Unbreak arm-none-eabi build again (#514) 2017-07-19 02:42:53 +04:30
Behdad Esfahbod c1432bce3c [arabic] Adjust feature order again
Fixes https://github.com/behdad/harfbuzz/issues/505
2017-07-14 17:35:17 +01:00
Cosimo Lupo 9813be3d12 [coretext] Allow to disable kern (#508)
* Minor

* [coretext] Fix leak

* [coretext] Do not reset num_features

* [coretext] allow to disable kern; re-enabling doesn't seem to be working
2017-07-14 17:11:46 +01:00
Behdad Esfahbod 9dd29c681e [use] Allow up to two medial-below letters
Fixes https://github.com/behdad/harfbuzz/issues/376
2017-07-14 17:01:27 +01:00
Behdad Esfahbod 216b003c91 [use] Fix shaping of U+AA29 CHAM VOWEL SIGN AA
Part of https://github.com/behdad/harfbuzz/issues/376
Also see https://github.com/roozbehp/unicode-data/issues/6

Test added, using NotoSansCham built from Noto Phase III sources.
2017-07-14 16:38:51 +01:00
Behdad Esfahbod f1cd7ca893 [indic] Add github URL 2017-07-14 15:59:40 +01:00
Behdad Esfahbod 3cc84f45b9 [indic] Fix https://github.com/behdad/harfbuzz/issues/478 2017-07-14 15:50:22 +01:00
Behdad Esfahbod e359a4b8f5 [indic] Disable automatic ZWNJ handling for Indic features
Fixes https://github.com/behdad/harfbuzz/issues/294

Also fixes a bunch of other Indic issues.  Test results after:

BENGALI: 353725 out of 354188 tests passed. 463 failed (0.130722%)
DEVANAGARI: 707307 out of 707394 tests passed. 87 failed (0.0122987%)
GUJARATI: 366355 out of 366457 tests passed. 102 failed (0.0278341%)
GURMUKHI: 60732 out of 60747 tests passed. 15 failed (0.0246926%)
KANNADA: 951201 out of 951913 tests passed. 712 failed (0.0747968%)
KHMER: 299071 out of 299124 tests passed. 53 failed (0.0177184%)
MALAYALAM: 1048136 out of 1048334 tests passed. 198 failed (0.0188871%)
ORIYA: 42320 out of 42329 tests passed. 9 failed (0.021262%)
SINHALA: 271662 out of 271847 tests passed. 185 failed (0.068053%)
TAMIL: 1091754 out of 1091754 tests passed. 0 failed (0%)
TELUGU: 970555 out of 970573 tests passed. 18 failed (0.00185457%)

Before:

BENGALI: 353725 out of 354188 tests passed. 463 failed (0.130722%)
DEVANAGARI: 707307 out of 707394 tests passed. 87 failed (0.0122987%)
GUJARATI: 366349 out of 366457 tests passed. 108 failed (0.0294714%)
GURMUKHI: 60732 out of 60747 tests passed. 15 failed (0.0246926%)
KANNADA: 951190 out of 951913 tests passed. 723 failed (0.0759523%)
KHMER: 299070 out of 299124 tests passed. 54 failed (0.0180527%)
MALAYALAM: 1048136 out of 1048334 tests passed. 198 failed (0.0188871%)
ORIYA: 42320 out of 42329 tests passed. 9 failed (0.021262%)
SINHALA: 271662 out of 271847 tests passed. 185 failed (0.068053%)
TAMIL: 1091753 out of 1091754 tests passed. 1 failed (9.15957e-05%)
TELUGU: 970555 out of 970573 tests passed. 18 failed (0.00185457%)
2017-07-14 14:22:52 +01:00
Behdad Esfahbod cdf1fd0627 [indic] Add infrastructure to disable ZWNJ-skipping in context-matching
Not used yet.
2017-07-14 12:43:34 +01:00
Dominik Schlösser 4e21ec5469 Fix for reordering of Tibetan vowel u (#443)
* Undone change for Tibetan vowel u

* removed comment on reordering that became invalid with roll-back

* Support for Dzongkha contractions with multiple vowel-signs

* Removed non-functional and unnecessary defines for HB_MODIFIED_COMBINING_CLASS_CCC138,140
2017-07-14 12:14:23 +01:00
Ebrahim Byagowi 3b0e47ca00 Fix arm-none-eabi build (fixes #451) (#496) 2017-06-19 14:47:09 +04:30
Ebrahim Byagowi 76c4873e8c Support branch prediction helpers on clang compiles (#491) 2017-06-02 13:23:10 -04:00
Behdad Esfahbod 7dba30639a Handle allocation failure in hb-language code 2017-06-01 11:44:42 -04:00
Sebastian Rasmussen 92e2c4baaf Avoid using strdup inside library. (#488)
If an application provides a malloc replacement through
hb_malloc_impl() it is important that it is used to allocate
everything, but the use of strdup() circumvents this and
causes system malloc() to be called instead. This pairs
badly with the custom hb_free_impl() being called later.
2017-05-29 10:53:30 -07:00
Khaled Hosny 06cfe3f736 Do not skip TAG characters in glyph substitution (#487)
Hide them like Mongolian Free Variation Selectors instead.

Fixes https://github.com/behdad/harfbuzz/issues/463
2017-05-17 11:32:47 -07:00
Behdad Esfahbod 1817221620 Minor 2017-05-16 14:26:28 -07:00
mhosken 74b99ef224 Fix graphite2 rtl conversion (#475) 2017-04-20 11:13:22 -07:00
Chris Peterson aacca37590 Fix clang -Wcomma warnings (#471) (#472)
clang's new -Wcomma compiler option warns about possible misuse of the
comma operator such as between two statements.

hb-common.cc:190:9 [-Wcomma] possible misuse of comma operator here
hb-ot-layout-gsubgpos-private.hh:345:30 [-Wcomma] possible misuse of
comma operator here
hb-shape-plan.cc:438:26 [-Wcomma] possible misuse of comma operator here
2017-04-17 23:25:24 -07:00
William Hua 5ecf96e3a2 Use absolute paths of ragel generated headers (#467)
https://github.com/behdad/harfbuzz/issues/455
2017-04-16 22:33:42 -07:00
jfkthame c04c1fe86e Blacklist GDEF table in additional Tahoma versions. (#459)
There are more broken versions of Tahoma out there on various Windows releases,
so we need to add them to our blacklist to avoid broken rendering.
See https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 for details.
2017-04-11 14:29:13 -07:00
ebraminio adfd4ae1cf [cmake] Improve third party libraries support (#461) 2017-04-11 23:18:18 +04:30
Behdad Esfahbod a4471d0c2c Move list of ragel sources to Makefile.sources as well 2017-04-05 15:42:11 +02:00
ebraminio d2acaf6d72 Split ragel generated files lists and remove hardcoded rl files lists (#453) 2017-04-05 11:21:23 +02:00
jfkthame 740fdbcd0e avoid UBSan warning in get_stage_lookups (#450)
See https://bugzilla.mozilla.org/show_bug.cgi?id=1336600
2017-04-03 13:22:39 +02:00
Behdad Esfahbod edcf6344bc Blacklist more versions of Padauk
Patch from Phil Race.
2017-03-24 10:24:52 -07:00
Khaled Hosny 91570a1eeb Just always use strtod here 2017-03-22 23:07:20 +02:00
Chun-wei Fan 539571c1a9 src/hb-common.cc: Fix build on older Visual Studio
Visual Studio only supported strtof() from Visual Studio 2013 onwards, so
use strtod() instead to do the operation, which should do the same thing,
sans going to a double, not a float.
2017-03-22 23:03:49 +02:00
Behdad Esfahbod 47e7a1800f Revert "Fix Context lookup application when moving back after a glyph delete"
This reverts commit b9b005f3a4.

This introduced invalid access cases. Revert until I fix correctly.
2017-03-10 13:23:02 -08:00
Behdad Esfahbod 3c080a7a0a Fix buffer serialize of empty buffer
Ouch!
2017-03-07 18:13:28 -08:00
Behdad Esfahbod 9ac9af725c Add TODO item 2017-03-05 13:51:01 -08:00