Commit Graph

4434 Commits

Author SHA1 Message Date
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