text shaping
{{Short description|Process of converting text to glyph indices and positions}}
Text shaping is the process of converting text to glyph indices and positions as part of text rendering.{{Cite web |title=What is HarfBuzz?: HarfBuzz Manual |url=https://harfbuzz.github.io/what-is-harfbuzz.html |access-date=2024-06-23 |website=harfbuzz.github.io}} It is complementary to font rendering as part of the text rendering process; font rendering is used to generate the glyphs, and text shaping decides which glyphs to render and where they should be put on the image plane.{{Cite web |title=Shaping – Fonts Knowledge |url=https://fonts.google.com/knowledge/glossary/shaping |access-date=2024-06-23 |website=Google Fonts |language=en}} Unicode is generally used to specify the text to be rendered.
Text shaping results in substantially better results on Latin script; for some scripts with complex text layout such as Arabic script, text shaping is necessary for text to be readable at all.{{Cite web |title=Shaping – Fonts Knowledge |url=https://fonts.google.com/knowledge/glossary/shaping |access-date=2024-12-07 |website=Google Fonts |language=en}}
Most graphical user interface systems, including those in MacOS, iOS,{{Cite web |title=Language Tag Table - TrueType Reference Manual - Apple Developer |url=https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6ltag.html |access-date=2024-06-24 |website=developer.apple.com}} and Microsoft Windows have their own native text rendering engines that include text shaping. Microsoft's Uniscribe framework permits the use of pluggable shaping engines.{{Cite web |last=Karl-Bridge-Microsoft |date=2021-01-07 |title=Uniscribe - Win32 apps |url=https://learn.microsoft.com/en-us/windows/win32/intl/uniscribe |access-date=2024-06-25 |website=learn.microsoft.com |language=en-us}} Monotype's WorldType system also provides shaping functions.{{Cite web |date=2019-10-22 |title=WorldType {{!}} Monotype. |url=https://www.monotype.com/products/embedded-solutions/worldtype |access-date=2024-06-25 |website=www.monotype.com |language=en}}
In the open source world, HarfBuzz is a popular text shaping engine. According to HarfBuzz's developers, HarfBuzz is used by a range of software products including Android, Chrome, ChromeOS, Firefox, GNOME, GTK+, KDE, Qt, LibreOffice, OpenJDK, XeTeX, PlayStation, Microsoft Edge, Adobe Photoshop, Illustrator, InDesign, and Godot Engine.{{Citation |title=harfbuzz/harfbuzz |date=2024-06-23 |url=https://github.com/harfbuzz/harfbuzz |access-date=2024-06-24 |publisher=HarfBuzz}}
Text shaping engines require descriptions of shaping properties and rules packaged in a format known as a shaping model. Shaping models include OpenType Layout, Graphite, and Apple Advanced Typography.{{Cite web |title=text-shaping/docs/otl.md at main · typotheque/text-shaping |url=https://github.com/typotheque/text-shaping/blob/main/docs/otl.md |access-date=2024-06-25 |website=GitHub |language=en}}