Recent from talks
Nothing was collected or created yet.
Pango
View on Wikipedia
Pango name written as intended, Greek pan (παν, "all") and Japanese go (語, "language") | |
| Original authors | Owen Taylor[1] Raph Levien |
|---|---|
| Developer | Behdad Esfahbod |
| Initial release | 11 July 1999[2] |
| Stable release | 1.57.0[3] |
| Repository | |
| Written in | C |
| Operating system | Unix-like, Microsoft Windows, Other |
| Type | Software development library |
| License | LGPL |
| Website | www |
Pango (stylized as Παν語) is a text (i.e. glyph) layout engine library which works with the HarfBuzz shaping engine for displaying multi-language text.[4]
Full-function rendering of text and cross-platform support is achieved when Pango is used with platform APIs or third-party libraries, such as Uniscribe and FreeType, as text rendering backends. Pango-processed text will appear similar under different operating systems.[clarification needed]
Pango is a special-purpose library for text and not a general-purpose graphics rendering library such as Cairo, with which Pango can be used. The Cairo documentation recommends Pango be used to "render" text rather than Cairo for all but the simplest text "rendering".[5]
History and naming
[edit]The name pango comes from Greek pan (παν, 'all') and Japanese go (語, 'language').[6]
In January 2000, the merger of the GScript and GnomeText projects was named Pango.[7][8][9][10][11][12]
Support for OpenType features
[edit]
Pango 1.17 and newer support the 'locl' feature tag that allows localized glyphs to be used for the same Unicode code point. Assuming you have Verdana version 5.01 installed, which supports the 'locl' feature for the latn/ROM (Romanian) script, a quick demonstration (on Linux) is:
for lang in en ro
do
pango-view \
--font="Verdana 64" \
--text "şţ vs. șț in $lang" \
--language=$lang
done
For an explanation of the substitutions rules for Romanian, see this discussion.
Setting the locale via the POSIX environment variable, e.g. LANG=ro_RO.UTF-8 will also cause Pango to use 'locl' font feature. Finally, you can change the language on the fly in the same text using Pango markup, e.g.:
pango-view \
--font="Verdana 24" \
--markup \
--text 'In the same text: şţ(en) and <span lang="ro">şţ(ro).</span>'
Since 1.37.1, Pango added more attributes to provide complete support for processing OpenType feature.[15][16][17]
The official showcase of Pango's script-aware features is here.
Major users
[edit]
Pango has been integrated into most Linux distributions. The GTK UI toolkit uses Pango for all of its text rendering.[18] The Linux versions of the Mozilla Firefox web browser and Mozilla Thunderbird mail client use Pango for text rendering.[19]
See also
[edit]- HarfBuzz (text shaping engine which is incorporated into Pango itself but can be also used stand-alone)
- Core Text (modern multilingual text rendering engine introduced in Mac OS X 10.5)
- Graphite (multiplatform open source smart-font renderer)
- WorldScript (Old Macintosh multilingual text rendering engine)
- Typographic ligature
- Computer font
References
[edit]- ^ Interview: Red Hat's Owen Taylor on GTK+, also known for his contributions on Pango., by Eugenia Loli, 19th Dec 2003
- ^ Pango, Made version 0.2, Owen Taylor, redhat.com
- ^ "1.57.0 · GNOME / pango · GitLab". Retrieved 26 August 2025.
- ^ "Pango website". Retrieved 19 July 2025.
- ^ "Cairo: A Vector Graphics Library: text". Retrieved 27 November 2015.
- ^ "The Pango connection: Part 1". IBM. Archived from the original on 27 June 2009. Retrieved 19 July 2025.
- ^ Owen Taylor. "Pango - Status - 2017-11-30". Redhat.
- ^ Chuck Toporek (21 March 2000). "GNOMEs in Paris: A Report from GUADEC". O'Reilly Media. Archived from the original on 1 December 2017. Retrieved 19 July 2025.
The most impressive part of their presentation was the discussion on Pango (the result of the GScript and GnomeText merger)
- ^ Raph Levien (28 July 1999). "Pango proposal, rev 0.1". Retrieved 19 July 2025.
- ^ "GScript - Unicode and Complex Text Processing". Archived from the original on 15 August 2000. Retrieved 21 July 2025.
The GScript project has been merged with the GnomeText project. For information about the result, named Pango, see:https://www.pango.org If you have trouble accessing that site, there is a mirror here. By Owen Taylor
- ^ Raph Levien (10 July 1999). "Gnome-Text API documentation".
Owen Taylor is working on gscript, which has some overlap with the functions described in this interface. We're working on unifying the two api's as much as possible.
- ^ Abdin, Ali (1999). "GNOME Developer's Interview Follow-up". beast.testbit.eu. Archived from the original on 2 June 2013.
Pango (which is the code name for a merger of my Gscript project and Raph Levien's GnomeText project) is a modular set of libraries for doing layout and rendering of international text. It's a bit similar to Microsoft's Uniscript or Apple's ATSUI.
- ^ "Pango 1.0.0 released". Archived from the original on 2 April 2002. Retrieved 20 February 2013.
- ^ "GTK user interface libraries, version 2.0". Retrieved 19 July 2025.
- ^ "Overview of changes between 1.37.0 and 1.37.1". Retrieved 18 August 2015.
- ^ "Bug 738505 - Add fontfeatures support in PangoAttributes and markup". GNOME Bugzilla. Retrieved 18 August 2015.
- ^ "Font Features Land in Inkscape Trunk". Tavmjong Bah's Blog. 23 June 2015. Retrieved 18 August 2015.
- ^ "Download for GNU/Linux and Unix". gtk.org. Archived from the original on 18 August 2016. Retrieved 30 November 2017.
- ^ "Thunderbird 52.1.0 System Requirements". mozilla.org. Archived from the original on 10 May 2017. Retrieved 31 July 2017.
External links
[edit]- Official website

- Pango, an open-source Unicode text layout engine. by Owen Taylor in Twenty fifth Internationalization and unicode conference, April 2004 Archived 2020-07-06 at the Wayback Machine
- "Pango: internationalized text handling" Owen Taylor in Ottawa linux symposium 2001
- Pango Reference Manual
- The journey of a word: how text ends up on a page on YouTube, at linux.conf.au 2017 Simon Cozens explained the rendering of fonts
Pango
View on GrokipediaHistory
Origins and Early Development
The unification of the GScript project, which focused on script-specific text shaping for complex scripts, and the GnomeText project, which handled basic text rendering, was proposed in 1999, with the merger occurring in January 2000. This unification was proposed to meet the growing internationalization requirements of the GNOME desktop environment, enabling better support for multilingual text handling in open-source applications.[6] The original authors of Pango were Owen Taylor, a developer at Red Hat, and Raph Levien, who drafted the initial unification proposal. Ongoing development and maintenance have been led by Behdad Esfahbod, who has contributed significantly to its evolution as a core component of GNOME's text rendering infrastructure.[3] Pango was first released in 1999 as an open-source C library licensed under the LGPL, targeted primarily at Unix-like systems. Its early goals centered on providing a modular framework for the layout and rendering of internationalized text, with robust support for Unicode encoding and complex writing systems such as those involving right-to-left directionality or contextual glyph shaping.[7][8]Key Milestones and Releases
The name Pango originated in January 2000 from the merger of the GScript and GnomeText projects, derived from the Greek "pan" (παν, meaning "all") and Japanese "go" (語, meaning "language"), stylized as Παν語 to emphasize its support for multilingual text rendering. Pango achieved its first stable release with version 1.0.0 on March 8, 2002, establishing a reliable API for internationalized text layout and rendering that became foundational for GTK+ applications.[4] In the early 2000s, Pango integrated deeply into the GNOME desktop environment, enhancing internationalization and text handling across GTK+-based software as part of GNOME's push for robust Unicode support.[9] A significant evolution occurred with the adoption of HarfBuzz as the default text shaper; initial integration began in version 1.13.0 released on April 23, 2006, by moving OpenType Layout code to HarfBuzz, with full platform-wide adoption in version 1.44.0 on July 27, 2019, replacing FreeType dependencies for font loading and metrics.[10][11][12] Ongoing maintenance is led by the GNOME community through its GitLab repository, with substantial contributions from Red Hat engineers focusing on stability, security, and cross-platform compatibility.[2][13] The latest stable release, version 1.57.0 on August 25, 2025, includes bug fixes for Core Text rendering, Windows performance optimizations, and added macOS Cocoa windowing support in the pango-view tool, alongside cleanup of legacy code for improved cross-platform portability.[12]Architecture
Core Components
Pango's core engine serves as the foundational layer of the library, providing a public API for text processing and rendering while maintaining a backend-agnostic design. This engine orchestrates the transformation of input text into rendered output through stages such as itemization, shaping, and positioning, utilizing structures like PangoGlyphInfo to store glyph-level details including geometry and visual attributes.[14] The driver logic within the core facilitates modular pipelines, allowing integration with various shaping and font systems without tying to specific rendering implementations.[15] At the heart of Pango's high-level functionality is the PangoLayout object, which handles the layout and analysis of entire text blocks, such as paragraphs. Initialized with a PangoContext, UTF-8 encoded text, and optional attributes, PangoLayout performs tasks like line breaking, alignment, justification, and ellipsization, enabling applications to query metrics such as ink extents and glyph positions for interactive use cases.[16] This object abstracts complex text processing, converting logical character positions to visual glyph arrangements while supporting bidirectional text and varying script requirements.[7] The attribute system in Pango enables fine-grained control over text appearance and behavior through structures like PangoAttrList, which manages lists of attributes applicable to specific text ranges. These attributes encompass font variations (such as family, style, and size), colors, underlines, and language tags, allowing overlapping specifications for rich text formatting.[17] PangoAttrList integrates seamlessly with PangoLayout, where attributes influence itemization and shaping processes to ensure contextually appropriate rendering.[7] Pango's modular design emphasizes Unicode conformance and robust handling of diverse writing systems, decoupling layout logic from rendering details to support global internationalization. By processing text in UTF-8 and leveraging Unicode properties for script detection and bidirectional resolution, the core components facilitate support for scripts ranging from Latin to complex Indic and right-to-left systems like Arabic.[15] This architecture promotes extensibility, with the core engine providing hooks for language-specific modules while prioritizing universal text analysis.[7]Rendering Backends and Modules
Pango utilizes platform-specific rendering backends to interface with native graphics systems, enabling efficient text rasterization and display across diverse operating environments. These backends abstract low-level font handling and output, allowing the core layout engine to remain platform-agnostic while leveraging system optimizations for performance and quality.[8] The PangoFT2 backend targets Linux and Unix-like systems, integrating FreeType for font rasterization and fontconfig for system-wide font discovery and selection. This combination supports high-fidelity rendering of complex scripts and variable fonts, making it the default choice for open-source desktop environments like GNOME.[18][19] For Windows platforms, the PangoWin32 backend accesses native fonts through the GDI API for traditional rendering, while supporting DirectWrite in modern implementations to provide subpixel antialiasing, OpenType layout features, and improved handling of international text. This dual approach ensures compatibility with legacy and contemporary Windows versions.[20][21] On macOS, the PangoCoreText backend relies on Apple's Core Text framework for font management and rendering, utilizing system-native APIs to achieve precise glyph positioning, color font support, and integration with AppKit or Quartz. This backend optimizes text output for Apple Silicon and Intel architectures alike.[22][23] Pango's integration with the Cairo graphics library enables versatile output beyond direct display, such as generating PDF documents, SVG vectors, or in-memory image buffers via PangoCairo functions that draw layouts onto Cairo surfaces. This abstraction layer supports cross-platform consistency in non-interactive rendering scenarios.[24] Font map and engine modules form the backbone of Pango's rendering pipeline, with font maps aggregating available fonts for selection based on language and style requirements, and engine modules overseeing rasterization and script-specific processing. These components ensure scalable font handling without tight coupling to specific backends.[25][26] Pango facilitates client-side rendering on X11 via the PangoXft backend, which uses Xft for antialiased fonts and direct Xlib integration, and on Wayland, where applications render text off-screen using Cairo-backed buffers before submitting them to the compositor for composition. This approach aligns with Wayland's client-driven model, avoiding server-side drawing.[27][28]Features
Text Shaping and Layout
Pango's text layout process begins with itemization, where input text is divided into segments based on script, language, and direction, followed by shaping and positioning to arrange glyphs appropriately for display. This includes handling bidirectional text using the Unicode Bidirectional Algorithm to support left-to-right (LTR) and right-to-left (RTL) scripts such as English and Arabic, respectively, with automatic direction detection and explicit overrides via context settings. Line breaking is performed according to script-specific rules, considering hyphenation and wrap modes to fit text within specified widths, while justification stretches spaces or adjusts glyph spacing to align lines evenly, including options for the last line in paragraphs.[29][16] For complex scripts requiring advanced glyph arrangement, Pango integrates with the HarfBuzz shaping engine, which has served as the default shaper since version 1.44 in 2019, processing OpenType layout tables like GSUB for glyph substitutions and GPOS for positioning adjustments. This enables accurate rendering of scripts such as Arabic, where cursive connections and contextual forms are essential, and Devanagari, involving consonant clusters and vowel matras. The integration ensures consistent handling across platforms, replacing earlier engine-specific implementations for improved reliability in internationalized environments. Recent versions, such as 1.57.0 (August 2025), have further enhanced this with full Unicode 16 compatibility.[1][30][12] Pango emphasizes internationalization by supporting vertical writing systems common in East Asian languages, such as Japanese and Chinese, through gravity settings that rotate glyphs 90 degrees counterclockwise and manage mixed horizontal-vertical layouts without disrupting bidirectional flow. This capability, introduced in version 1.16, allows for proper orientation of punctuation and symbols in vertical contexts. Overall, Pango accommodates virtually all major world scripts via its modular design and HarfBuzz backend, facilitating layout for diverse linguistic requirements from Latin to Indic and Southeast Asian systems.[29][31] In glyph clustering and positioning, Pango groups multiple Unicode characters into logical clusters to preserve editing boundaries, particularly in scripts where intra-cluster reordering is prohibited, such as Thai. Positioning accounts for ligatures by substituting multiple glyphs with a single composite form where supported by the font, applies kerning to fine-tune inter-glyph spacing based on pairwise adjustments, and ensures mark attachment by aligning diacritics and combining characters precisely over base glyphs using attachment points defined in OpenType tables. These operations occur during the shaping phase without dependency on specific rendering backends, yielding a PangoGlyphString that represents the final arranged output.[1]Font and OpenType Support
Pango integrates OpenType font technology to enable advanced typographic features, starting with support for the 'locl' feature tag for localized forms introduced in version 1.17 in 2007. This allows for language-specific glyph substitutions, such as variant forms of characters tailored to regional orthographies, enhancing the accuracy of international text rendering.[32] Support for OpenType was significantly expanded in version 1.37.1, released in 2015, which added attributes enabling broader scripting of font features for more precise control over typographic variations across scripts. Developers can now apply these enhancements to handle complex glyph positioning and substitutions dynamically during layout. Recent releases like 1.57.0 (August 2025) have added support for additional features such as petite caps.[12] The PangoAttrFontFeatures API, available since version 1.38, provides a mechanism to selectively enable specific OpenType tables, such as 'kern' for pairwise kerning adjustments, 'liga' for standard ligature formation, and 'ssXX' (where XX denotes a number) for stylistic sets that offer alternative glyph designs. This attribute accepts a string in CSS font-feature-settings syntax, allowing fine-grained customization without relying solely on default font behaviors. For instance, enabling 'liga=1' promotes the use of connected letter forms in scripts like Latin or Arabic where appropriate.[33] Pango maintains compatibility with fontconfig for discovering and matching system fonts based on criteria like family, style, and language, ensuring seamless access to installed font libraries. For rasterization, it leverages FreeType to generate glyph bitmaps and outlines, supporting high-quality rendering across various font formats including TrueType and OpenType. This integration facilitates efficient font handling in diverse environments, from desktop applications to embedded systems.[34] Pango's multi-script rendering capabilities apply OpenType features across writing systems, enabling accurate layout for languages ranging from Latin and Cyrillic to Devanagari and Han.[1]API and Usage
Programming Interfaces
Pango provides a structured set of programming interfaces that enable developers to handle text layout and rendering, ranging from low-level routines for granular control to high-level abstractions for streamlined application integration. The primary interface is implemented in C, accessible through the header filepango/pango.h, which includes functions for core operations like text itemization and glyph shaping.[8] This C API serves as the foundation, with higher-level functions building upon it to abstract complex processes into more manageable workflows.
At the high level, the API offers objects and functions such as PangoLayout, which developers can instantiate using pango_layout_new() to create a new layout context associated with a specific PangoContext. Once created, text can be set via pango_layout_set_text(), allowing the specification of the string to render along with attributes like font and language. Metrics and positioning are then retrieved through pango_layout_get_extents(), which returns ink and logical extents in Pango units (1/1024th of a point) for precise bounding box calculations. These functions facilitate rapid prototyping and integration in graphical applications by encapsulating the full layout pipeline.
For lower-level customization, Pango exposes routines like pango_itemize(), which processes input text to break it into language-specific segments called PangoItems, each containing properties such as script, language, and font metrics for subsequent processing. Following itemization, pango_shape() applies shaping algorithms—often in conjunction with HarfBuzz—to convert character clusters into positioned glyphs, enabling developers to build custom text pipelines or extend Pango's behavior for specialized rendering needs. This modular approach allows fine-grained control over internationalization features without relying on the full high-level layout system.
Pango's interfaces extend beyond C through GObject introspection, which generates dynamic bindings for various languages. In Python, bindings are provided via PyGObject, allowing seamless use of Pango functions within GTK-based applications. For JavaScript environments, GJS offers native support, integrating Pango into web and desktop GNOME extensions. Other languages, such as Rust or Vala, can leverage these bindings through introspection tools, promoting cross-language portability while maintaining compatibility with the core C API.[8]
Runtime version validation is supported by pango_version_check(), a function that takes the required major, minor, and micro version numbers as integers, returning NULL if compatible or a string describing the mismatch otherwise. This ensures applications can detect mismatches and adapt accordingly, enhancing reliability in diverse deployment environments.
Integration in Applications
Pango serves as the default text rendering engine for GTK widgets, such as GtkLabel and GtkTextView, enabling high-quality layout and display of complex scripts within graphical user interfaces.[1] This integration allows developers to leverage Pango's capabilities directly through GTK's widget system, where text properties like font family, size, and style are managed via the toolkit's theming mechanism. In particular, font settings for these widgets can be customized and themed using CSS, permitting applications to define stylesheets that influence Pango's rendering behavior, such as specifying font features compatible with OpenType syntax.[35][36] For applications outside the GTK ecosystem, Pango can be integrated via the PangoCairo library, which facilitates custom text rendering on Cairo surfaces for tasks like PDF generation or vector graphics output.[37] This approach is particularly useful in non-GTK environments, including game engines built with SDL, where libraries like SDL2_Pango bridge Pango's layout engine to SDL's rendering pipeline, supporting dynamic text display in 2D games and simulations.[38] Configuration of Pango in applications often involves environment variables to select rendering backends, such as setting PANGOCAIRO_BACKEND to "fc", "win32", or "coretext" to override the default backend for specific platforms or performance needs.[12] Additionally, Pango handles fallback fonts automatically for missing glyphs by consulting system font configurations, ensuring complete Unicode coverage without application-level intervention in most cases; this can be fine-tuned using attributes like pango_attr_fallback_new to disable or control fallback behavior.[39] In text editing applications, Pango supports bidirectional input and precise caret positioning, essential for internationalization (i18n)-aware editors handling languages like Arabic or Hebrew. Functions such as pango_layout_move_cursor_visually compute logical cursor movements across bidirectional boundaries, while Pango's layout engine resolves text directionality to maintain accurate visual editing flows.[29][40] This enables seamless input method integration, allowing users to compose and edit mixed-direction text in widgets or custom editors.Adoption
Major Users
Pango serves as a foundational text rendering library within the GNOME desktop environment, powering key applications such as GNOME Text Editor for document editing and Nautilus for file management interfaces.[3] These tools leverage Pango through the GTK framework to handle complex text layout and internationalization requirements essential to the GNOME ecosystem.[1] On Linux, Mozilla's Firefox web browser and Thunderbird email client use Pango via the GTK framework for rendering their user interfaces, while utilizing HarfBuzz for text shaping in web content and emails to ensure proper display across diverse languages and scripts.[41] Beyond GNOME and Mozilla, Pango supports specialized creative software, including Inkscape, where it facilitates internationalized text layout in vector graphics editing.[42] Similarly, GIMP utilizes Pango for accurate text layer rendering in image manipulation tasks.[43] LibreOffice incorporates Pango partially, particularly for UI elements on Linux via GTK integration, complementing its internal document rendering systems.[44] Additionally, WebKitGTK, the web rendering engine for GNOME applications like Epiphany, uses Pango for text layout and rendering.[45] Pango's development is driven by the GNOME project, with substantial maintenance and enhancements from Red Hat engineers, alongside contributions from a worldwide community of open-source developers.[13][46] This collaborative effort underscores Pango's role as a robust, widely adopted component in cross-platform text handling.Platform and Distribution Support
Pango supports a range of operating systems, including Unix-like systems such as Linux and BSD variants, where it leverages FreeType for font rendering and FontConfig for font management, often integrated with Xft for X11-based environments.[8][2] On Microsoft Windows, Pango utilizes native fonts through the Win32 API or falls back to FreeType, with rendering handled via Cairo or direct Win32 calls, enabling compatibility through ports like MSYS2, vcpkg, or bundled GTK installers.[8][2][47] For macOS, it employs CoreText for native font handling and Cairo for rendering, with installation available via Homebrew or Xcode tools.[8][2][48] In Linux distributions, Pango is widely pre-installed and packaged as libpango-1.0-0 or similar, ensuring seamless availability; for instance, it is included by default in Ubuntu, Fedora, and Debian repositories, facilitating easy dependency resolution via package managers like apt or dnf.[49][50] On Windows, integration occurs through development tools like vcpkg for C++ projects, while macOS users rely on Homebrew for straightforward installation and updates.[47][48] Cross-platform deployment of Pango faces challenges in maintaining rendering consistency, particularly with font fallback mechanisms that vary by operating system—such as differences in how FreeType on Linux handles glyph substitution compared to CoreText on macOS or Uniscribe on Windows—potentially leading to visual discrepancies in international text layout.[51] Recent versions, including 1.57.0 (released September 2025), have introduced enhancements to backend modules for better modularity, though platform-specific font querying remains a point of complexity.[52][8] Pango's licensing under the GNU Lesser General Public License (LGPL) version 2.1 or later permits its use in proprietary software through both dynamic and static linking, provided that the library itself can be replaced or modified by users without altering the main application code.[8][2] This flexibility supports broad adoption across commercial and open-source ecosystems while ensuring compliance with open-source principles.References
- https://wiki.inkscape.org/wiki/Text_Rendering_Notes