Pango

Revision as of 20:48, 9 May 2025 by imported>SchlurcherBot (Bot: http → https)
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Template:Short description {{#invoke:other uses|otheruses}} {{#invoke:Infobox|infobox}}Template:Template other{{#invoke:Check for unknown parameters | check | showblankpositional=1 | unknown = Template:Main other | preview = Page using Template:Infobox software with unknown parameter "_VALUE_"|ignoreblank=y | AsOf | author | background | bodystyle | caption | collapsetext | collapsible | developer | discontinued | engine | engines | genre | included with | language | language count | language footnote | latest preview date | latest preview version | latest release date | latest release version | latest_preview_date | latest_preview_version | latest_release_date | latest_release_version | licence | license | logo | logo alt | logo caption | logo upright | logo size | logo title | logo_alt | logo_caption | logo_upright | logo_size | logo_title | middleware | module | name | operating system | operating_system | other_names | platform | programming language | programming_language | released | replaced_by | replaces | repo | screenshot | screenshot alt | screenshot upright | screenshot size | screenshot title | screenshot_alt | screenshot_upright | screenshot_size | screenshot_title | service_name | size | standard | title | ver layout | website | qid }}Template:Main other

Pango (stylized as Παν語) is a text (i.e. glyph) layout engine library which works with the HarfBuzz shaping engine for displaying multi-language text.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

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.Template:Clarify

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".<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

History and namingEdit

The name pango comes from Greek pan (παν, Template:Gloss) and Japanese go (, Template:Gloss).<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

In January 2000, the merger of the GScript and GnomeText projects was named Pango.<ref>Pango - Status - 2017-11-30, Owen Taylor, Redhat</ref><ref>GNOMEs in Paris: A Report from GUADEC, The most impressive part of their presentation was the discussion on Pango (the result of the GScript and GnomeText merger), 2000/03/21, By Chuck Toporek - O'Reilly Media</ref><ref>Pango proposal, rev 0.1, Raph Levien, 28 July 1999</ref><ref>GScript - Unicode and Complex Text Processing, 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</ref><ref>Gnome-Text API documentation, Raph Levien, 10 Jul 1999, 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.</ref><ref>{{#invoke:citation/CS1|citation |CitationClass=web }} 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.</ref>

Pango version 1.0.0 was released 11 March 2002.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref><ref>GTK user interface libraries, version 2.0</ref>

Support for OpenType featuresEdit

File:Pango locl demo.png
Default rendering above, localized Romanian rendering below.

Pango 1.17 and newer support the 'Template:Not a typo' 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: <syntaxhighlight lang="bash"> for lang in en ro do

   pango-view \
       --font="Verdana 64" \
       --text "şţ vs. șț in $lang" \
       --language=$lang

done </syntaxhighlight>

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.: <syntaxhighlight lang="bash"> pango-view \

   --font="Verdana 24" \
   --markup \
   --text 'In the same text: şţ(en) and şţ(ro).'

</syntaxhighlight>

Since 1.37.1, Pango added more attributes to provide complete support for processing OpenType feature.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref><ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref><ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

The official showcase of Pango's script-aware features is here.

Major usersEdit

File:GTK+ software architecture.svg
Simplified software architecture of GTK. Pango, GDK, ATK, GIO, Cairo and GLib.

Pango has been integrated into most Linux distributions. The GTK UI toolkit uses Pango for all of its text rendering.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> The Linux versions of the Mozilla Firefox web browser and Mozilla Thunderbird mail client use Pango for text rendering.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

See alsoEdit

Template:Portal

ReferencesEdit

Template:Reflist

External linksEdit

Template:Free and open-source typography Template:Freedesktop.org