Commit Graph

222 Commits

Author SHA1 Message Date
Ebrahim Byagowi 486754a888 [serialize] Extract iterable copy, copy_all 2019-10-31 13:31:11 -07:00
Khaled Hosny dd288840d6 [cmap] Check GID before adding ranges in format 4 & 12
Fixes https://github.com/harfbuzz/harfbuzz/issues/2031
2019-10-29 02:09:13 +02:00
Behdad Esfahbod 03028a5fe5 Revert "Don't include codepoint 0 in the results of collect_unicodes."
This reverts commit 14ad96ffbf.

This was wrong.  My bad!

https://github.com/harfbuzz/harfbuzz/issues/2031
2019-10-28 13:46:56 -07:00
Garret Rieger 14ad96ffbf Don't include codepoint 0 in the results of collect_unicodes.
It is always assumed to be the notdef glyph.
2019-10-28 12:56:04 -07:00
Ebrahim Byagowi 0558413f27 Minor, tweak spaces 2019-10-01 13:50:11 +03:30
Ebrahim Byagowi 035ec3d1b4
[cmap] remove has_format14, minor format
fixes #1986
2019-09-23 20:51:43 +03:30
Ebrahim Byagowi 385741d565 [cmap] Turn hb_apply into foreach where possible 2019-09-21 15:33:02 +04:30
Ebrahim Byagowi 1023c2cc6d [cmap] minor 2019-09-21 15:33:02 +04:30
Ebrahim Byagowi ead46eefe3 minor, use internal API instead public hb_set_has 2019-09-21 15:33:02 +04:30
Ebrahim Byagowi d8af4e7701 [cmap] minor, turn 8 spaces to tab 2019-09-21 15:33:02 +04:30
Qunxin Liu 4315666283 [subset] updates according to review comments 2019-09-20 07:55:11 +09:00
Qunxin Liu 2583afa0eb [subset] subsetting cmap14 2019-09-20 07:55:11 +09:00
Qunxin Liu 078ddbd0f6 [subset] glyph closure for CMAP14 2019-09-20 07:55:11 +09:00
Ebrahim Byagowi d512087e4d Rename GlyphID to HBGlyphID
Avoid collision with macOS's ATSUnicodeTypes.h GlyphID
2019-09-14 11:55:53 +04:30
Ebrahim Byagowi a0b4ac4dce Turn 8 spaces to tab across the project
According to the current code style of the project
2019-08-27 02:40:41 +04:30
Behdad Esfahbod d304d60e4d [ot-font] Prefer symbol cmap subtable if found
Fixes https://github.com/harfbuzz/harfbuzz/issues/1918

Hopefully doesn't break anyone...
2019-08-21 12:30:22 -07:00
Qunxin Liu 37572882e7 [subset] cmap table to use _subset2 and new iterator frameworks 2019-08-05 11:26:34 -07:00
Ebrahim Byagowi 7a9d643c29
Fix unintialized memory read in cmap subset (#1826) 2019-07-11 01:35:07 +04:30
Behdad Esfahbod 3caa32d737 [config] Add HB_NO_CMAP_LEGACY_SUBTABLES
Part of https://vimeo.com/331852453/06eec89c65
2019-06-19 19:59:26 -07:00
Michiharu Ariza 82d4bfb8f3 enable cff subset tests
add Unicode UCS-4 cmap
fix Unicode bits in OS/2
add Unicode cmap sub-table in SourceHanSans-Regular_subset.otf
regenerate cff subset test expected results
2019-06-14 11:08:59 -07:00
Qunxin Liu 993d81b9c5 [subset] Add one ttf file with fvar/STAT tables to integration test
Ignore gvar/MVAR/HVAR table
add support for --nameIDs=* option
2019-05-22 17:20:45 -07:00
Garret Rieger a5fb44a8cb [subset] Fix shadowed 'groups' param in cmap. 2019-05-13 15:04:35 -07:00
Behdad Esfahbod 750d5af48e Make compiler happy with -Og 2019-05-08 12:10:00 -07:00
Behdad Esfahbod 41248cce0e Remove MIN/MAX in favor of hb_min/hb_max 2019-05-07 20:54:31 -07:00
Behdad Esfahbod 699de689e9 Delete default assignment operator Offset<> 2019-04-15 16:00:20 -04:00
Behdad Esfahbod 95df00aec1 Hide a few static methods
Looks like static methods that do not get inlined end up exported.
We have a lot more.  Need to protect all at some point.  Wish there
was an easier way, like the visibility flag we pass that automatically
hides all inline methods.

Was exposed by check-symbols.sh when compiling on OS X 10.14 with:

$ make CPPFLAGS=-Oz CXXFLAGS=-flto=thin LDFLAGS=-lc++
2019-04-12 17:51:14 -04:00
Behdad Esfahbod 64d0f08938 [cmap] Minor 2019-04-01 16:56:41 -07:00
Behdad Esfahbod b986c6a321 [C++11] Remove IntType::set() in favor of operator= 2019-03-29 20:21:21 -07:00
Behdad Esfahbod 090fe56dc6 Merge branch 'master' into iter 2019-01-25 16:06:52 +01:00
Behdad Esfahbod 447323b85a Better fix for -Wcast-align errors 2019-01-22 12:50:12 +01:00
Behdad Esfahbod 8d05bf7dc0 Fix cast-align error
If compiler doesn't inline StructAtOffset, this was an error since we
only disable cast-align at call-site.  So, move the cast out.

../src/hb-machinery.hh: In instantiation of 'const Type& StructAtOffset(const void*, unsigned int) [with Type = unsigned int]':
../src/hb-font.cc:146:85:   required from here
../src/hb-machinery.hh:63:12: error: cast from 'const char*' to 'const unsigned int*' increases required alignment of target type [-Werror=cast-align]
 { return * reinterpret_cast<const Type*> ((const char *) P + offset); }
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/hb-machinery.hh: In instantiation of 'Type& StructAtOffset(void*, unsigned int) [with Type = unsigned int]':
../src/hb-font.cc:147:79:   required from here
../src/hb-machinery.hh:66:12: error: cast from 'char*' to 'unsigned int*' increases required alignment of target type [-Werror=cast-align]
 { return * reinterpret_cast<Type*> ((char *) P + offset); }
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-01-22 12:34:05 +01:00
Behdad Esfahbod ef00654962 Convert tag enum class consts to static constexpr
Part of https://github.com/harfbuzz/harfbuzz/issues/1553
2019-01-22 12:17:26 +01:00
Behdad Esfahbod 8237809f06 [serialize] Make SortedArrayOf:;serialize() take sorted-iterator 2019-01-20 20:12:12 -05:00
Behdad Esfahbod b900f78088 [pragma] More cast-align whitelist 2019-01-18 10:08:23 -05:00
Behdad Esfahbod 474a12058d [array/vector] Rename len to length 2018-12-21 18:53:01 -05:00
Behdad Esfahbod f1e95e40ed [arrays] Remove hb_supplier_t<> 2018-12-18 16:49:08 -05:00
Behdad Esfahbod cf39c24205 [arrays] Rename Supplier to hb_supplier_t 2018-12-17 22:36:23 -05:00
Ebrahim Byagowi e412008599 Remove redundant void from C++ sources (#1486) 2018-12-17 13:01:01 -05:00
Ebrahim Byagowi b2ebaa9afa Remove redundant 'inline' from methods (#1483) 2018-12-16 14:08:10 -05:00
Behdad Esfahbod 6e33a3955d Minor 2018-12-13 16:40:01 -05:00
Ebrahim Byagowi 7ee5c52345
minor style fix, use void in methods on no argument 2018-12-12 15:14:37 +03:30
Behdad Esfahbod 5c4fead734 Convert "static const hb_tag_t" constants to enum 2018-11-29 15:05:47 -05:00
Behdad Esfahbod 861bc75349 [vector] Make pointer cast explicit
Too bad this doesn't help MSVC 2008 build, as explicit operators are
C++11.
2018-11-29 14:34:44 -05:00
Behdad Esfahbod 30cb45b3ea Change ArrayOf.bsearch() return semantics
Towards consolidating all array bsearch/...
2018-11-24 00:48:26 -05:00
Behdad Esfahbod ec83b2228e Add null bytes for CmapSubtableLongGroup 2018-11-23 19:59:31 -05:00
Behdad Esfahbod e4a4555d1e [cmap] Move code around 2018-11-22 22:17:49 -05:00
Ebrahim Byagowi 11aa0468ac [subset] minor, adjust spaces 2018-11-16 00:02:47 +03:30
Behdad Esfahbod da6aa3b033 Add hb_blob_ptr_t.destroy() 2018-11-11 11:40:57 -05:00
Behdad Esfahbod 0e2680a6e8 [cmap] Port to hb_blob_ptr_t
Although didn't need it...
2018-11-11 00:28:47 -05:00
Behdad Esfahbod 1d66cdcf77 Better fix for MSVC 2008
Follow up on b4c6113032

Fixes https://github.com/harfbuzz/harfbuzz/issues/1374
2018-11-10 19:57:51 -05:00
Behdad Esfahbod 56ba998cdd [cmap] Push get_nominal_glyphs down into cmap accelerator 2018-11-05 19:49:54 -05:00
Behdad Esfahbod 36d85dce25 [cmap] Use hb_nonnullptr_t 2018-11-05 19:46:29 -05:00
Behdad Esfahbod bb380ec183 [cmap] Make null accelerator safe
Fixes https://github.com/harfbuzz/harfbuzz/issues/1146
2018-11-05 13:47:30 -05:00
Behdad Esfahbod 56e0fd345c Remove last use of hb_auto_t<> 2018-10-29 22:35:44 -07:00
Behdad Esfahbod 3a4e5dd425 Remove a few unnecessary hb_auto_t<>'s
See a85641446c30247c4e948263f0f8c1147ed4efb9
2018-10-29 22:27:20 -07:00
Behdad Esfahbod be87959a67 [cmap] Minor 2018-10-29 15:16:38 -07:00
Behdad Esfahbod 955aa56b11 [vector] Make it act more like pointer
Add pointer cast operator and plus operator.
2018-10-25 16:50:38 -07:00
Behdad Esfahbod 21ede867df Fix possible overflow in bsearch impls
From bungeman.

Fixes https://github.com/harfbuzz/harfbuzz/pull/1314
2018-10-25 13:19:58 -07:00
Ebrahim Byagowi 63109432cf Cosmetic and minor changes 2018-10-13 07:23:33 -04:00
Behdad Esfahbod 341206eb60 [vector] Make hb_vector_t relocatable / nestable
Ugly, but...
Fixes https://github.com/harfbuzz/harfbuzz/issues/1227
2018-10-05 18:39:48 +02:00
Behdad Esfahbod dff2c45f1e Port rest from VAR to UnsizedArrayOf<> 2018-09-11 01:01:08 +02:00
Behdad Esfahbod d1f29908c2 [subset] Add hb_subset_context_t<> 2018-08-31 16:31:00 -07:00
Behdad Esfahbod aba0a945c5 [subset] Add hb-subset-input.hh and make hb-subset.hh toplevel include 2018-08-31 13:25:19 -07:00
Behdad Esfahbod 2ccc322cf8 [ot-font] Clean up cmap with gid=0
Fixes https://github.com/harfbuzz/harfbuzz/issues/1145
2018-08-29 16:38:25 -07:00
Behdad Esfahbod 3a0b3a29cc Free up hb-ot-face.hh from includes
There might be a better way to do this, but I couldn't find...
2018-08-26 15:11:24 -07:00
Behdad Esfahbod 963413fc54 WIP 2018-08-26 00:47:55 -07:00
Behdad Esfahbod e6cb938065 [ot-face] Unify accelerators and tables 2018-08-26 00:21:29 -07:00
Behdad Esfahbod 1c48a7ef06 [ot-font] Cache tables on face, not font 2018-08-25 23:57:16 -07:00
Behdad Esfahbod c77ae40852 Rename hb-*private.hh to hb-*.hh
Sorry for the noise, downstream custom builders.  Please adjust.
2018-08-25 22:36:36 -07:00
Behdad Esfahbod 82b12bcadd [unicode] Add HB_UNICODE_MAX
New API:
HB_UNICODE_MAX
2018-08-25 22:07:17 -07:00
Behdad Esfahbod 28634db07e [cmap] Fix skipping gid0 in Format4 collect_unicodes() 2018-08-25 21:23:43 -07:00
Behdad Esfahbod ddea4d19cf Add 1-param passthrough constructor to hb_auto_t<>
And use.
2018-08-25 21:08:15 -07:00
Behdad Esfahbod c8cfb702e9 [cmap] Minor 2018-08-25 16:18:00 -07:00
Behdad Esfahbod 1dcf5fb038 [cmap Add hb_subset_collect_variation_unicodes()
To be moved to hb-face.h later.
2018-08-25 16:12:18 -07:00
Behdad Esfahbod 4806b3800d [cmap] Add hb_subset_collect_variation_selectors()
To be moved to hb-face later.
2018-08-25 15:58:40 -07:00
Behdad Esfahbod 3336de2479 [cmap] Remove unused code 2018-08-25 15:41:25 -07:00
Behdad Esfahbod 1becabe06c [cmap] Use bsearch to find subtables 2018-08-25 15:37:56 -07:00
Behdad Esfahbod 02fe03e09a [cmap] Factor out find_best_subtable 2018-08-25 15:33:05 -07:00
Behdad Esfahbod b41c43b4e1 Minor 2018-08-25 15:25:03 -07:00
Behdad Esfahbod 7d382fa276 [cmap] Implement collect_unicodes() for Format0/6/10 2018-08-25 09:42:52 -07:00
Behdad Esfahbod bd0e542525 [cmap] Simplify collect_unicodes()
Don't use accelerator (almost).  Hooks up Format13 as well.
2018-08-25 09:33:30 -07:00
Behdad Esfahbod d60c465627 Rename get_all_codepoints() to collect_unicodes() 2018-08-25 08:48:42 -07:00
Behdad Esfahbod 531051b8b9 [ot-font] Return char-not-found if mapped to gid 0
OpenType cmap table can use gid=0 to mean "not covered" to produce
more optimized cmap subtables.  Return false from get_nominal_glyph()
for those.  hb-ft already does this.
2018-08-25 08:44:18 -07:00
Garret Rieger 2bdd903c69 [subset] limit the max codepoint value to the unicode limit.
When collecting all codepoints in the cmap avoid using large amount of memory for fonts that declare coverage over all 32 bit integers.
2018-07-31 18:40:38 -07:00
Behdad Esfahbod e57a638bde One more 2018-07-23 12:00:02 -07:00
Behdad Esfahbod 36ed163fdd Remove unnecessary OT:: namespace specifiers 2018-07-23 11:57:45 -07:00
Behdad Esfahbod 9583e0077d Port more off of Sanitizer<> 2018-07-22 22:43:25 -07:00
Behdad Esfahbod bddeb2b10c Minor renamings of internal inline functions 2018-07-10 14:13:21 +02:00
Behdad Esfahbod f7515769fd [vector] Use Crap pool in push() as well 2018-06-01 17:48:37 -07:00
Garret Rieger 251cc977e9 [subset] Switch to using hb_map_t inside of hb_subset_plan_t. 2018-05-30 17:23:59 -06:00
Behdad Esfahbod e99d75ea9c Fix warning 2018-05-09 15:31:57 -07:00
Behdad Esfahbod 63f57f4dab Mark more unsized array's as arrayZ 2018-05-08 16:56:11 -07:00
Behdad Esfahbod 0644d92ef3
Merge pull request #1018 from googlefonts/cmap4
[subset] Add cmap format 4 subsetting.
2018-05-08 15:21:09 -07:00
Behdad Esfahbod eba1c16a60 Always lock blob in sanitize. Remove blob->lock_as() in favor of blob->lock() 2018-05-08 02:47:42 -07:00
Behdad Esfahbod b4fa505014 Move Sanitizer::lock_instance<>() to blob->lock_as<>(). 2018-05-08 02:45:08 -07:00
Behdad Esfahbod abc12f7b81 Move null pool to hb-private 2018-05-08 02:23:36 -07:00
Garret Rieger 3be050f075 [subset] entrySelectorZ -> entrySelector. 2018-05-04 11:23:32 -07:00
Garret Rieger 7c22f98da7 [subset] add missing template parameter. 2018-05-04 11:20:03 -07:00
Garret Rieger 95eb0f3baf [subset] Switch to a non-log using implementation of caculating searchRangeZ, entrySelectorZ, and rangeShiftZ in cmap4. 2018-05-04 11:20:03 -07:00
Garret Rieger c817992f49 [subset] Write out a format 4, plat 0 encoding record to match fontTools. 2018-05-04 11:20:03 -07:00