HarfBuzz

From Wikipedia, the free encyclopedia

Template:Short description Template:DMCA

Page Module:Infobox/styles.css has no content.

HarfBuzz
[[Programmer|Original authorTemplate:Pluralize from text]]The FreeType Project
[[Programmer|DeveloperTemplate:Pluralize from text]]Behdad Esfahbod, Khaled Hosny[1]
Template:Infobox software/simple
Written inC++
Operating systemUnix-like, Windows, OpenHarmony
TypeSoftware development library
LicenseMIT
Websiteharfbuzz.github.io
Repositorygithub.com/harfbuzz/harfbuzz

Script error: No such module "Check for conflicting parameters".

HarfBuzz (loose transliteration of Persian calque Script error: No such module "Lang". harf-bāz, literally "open type")[2][3] is an open-source text shaping engine written in C++. Text shaping is the process of converting a sequence of Unicode code points into the correct glyph identifiers and precise positions needed to render text on screen or in print. For scripts where characters change shape depending on their neighbours (such as Arabic, Devanagari, or Tamil), text shaping ensures that the right glyph forms are selected and joined correctly. Without it, text renderers would display raw disconnected code points rather than readable words.

HarfBuzz takes a string of Unicode text, a font file, and information about the writing script and language as input. It returns a list of glyph IDs and their x/y positions, which a rendering engine such as Cairo or Skia then uses to draw the text. The library supports multiple font technologies, including OpenType, Apple Advanced Typography (AAT), and SIL Graphite.

The project originated in the FreeType codebase and went through several development phases before Behdad Esfahbod rewrote it from scratch around 2012. It is now used by major operating systems, browsers, and desktop toolkits worldwide.[2]

History

HarfBuzz evolved from shaping code that was originally part of the FreeType project. That code was forked separately into both Qt and Pango, leaving two diverging implementations. The two forks were eventually merged back into a shared repository under an MIT license, forming what is now called Old HarfBuzz. Old HarfBuzz supported only OpenType fonts and is no longer maintained.[2]

Around 2010–2012, Behdad Esfahbod rewrote the library from scratch in C++, producing New HarfBuzz. The rewrite discarded the old architecture and was designed from the outset to support multiple font technologies and complex script shaping rules. In 2013, Esfahbod received the O'Reilly Open Source Award for his work on HarfBuzz.[4] The same year, Android adopted HarfBuzz as its text shaping engine, bringing the library to hundreds of millions of devices.[2]

Over the following years, the library's script and font format coverage grew. Early releases added SIL Graphite support, and the 1.0 release in 2015 incorporated the Universal Shaping Engine, a generalised shaping model developed by Microsoft that covers dozens of scripts not individually defined in the OpenType specification.[5] Subsequent work broadened the range of supported font technologies to include OpenType font variations,[6] Apple Advanced Typography shaping,[7] and colour fonts. A font subsetter API, stabilised in 2021, allows tools to produce optimised font subsets for web and embedded use.[8] In 2023, an experimental shaper was added that allows fonts to embed WebAssembly programs to handle their own shaping logic.[9]

Architecture

HarfBuzz is a C++ library with a C API. A caller provides three inputs: a buffer containing Unicode text, a font object loaded from a font file, and optional metadata about the writing script and language. HarfBuzz returns the same buffer populated with glyph IDs and x/y advance and offset values. The caller then passes those values to a drawing library to paint the glyphs.

Internally, HarfBuzz selects a shaping engine based on the font format and script:

  • The OpenType shaper handles the majority of scripts. It reads the GSUB (glyph substitution) and GPOS (glyph positioning) tables from the font and applies their rules in the order specified by the OpenType specification for each script.
  • The Universal Shaping Engine (USE) shaper covers scripts in the OpenType specification that do not have dedicated shaping logic, using a generalised finite-state model.
  • The Apple Advanced Typography (AAT) shaper reads AAT morx and kerx tables, enabling HarfBuzz to shape fonts distributed in Apple's format.
  • The SIL Graphite shaper hands off processing to the embedded Graphite engine, which evaluates rules stored inside Graphite-enabled fonts.
  • An experimental WebAssembly shaper allows a font to include a Wasm binary that takes full control of shaping for that font.

The library also includes a subsetter API that produces optimised font subsets containing only the glyphs needed for a particular document, reducing file sizes in web and embedded contexts.

Users

Most applications use HarfBuzz indirectly through a UI toolkit or text layout library that integrates it, rather than calling HarfBuzz directly. The library is used across a range of platforms, from mobile operating systems to professional desktop publishing software.

HarfBuzz is used by the UI libraries of:

HarfBuzz is used directly by many applications, including:

See also

Lua error in mw.title.lua at line 404: bad argument #2 to 'title.new' (unrecognized namespace name 'Portal').

References

Page Template:Reflist/styles.css has no content.

  1. ^ Page Module:Citation/CS1/styles.css has no content."State of Text Rendering 2024". behdad.org. Retrieved 1 May 2025.
  2. ^ a b c d e Page Module:Citation/CS1/styles.css has no content.Byfield, Bruce (19 December 2017). "HarfBuzz brings professional typography to the desktop". LWN.net.
  3. ^ Page Module:Citation/CS1/styles.css has no content."HarfBuzz". freedesktop.org.
  4. ^ Page Module:Citation/CS1/styles.css has no content."O'Reilly Open Source Awards: OSCON 2013". 26 July 2013. Archived from the original on 18 June 2015. Retrieved 25 September 2014.
  5. ^ Page Module:Citation/CS1/styles.css has no content."HarfBuzz 1.0 Implements Microsoft's Universal Shaping Engine Released". Phoronix.
  6. ^ Page Module:Citation/CS1/styles.css has no content."HarfBuzz 1.4 Brings OpenType GX / Font Variations". Phoronix.
  7. ^ Page Module:Citation/CS1/styles.css has no content."HarfBuzz 2.0 Released For Advancing Open-Source Text Shaping". Phoronix.
  8. ^ Page Module:Citation/CS1/styles.css has no content."Release 3.0.0 · harfbuzz/harfbuzz". GitHub. Retrieved 26 May 2023.
  9. ^ Page Module:Citation/CS1/styles.css has no content."HarfBuzz 8.0 Released - Introduces Shaper for WebAssembly within Font Files". Phoronix.
  10. ^ Page Module:Citation/CS1/styles.css has no content."HarfBuzz". doc.dl.playstation.net. Retrieved 26 May 2019.
  11. ^ Page Module:Citation/CS1/styles.css has no content."JEP 258: HarfBuzz Font-Layout Engine". OpenJDK Enhancement Proposals. Retrieved 20 December 2017.
  12. ^ Page Module:Citation/CS1/styles.css has no content."Flutter Engine Wiki". GitHub. Retrieved 24 March 2025.
  13. ^ Page Module:Citation/CS1/styles.css has no content."Complex text layouts progress report #1". Godot Engine. Retrieved 12 September 2024.
  14. ^ Page Module:Citation/CS1/styles.css has no content."Godot 4.0 sets sail: All aboard for new horizons". Godot Engine. Retrieved 12 September 2024.
  15. ^ Page Module:Citation/CS1/styles.css has no content."Announcing Full RTL Language Support". Unity Discussions. 28 October 2024. Retrieved 18 November 2024.
  16. ^ Page Module:Citation/CS1/styles.css has no content."OpenHarmony/third_party_harfbuzz". Gitee (in 中文(中国大陆)). Retrieved 13 March 2025.
  17. ^ Page Module:Citation/CS1/styles.css has no content."LibreOffice 4.1 ReleaseNotes". The Document Foundation. 30 July 2013. Retrieved 6 October 2019.
  18. ^ Page Module:Citation/CS1/styles.css has no content."LibreOffice 5.3 Enables New Layout Engine By Default". Phoronix.
  19. ^ Page Module:Citation/CS1/styles.css has no content."Scribus 1.5.3 Released". 22 May 2017. Retrieved 6 June 2018.
  20. ^ Page Module:Citation/CS1/styles.css has no content."Unified Text Engine in Photoshop". 7 June 2022. Retrieved 25 May 2023.
  21. ^ Page Module:Citation/CS1/styles.css has no content."Feature summary of InDesign (October 2023 release)". 30 October 2023.
  22. ^ Page Module:Citation/CS1/styles.css has no content."Debugging Data Corruption with Emscripten". Figma. 7 November 2016. Retrieved 12 September 2024.
  23. ^ Page Module:Citation/CS1/styles.css has no content.Hosny, Khaled (12 March 2013). "[XeTeX] XeTeX 0.9999.0 released". TUG. Retrieved 12 September 2024.
  24. ^ Page Module:Citation/CS1/styles.css has no content.Hosny, Khaled (2013). "What is new in XeTeX 0.9999?" (PDF). TUGboat. 34 (2): 121.
  25. ^ Page Module:Citation/CS1/styles.css has no content."[Dev-luatex] Luatex 1.11.1 announcement". mailman.ntg.nl. Retrieved 12 September 2024.
  26. ^ Page Module:Citation/CS1/styles.css has no content.Hosny, Khaled (2019). "Bringing world scripts to LuaTeX: The HarfBuzz experiment" (PDF). TUGboat. 40 (1): 38–43.
  27. ^ Page Module:Citation/CS1/styles.css has no content."Middle Eastern Support in QuarkXPress 2025". www.quark.com. Retrieved 17 July 2025.

Lua error in package.lua at line 80: module 'Module:Navbox/configuration' not found. Lua error in package.lua at line 80: module 'Module:Navbox/configuration' not found.