Commit Graph

11927 Commits

Author SHA1 Message Date
Behdad Esfahbod 9e5738a86a [set] Okay, giving up on constexpr till C++14
../src/hb-set.hh:213:89: error: call to non-'constexpr' function 'const elt_t& hb_vector_size_t<elt_t, byte_size>::operator[](unsigned int) const [with elt_t = long long unsigned int; unsigned int byte_size = 64]'
2021-05-26 15:15:06 -06:00
Khaled Hosny fac0bc7876 [meson] Drop more wraps we don’t use directly 2021-05-26 23:11:44 +02:00
Khaled Hosny 21d1034dc0 [meson] Remove expat.wrap that we don’t use directly
Fixes https://github.com/harfbuzz/harfbuzz/issues/2987
2021-05-26 23:11:44 +02:00
Behdad Esfahbod 90fa558a5b [set] Another try at constexpr to make msvc happy 2021-05-26 15:05:48 -06:00
Behdad Esfahbod bf5d4a6392 [set] Add TODO 2021-05-26 14:27:02 -06:00
Behdad Esfahbod 11d03f1ff9 [set] Mark a couple methods as constexpr 2021-05-26 14:26:05 -06:00
Behdad Esfahbod d2829ad374 [set] Refactor code into page_t::is_subset() 2021-05-26 14:24:27 -06:00
Behdad Esfahbod e47e44a858 [set] Whitespace 2021-05-26 14:19:27 -06:00
Kurt Kartaltepe 2000f47ae5 [set] Compute is_subset by comparing pages.
Test subsets one page at a time instead of by codepoints. On my machine
this is about 250x faster than the previous implementation.
2021-05-26 14:15:25 -06:00
Dominik Röttsches 1dffb55361 Chromium build fixes for C++ 17 warning and missing _remap_indexes
Use class instead of typename, move _remap_indexes out of #ifndef.

Fixes #2979
2021-05-18 08:20:46 -06:00
Jonathan Kew 89df353996 [aat] Add testcase for Apple Color Emoji couple-with-skin-tones sequence. 2021-05-17 21:44:29 -06:00
Jonathan Kew bbc5fc3731 [aat] If shaping via morx, don't adjust mark positioning when zeroing widths. 2021-05-17 21:44:29 -06:00
Jonathan Kew 4f1e8d2bf7 [aat] Update glyph properties from GDEF if available when doing a replacement. 2021-05-17 21:44:29 -06:00
Garret Rieger 5e0ec33b3d Error when link width not in [2, 4] 2021-05-12 16:05:11 -06:00
Qunxin Liu b23f29bf05 [subset] Add subset () method for COLRv1 Paint tables, BaseGlyphV1List and LayerV1List
Also add support for Offset24 in serializer and repacker
2021-05-12 16:05:11 -06:00
Garret Rieger 413769bf86 Add hb-ot-color-colrv1-closure.hh to sources list. 2021-05-12 15:29:53 -06:00
Garret Rieger de0eba20ed Remove array for visited_paint. 2021-05-12 15:29:53 -06:00
Qunxin Liu e59ffe5482 [subset] COLRv1 layer/palette indices closure 2021-05-12 15:29:53 -06:00
Garret Rieger a08900b721 [subset] fix failing colrv0 subsetting when font has composite glyphs.
Composite glyph collection was happening along side colrv0 glyph collection which meant it was possible to miss grabbing the component glyphs for a glyph added by colrv0.
2021-05-10 15:33:54 -06:00
tstuefe b54d9b695a start 2021-05-07 16:23:09 -06:00
Garret Rieger b07b97d5d7 [subset] Add more Noto Nastaliq test cases. 2021-05-06 14:24:45 -06:00
Khaled Hosny b37f03f16b 2.8.1 2021-05-04 02:07:06 +02:00
Khaled Hosny d3e84413fd [ci] Drop macos-10_13_6-aat-fonts job
This version of macOS is no longer supported by Homebrew, it takes 26
minutes to brew the dependencies before it fails.
2021-05-02 02:14:08 +02:00
Khaled Hosny 517d68b26e [ci] Pin fedora 33 docker image
g-ir-scanner is broken on 34 image:

FAILED: src/HarfBuzz-0.0.gir
/usr/bin/g-ir-scanner --no-libtool --namespace=HarfBuzz --nsversion=0.0 --warn-all --output src/HarfBuzz-0.0.gir --c-include=hb-gobject.h --cflags-begin -DHB_NO_SINGLE_HEADER_ERROR -DHAVE_GOBJECT -DHB_EXTERN= --cflags-end -I/root/project/src -I/root/project/build/src -I./. -I../. --filelist=/root/project/build/src/libharfbuzz-gobject.so.0.20800.0.p/HarfBuzz_0.0_gir_filelist --include=GObject-2.0 --symbol-prefix=hb --symbol-prefix=hb_gobject --identifier-prefix=hb_ --pkg-export=harfbuzz-gobject --cflags-begin -DHAVE_CONFIG_H -I./. -I../. -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -I./src/. -I../src/. -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/gobject-introspection-1.0 --cflags-end --add-include-path=/usr/share/gir-1.0 -L/root/project/build/src --extra-library=harfbuzz --library harfbuzz-gobject -L/root/project/build/src -L/root/project/build/src --extra-library=glib-2.0 --extra-library=gobject-2.0 --extra-library=m --extra-library=freetype --extra-library=girepository-1.0 --sources-top-dirs /root/project/subprojects/ --sources-top-dirs /root/project/build/subprojects/
../src/hb-buffer.cc:641: Warning: HarfBuzz: unknown annotation: xconstructor
../src/hb-face.cc:192: Warning: HarfBuzz: unknown annotation: xconstructor
../src/hb-font.cc:551: Warning: HarfBuzz: unknown annotation: xconstructor
../src/hb-font.cc:1519: Warning: HarfBuzz: unknown annotation: xconstructor
../src/hb-map.cc:43: Warning: HarfBuzz: unknown annotation: xconstructor
../src/hb-ot-name.cc:55: Warning: HarfBuzz: unexpected annotation: out
../src/hb-set.cc:43: Warning: HarfBuzz: unknown annotation: xconstructor
../src/hb-shape-plan.cc:173: Warning: HarfBuzz: unknown annotation: xconstructor
../src/hb-shape-plan.cc:201: Warning: HarfBuzz: unknown annotation: xconstructor
../src/hb-unicode.cc:172: Warning: HarfBuzz: unknown annotation: xconstructor
g-ir-scanner: link: gcc -pthread -o /root/project/build/tmp-introspecta9rymai3/HarfBuzz-0.0 /root/project/build/tmp-introspecta9rymai3/HarfBuzz-0.0.o -L. -Wl,-rpath,. -Wl,--no-as-needed -L/root/project/build/src -Wl,-rpath,/root/project/build/src -L/root/project/build/src -Wl,-rpath,/root/project/build/src -L/root/project/build/src -Wl,-rpath,/root/project/build/src -lharfbuzz-gobject -lharfbuzz -lglib-2.0 -lgobject-2.0 -lm -lfreetype -lgirepository-1.0 -lgio-2.0 -lgobject-2.0 -Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0 -lglib-2.0
ldd: error: you do not have read permission for `/root/project/build/tmp-introspecta9rymai3/HarfBuzz-0.0'
Traceback (most recent call last):
  File "/usr/bin/g-ir-scanner", line 99, in <module>
    sys.exit(scanner_main(sys.argv))
  File "/usr/lib64/gobject-introspection/giscanner/scannermain.py", line 599, in scanner_main
    shlibs = create_binary(transformer, options, args)
  File "/usr/lib64/gobject-introspection/giscanner/scannermain.py", line 428, in create_binary
    shlibs = resolve_shlibs(options, binary, options.libraries)
  File "/usr/lib64/gobject-introspection/giscanner/shlibs.py", line 170, in resolve_shlibs
    _resolve_non_libtool(options, binary, non_libtool))
  File "/usr/lib64/gobject-introspection/giscanner/shlibs.py", line 106, in _resolve_non_libtool
    output = subprocess.check_output(args)
  File "/usr/lib64/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib64/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ldd', '/root/project/build/tmp-introspecta9rymai3/HarfBuzz-0.0']' returned non-zero exit status 1.
ninja: build stopped: subcommand failed.
2021-05-02 00:08:04 +02:00
Garret Rieger 2b7647649a [subset] update test-subset-gpos expected files. 2021-04-30 14:46:57 -06:00
Garret Rieger be50779cda [subset] correct ClassDef format determination.
It was possible for glyph_min to be a glyph mapped to class zero which threw off the number of glyph calculation.
2021-04-30 14:46:57 -06:00
Khaled Hosny 90713f270e [hb-ot-layout] Document some return values 2021-04-30 14:05:33 -06:00
Behdad Esfahbod 46362a954c
Merge pull request #2958 from googlefonts/layout_by_default_gr
[subset] Enable layout subsetting by default.
2021-04-30 11:39:47 -06:00
Behdad Esfahbod 42bf8e3d49 [util] Disable chafa's truecolor mode
See https://github.com/harfbuzz/harfbuzz/pull/2959#issuecomment-827056111
2021-04-26 12:31:44 -06:00
Khaled Hosny c571a96eb0 [ci] Disable Chafa on jobs that enables all auto features
No suitable versions are available on these setups.
2021-04-26 12:13:10 -06:00
Hans Petter Jansson 8298c2f93b [hb-view] Use Chafa for terminal graphics if available
This produces high-quality terminal graphics using symbols or sixels
according to the detected terminal capabilities.

Fixes #2430.
2021-04-26 12:13:10 -06:00
Garret Rieger e25efb31f2 [subset] consider all value formats when computing effective format. 2021-04-23 19:09:37 -07:00
Qunxin Liu 84dbfacfec [subset] fix collect_variation_idx in PairPosFormat2 2021-04-23 18:52:24 -07:00
Garret Rieger d356d0f79c [subset] optimize ValueRecord's for PairPosFormat1. 2021-04-23 18:50:34 -07:00
Garret Rieger f9fbe4817e [subset] implement value record optimization for PairPosFormat2. 2021-04-23 18:50:34 -07:00
Garret Rieger badb8e409b [subset] use copy_values for PairPos serialize. 2021-04-23 18:50:33 -07:00
Garret Rieger 2f50283cd3 [subset] Begin implementing ValueRecord optimization:
remove value records which have a zero value.
2021-04-23 18:50:33 -07:00
Garret Rieger 5df7c668ba [subset] In SinglePosFormat1 serialize only 1 value record.
Previously one record per glyph in the subset was serialized.
2021-04-23 18:50:33 -07:00
Garret Rieger 92757f6809 [subset] Don't drop anchor device tables when dropping hints. These may contain variation data.
Update subseting expected files to match latest version of fontTools.
2021-04-23 18:50:33 -07:00
Garret Rieger 6fddc2bbf9 [subset] subset layout tables (G*) by default. 2021-04-22 15:08:49 -07:00
Garret Rieger 425ba1f4ab [subset] fixes infinite loop in hb_set_get_max().
Fixes https://oss-fuzz.com/testcase-detail/5363902507515904
2021-04-20 13:18:07 -06:00
Garret Rieger ec4321068b [subset] fix infinite loop caused by alloc failure in repacker.
Fixes: https://oss-fuzz.com/testcase-detail/5609112151916544.
2021-04-20 13:18:07 -06:00
Garret Rieger 0e845d973e [subset] fix memory leak in repacker caused by failed alloc.
Fixes: https://oss-fuzz.com/testcase-detail/5616763250278400.
2021-04-20 13:18:07 -06:00
Garret Rieger 3fb62cdc14 [subset] fail on offset overflow in tables that we don't repack.
Fixes: https://oss-fuzz.com/testcase-detail/5229304507138048
2021-04-19 17:01:05 -06:00
Behdad Esfahbod 19e096aa97
Merge pull request #2067 from harfbuzz/null-size
Avoid undefined-behavior, another try
2021-04-16 14:35:04 -06:00
Behdad Esfahbod ed2ee8a8c2 Revert "Disable -Wunused-macros under GCC"
This reverts commit 1b1413246b.

Err. It wasn't working. We already have that disabled in the files it
is warning about. Doesn't work.
2021-04-16 13:53:43 -06:00
Behdad Esfahbod 47cbf8f2c4 [test] Silence more compiler warnings 2021-04-16 13:32:02 -06:00
Behdad Esfahbod 1b1413246b Disable -Wunused-macros under GCC
Since the pragram in hb-ot-shape-complex-indic-table.cc didn't seem to
silence GCC, eg:

../../src/hb-ot-shape-complex-indic-table.cc:55: warning: macro "ISC_TL" is not used [-Wunused-macros]
   55 | #define ISC_TL   INDIC_SYLLABIC_CATEGORY_TONE_LETTER                 /*    7 chars; Tone_Letter */

disable it at compiler level.
2021-04-16 13:32:02 -06:00
Behdad Esfahbod 23a28f5ad0 Avoid undefined-behavior
If a struct had (because it's a union) sizeof that is larger than the null_size,
we were providing only null_size bytes for its Null object. We know we'd never
access beyond that, but is undefined-behavior nonetheless according to the
standard.

The alternative fix would have required use of flexible-arrays, which are not
standard and have their own issues in various compiler. We've discussed that
extensively in the follow Mozilla issue (currently locked; I've asked that it
be opened):

  https://bugzilla.mozilla.org/show_bug.cgi?id=1577584

Part of
https://github.com/harfbuzz/harfbuzz/pull/2067
2021-04-16 13:23:25 -06:00
Behdad Esfahbod 499248c533 [blob] Use min_size, instead of null_size in .as<T>()
Part of https://github.com/harfbuzz/harfbuzz/pull/2067
2021-04-16 13:14:48 -06:00