Skip to content

Commit

Permalink
Update Harfbuzz to version 6.0.0
Browse files Browse the repository at this point in the history
Note: This requires an update to the tst_qtextlayout test, because
the test assumed that the Arabic string would always yield a run
of two glyphs. This was a side effect of how Harfbuzz handled
Qt's test font, which has zero font tables and cannot be used for
shaping. With the Harfbuzz update, the Arabic text here yields a
single cluster instead, which actually makes more sense, so the
test has been made a bit more robust to support both cases.

Pick-to: 6.2 6.5
Task-number: QTBUG-110338
Change-Id: I93d4cf8e3046dc93224e144d4c81d86bef4918d1
Reviewed-by: Lars Knoll <[email protected]>
Reviewed-by: Volker Hilsheimer <[email protected]>
  • Loading branch information
eskilblomfeldt committed Jan 31, 2023
1 parent da898fc commit bfe080d
Show file tree
Hide file tree
Showing 294 changed files with 33,941 additions and 23,159 deletions.
43 changes: 24 additions & 19 deletions src/3rdparty/harfbuzz-ng/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,27 +137,32 @@ qt_internal_extend_target(BundledHarfbuzz CONDITION TRUE # special case
src/hb-ot-post-table.hh
src/hb-ot-post-table-v2subset.hh
src/hb-ot-shape.cc src/hb-ot-shape.h src/hb-ot-shape.hh
src/hb-ot-shape-complex-arabic.cc src/hb-ot-shape-complex-arabic.hh
src/hb-ot-shape-complex-arabic-fallback.hh
src/hb-ot-shape-complex-arabic-joining-list.hh
src/hb-ot-shape-complex-arabic-table.hh
src/hb-ot-shape-complex-default.cc
src/hb-ot-shape-complex-hangul.cc
src/hb-ot-shape-complex-hebrew.cc
src/hb-ot-shape-complex-indic.cc src/hb-ot-shape-complex-indic.hh
src/hb-ot-shape-complex-indic-machine.hh
src/hb-ot-shape-complex-indic-table.cc
src/hb-ot-shape-complex-khmer.cc
src/hb-ot-shape-complex-myanmar.cc
src/hb-ot-shape-complex-myanmar-machine.hh
src/hb-ot-shape-complex-syllabic.cc src/hb-ot-shape-complex-syllabic.hh
src/hb-ot-shape-complex-thai.cc
src/hb-ot-shape-complex-use.cc
src/hb-ot-shape-complex-use-machine.hh
src/hb-ot-shape-complex-use-table.hh
src/hb-ot-shape-complex-vowel-constraints.cc
src/hb-ot-shape-fallback.cc src/hb-ot-shape-fallback.hh
src/hb-ot-shape-normalize.cc src/hb-ot-shape-normalize.hh
src/hb-ot-shaper-arabic-fallback.hh
src/hb-ot-shaper-arabic-joining-list.hh
src/hb-ot-shaper-arabic-pua.hh
src/hb-ot-shaper-arabic-table.hh
src/hb-ot-shaper-arabic.cc src/hb-ot-shaper-arabic.hh
src/hb-ot-shaper-default.cc
src/hb-ot-shaper-hangul.cc
src/hb-ot-shaper-hebrew.cc
src/hb-ot-shaper-indic-machine.hh
src/hb-ot-shaper-indic-table.cc
src/hb-ot-shaper-indic.cc src/hb-ot-shaper-indic.hh
src/hb-ot-shaper-khmer-machine.hh
src/hb-ot-shaper-khmer.cc
src/hb-ot-shaper-myanmar-machine.hh
src/hb-ot-shaper-myanmar.cc
src/hb-ot-shaper-syllabic.cc src/hb-ot-shaper-syllabic.hh
src/hb-ot-shaper-thai.cc
src/hb-ot-shaper-use-machine.hh
src/hb-ot-shaper-use-table.hh
src/hb-ot-shaper-use.cc
src/hb-ot-shaper-vowel-constraints.cc
src/hb-ot-shaper-vowel-constraints.hh
src/hb-ot-shaper.hh
src/hb-subset-accelerator.hh
src/hb-ot-tag.cc
src/hb-ot-var.cc src/hb-ot-var.h
src/hb-ot-var-common.hh
Expand Down
230 changes: 230 additions & 0 deletions src/3rdparty/harfbuzz-ng/NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,233 @@
Overview of changes leading to 6.0.0
Friday, December 16, 2022
====================================
- A new API have been added to pre-process the face and speed up future
subsetting operations on that face. Provides up to a 95% reduction in
subsetting times when the same face is subset more than once.

For more details and benchmarks, see:
https://github.com/harfbuzz/harfbuzz/blob/main/docs/subset-preprocessing.md

(Garret Rieger, Behdad Esfahbod)

- Shaping have been speedup by skipping entire lookups when the buffer contents
don't intersect with the lookup. Shows up to a 10% speedup in shaping some
fonts. (Behdad Esfahbod)

- A new experimental feature, “Variable Composites” (enabled by passing
-Dexperimental_api=true to meson), is also featured in this release.
This technology enables drastic compression of fonts in the Chinese,
Japanese, Korean, and other writing systems, by reusing the OpenType Font
Variations technology for encoding “smart components” into the font.

The specification for these extensions to the font format can be found in:
https://github.com/harfbuzz/boring-expansion-spec/blob/glyf1/glyf1.md

A test variable-font with ~7160 Hangul syllables derived from the
NotoSerifKR-VF font has been built, with existing OpenType technology, as
well as with the new Variable Composites (VarComposites) technology. The
VarComposites font is over 90% smaller than the OpenType version of the font!
Both fonts can be obtained from the “smarties” repository:
https://github.com/behdad/smarties/tree/3.0/fonts/hangul/serif

When building HarfBuzz with experimental features enabled, you can test
the “smarties” font with a sample character like this:

$ hb-view butchered-hangul-serif-smarties-variable.ttf -u AE01 --variations=wght=700

(Behdad Esfahbod)

- The HarfBuzz subsetter can now drop axes by pinning them to specific values
(also referred to as instancing). There are a couple of restrictions
currently:

- Only works with TrueType (“glyf”) based fonts. “CFF2” fonts are not yet
supported.
- Only supports the case where all axes in a font are pinned.

(Garret Rieger, Qunxin Liu)

- Miscellaneous fixes and improvements.

(Behdad Esfahbod, Christoph Reiter, David Corbett, Eli Schwartz, Garret
Rieger, Joel Auterson, Jordan Petridis, Khaled Hosny, Lorenz Wildberg,
Marco Rebhan, Martin Storsjö, Matthias Clasen, Qunxin Liu, Satadru Pramanik)


- New API
+hb_subset_input_pin_axis_location()
+hb_subset_input_pin_axis_to_default()
+hb_subset_preprocess()


Overview of changes leading to 5.3.1
Wednesday, October 19, 2022
====================================
- Subsetter repacker fixes. (Garret Rieger)
- Adjust Grapheme clusters for Katakana voiced sound marks. (Behdad Esfahbod)
- New “hb-subset” option “--preprocess-face”. (Garret Rieger)


Overview of changes leading to 5.3.0
Saturday, October 8, 2022
"Women, Life, Freedom" #MahsaAmini
====================================
- Don’t add glyphs from dropped MATH or COLR tables to the subset glyphs.
(Khaled Hosny)
- Map “rlig” to appropriate AAT feature selectors. (Jonathan Kew)
- Update USE data files to latest version. (David Corbett)
- Check “CBDT” extents first before outline tables, to help with fonts that
also include an empty “glyf” table. (Khaled Hosny)
- More work towards variable font instancing in the subsetter. (Qunxin Liu)
- Subsetter repacker improvements. (Garret Rieger)
- New API:
+hb_ot_layout_lookup_get_optical_bound()
+hb_face_builder_sort_tables()


Overview of changes leading to 5.2.0
Saturday, September 17, 2022
====================================
- Fix regressions in hb-ft font functions for FT_Face’s with transformation
matrix. (Behdad Esfahbod)
- The experimental hb-repacker API now supports splitting several GPOS subtable
types when needed. (Garret Rieger)
- The HarfBuzz extensions to OpenType font format are now opt-in behind
build-time flags. (Behdad Esfahbod)
- The experimental hb-subset variable fonts instantiation API can now
instantiate more font tables and arbitrary axis locations. (Qunxin Liu)
- Unicode 15 support. (David Corbett)
- Various documentation improvements. (Behdad Esfahbod, Matthias Clasen)
- The hb-view command line tool now detects WezTerm inline images support.
(Wez Furlong)
- Fix FreeType and ICU dependency lookup with meson. (Xavier Claessens)

- New API:
+HB_SCRIPT_KAWI
+HB_SCRIPT_NAG_MUNDARI


Overview of changes leading to 5.1.0
Sunday, July 31, 2022
====================================
- More extensive buffer tracing messages. (Behdad Esfahbod)
- Fix hb-ft regression in bitmap fonts rendering. (Behdad Esfahbod)
- Support extension promotion of lookups in hb-subset-repacker. (Garret Rieger)
- A new HB_GLYPH_FLAG_SAFE_TO_INSERT_TATWEEL for scripts that use elongation
(e.g. Arabic) to signify where it is safe to insert tatweel glyph without
interrupting shaping. (Behdad Esfahbod)
- Add “--safe-to-insert-tatweel” to “hb-shape” tool. (Behdad Esfahbod)

- New API
+HB_GLYPH_FLAG_SAFE_TO_INSERT_TATWEEL
+HB_BUFFER_FLAG_PRODUCE_SAFE_TO_INSERT_TATWEEL


Overview of changes leading to 5.0.1
Saturday, July 23, 2022
====================================
- Fix version 2 “avar” table with hb-ft. (Behdad Esfahbod)


Overview of changes leading to 5.0.0
Saturday, July 23, 2022
====================================
- Support fonts with more than 65535 glyphs in “GDEF”, “GSUB”, and “GPOS”
tables. This is part of https://github.com/be-fonts/boring-expansion-spec to
extend OpenType in a backward-compatible way.
(Behdad Esfahbod, Garret Rieger)
- Complete support for more than 65535 glyphs in “glyf” table that started in
4.0.0 release. Part of boring-expansion-spec. (Behdad Esfahbod)
- Support version 2 of “avar” table. Part of boring-expansion-spec.
(Behdad Esfahbod)
- Fix mark attachment on multiple substitutions in some cases.
(Behdad Esfahbod)
- Fix application of “calt”, “rclt”, and “ccmp” features to better match
Uniscribe behaviour with some Arabic fonts. (Behdad Esfahbod)
- Improvement to interaction between multiple cursive attachments.
(Behdad Esfahbod)
- Improve multiple mark interactions in Hebrew. (Behdad Esfahbod)
- Implement language-specific forms in AAT shaping. (Behdad Esfahbod)
- Fix variation of “VORG” table. (Behdad Esfahbod)
- Support for specific script tags to be retained in the subsetter, and add
“--layout-scripts” option to “hb-subset” tool. (Garret Rieger)
- Accept space as delimiter for --features/--variations in command line tools.
- Improve subsetting of “COLR” table. (Qunxin Liu)
- Improved fuzzing coverage for ot-math API. (Frédéric Wang)
- Fix “kern” table version 2 (AAT) sanitization on 32-bit systems.
(Behdad Esfahbod)
- Allow negative glyph advances from “graphite2” shaper. (Stephan Bergmann)
- Implement loading (color) bitmap fonts with hb-ft. (Behdad Esfahbod)
- Fix regression in hb-ft when changing font size. (Behdad Esfahbod)
- Fix build on GCC < 7. (Kleis Auke Wolthuizen)
- Dynamically load dwrite.dll on windows if “directwrite” shaper is enabled.
(Luca Bacci)
- Provide a single-file harfbuzz-subset.cc file for easier alternate building
of hb-subset library, similar to harfbuzz.cc. (Khaled Hosny)

- New API
+HB_SUBSET_SETS_LAYOUT_SCRIPT_TAG
+hb_language_matches()


Overview of changes leading to 4.4.1
Wednesday, June 29, 2022
====================================
- Fix test failure with some compilers.
- Fix Telugu and Kannada kerning regression.


Overview of changes leading to 4.4.0
Monday, June 27, 2022
====================================
- Caching of variable fonts shaping, in particular when using HarfBuzz’s own
font loading functions (ot). Bringing performance of variable shaping in par
with non-variable fonts shaping. (Behdad Esfahbod)
- Caching of format 2 “Contextual Substitution” and “Chained Contexts
Substitution” lookups. Resulting in up to 20% speedup of lookup-heavy fonts
like Gulzar or Noto Nastaliq Urdu. (Behdad Esfahbod)
- Improved ANSI output from hb-view. (Behdad Esfahbod)
- Support for shaping legacy, pre-OpenType Windows 3.1-era, Arabic fonts that
relied on a fixed PUA encoding. (Khaled Hosny, Behdad Esfahbod)
- Sinhala script is now shaped by the USE shaper instead of “indic” one.
(Behdad Esfahbod, David Corbett)
- Thai shaper improvements. (David Corbett)
- hb-ot-name API supports approximate BCP-47 language matching, for example
asking for “en_US” in a font that has only “en” names will return them.
(Behdad Esfahbod)
- Optimized TrueType glyph shape loading. (Behdad Esfahbod)
- Fix subsetting of HarfBuzz faces created via hb_face_create_for_tables().
(Garret Rieger)
- Add 32 bit var store support to the subsetter. (Garret Rieger)

- New API
+HB_BUFFER_FLAG_DEFINED
+HB_BUFFER_SERIALIZE_FLAG_DEFINED
+hb_font_changed()
+hb_font_get_serial()
+hb_ft_hb_font_changed()
+hb_set_hash()
+hb_map_copy()
+hb_map_hash()


Overview of changes leading to 4.3.0
Friday, May 20, 2022
====================================
- Major speed up in loading and subsetting fonts, especially in
handling CFF table. Subsetting some fonts is now 3 times faster.
(Behdad Esfahbod, Garret Rieger)
- Speed up blending CFF2 table. (Behdad Esfahbod)
- Speed up hb_ot_tags_from_language(). (Behdad Esfahbod, David Corbett)
- Fix USE classification of U+10A38 to fix multiple marks on single Kharoshthi
base. (David Corbett)
- Fix parsing of empty CFF Index. (Behdad Esfahbod)
- Fix subsetting CPAL table with partial palette overlaps. (Garret Rieger)

- New API
+hb_map_is_equal() (Behdad Esfahbod)


Overview of changes leading to 4.2.1
Sunday, April 24, 2022
====================================
Expand Down
74 changes: 71 additions & 3 deletions src/3rdparty/harfbuzz-ng/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,94 @@
[![Codecov Code Coverage](https://codecov.io/gh/harfbuzz/harfbuzz/branch/main/graph/badge.svg)](https://codecov.io/gh/harfbuzz/harfbuzz)
[![Packaging status](https://repology.org/badge/tiny-repos/harfbuzz.svg)](https://repology.org/project/harfbuzz/versions)

This is HarfBuzz, a text shaping library.
# HarfBuzz

HarfBuzz is a text shaping engine. It primarily supports [OpenType][1], but also
[Apple Advanced Typography][2]. HarfBuzz is used in Android, Chrome,
ChromeOS, Firefox, GNOME, GTK+, KDE, LibreOffice, OpenJDK, PlayStation, Qt,
XeTeX, and other places.

For bug reports, mailing list, and other information please visit:

http://harfbuzz.org/

For license information, see [COPYING](COPYING).

## Documentation

For user manual as well as API documentation, check: https://harfbuzz.github.io

## Download

For tarball releases of HarfBuzz, look [here][3]. At the same place you
will also find Win32/Win64 binary bundles that include libharfbuzz DLL,
hb-view.exe, hb-shape.exe, and all dependencies.

The canonical source tree is available on [github][4].

The API that comes with `hb.h` will not change incompatibly. Other, peripheral,
headers are more likely to go through minor modifications, but again, we do our
best to never change API in an incompatible way. We will never break the ABI.

If you are not sure whether Pango or HarfBuzz is right for you, read [Pango vs
HarfBuzz][5].

## Development

For build information, see [BUILD.md](BUILD.md).

For custom configurations, see [CONFIG.md](CONFIG.md).

For test execution, see [TESTING.md](TESTING.md).
For testing and profiling, see [TESTING.md](TESTING.md).

Documentation: https://harfbuzz.github.io
To get a better idea of where HarfBuzz stands in the text rendering stack you
may want to read [State of Text Rendering][6], though, that document is many
years old. Here are a few presentation slides about HarfBuzz at the
Internationalization and Unicode Conference over the years:

* November 2014, [Unicode, OpenType, and HarfBuzz: Closing the Circle][7],
* October 2012, [HarfBuzz, The Free and Open Text Shaping Engine][8],
* October 2009, [HarfBuzz: the Free and Open Shaping Engine][9].

Both development and user support discussion around HarfBuzz happens on the
[github][4].

To report bugs or submit patches please use [github][4] issues and
pull-requests.

For a comparison of old vs new HarfBuzz memory consumption see [this][10].

<!--See past and upcoming [HarfBuzz Hackfests](https://freedesktop.org/wiki/Software/HarfBuzz/Hackfests/)!-->

## Name

HarfBuzz (حرف‌باز) is my Persian translation of “[OpenType][1]”,
transliterated using the Latin script. It sports a second meaning, but that
ain’t translatable.

> Background: Originally there was this font format called TrueType. People and
> companies started calling their type engines all things ending in Type:
> FreeType, CoolType, ClearType, etc. And then came OpenType, which is the
> successor of TrueType. So, for my OpenType implementation, I decided to stick
> with the concept but use the Persian translation. Which is fitting given that
> Persian is written in the Arabic script, and OpenType is an extension of
> TrueType that adds support for complex script rendering, and HarfBuzz is an
> implementation of OpenType complex text shaping.
<details>
<summary>Packaging status of HarfBuzz</summary>

[![Packaging status](https://repology.org/badge/vertical-allrepos/harfbuzz.svg?header=harfbuzz)](https://repology.org/project/harfbuzz/versions)

</details>

[1]: https://docs.microsoft.com/en-us/typography/opentype/spec/
[2]: https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6AATIntro.html
[3]: https://github.com/harfbuzz/harfbuzz/releases
[4]: https://github.com/harfbuzz/harfbuzz
[5]: http://mces.blogspot.com/2009/11/pango-vs-harfbuzz.html
[6]: http://behdad.org/text/
[7]: https://goo.gl/FSIQuC
[8]: https://goo.gl/2wSRu
[9]: http://behdad.org/download/Presentations/slippy/harfbuzz_slides.pdf
[10]: https://goo.gl/woyty
Loading

0 comments on commit bfe080d

Please sign in to comment.