This site has been retired. For up to date information, see handbook.gnome.org or gitlab.gnome.org.


[Home] [TitleIndex] [WordIndex

1. An Open Discussion on Architecting A Unified Text Layout Engine for FLOSS Systems

This Open Discussion is to be held at the Gnome Live! 2006 Boston Text Layout Summit. Please note that the Text Layout Summit is not Gnome-specific in any shape or form, although of course the Gnome community is participating and hosting the event. We encourage all stakeholders in the Free‍Desktop and world-wide FLOSS community to send in your suggestions and participate.

As this topic has garnered a lot of interest, a significant amount of time will be set aside for the Discussion. At the present time it is still not decided whether the Discussion will take place on Saturday or on Sunday, although some voices are suggesting devoting a significant fraction of Sunday to such a discussion. This will also permit some folks who will not be arriving until late on Saturday to participate as well.

Ed Trager has volunteered to moderate the discussion.

1.1. Background Introduction

At present, a given FLOSS-based desktop system will often have different programs using different text layout engines: many GTK-based programs, including The Gimp and Inkscape, use Pango as the text layout engine; Open‍Office.org uses IBM's ICU text layout classes; KDE programs use Qt's layout engine; while many applications use homegrown text layout engines: KOffice uses Qt's native shaping but has its own code for paragraph layout; and Scribus currently has its own code for the whole layout process but the development team is thinking about using a forked version of Qt's shaper.

Because of differences in the layout engines operating “behind the scenes”, different software can exhibit differing levels of support for complex text layout (CTL) scripts like Arabic or Kannada. Some scripts, like Myanmar, are currently hardly supported at all in the majority of software on FLOSS systems today. The situation is confusing if you are a software developer who is new to the FLOSS world. It is even more confusing if you are an end-user trying to fathom why, for example, Arabic is rendered correctly in Inkscape, shows weird rendering artifacts on the diacritics in Open‍Office, and isn't even shaped correctly at all in Scribus ­— even when using the very same Open‍Type font in all three programs.

Having multiple approaches is good in that it facilitates experimentation, but only if we then evaluate those other approaches and ensure that users have the best of several approaches.

In theory, development of a unified text layout engine, independent of any one development toolkit, would allow developers to focus first on rendering text in all modern human scripts correctly, and secondly, on doing so efficiently.

Moreover, as scripts in the Unicode Standard are revised, and as other new scripts are added to the Unicode Standard, collaboration on a unified text layout engine would guarantee that script and advanced typographical functionality would be “rolled out” in FLOSS systems in a unified manner: all software would become competent in handling new and revised scripts or advanced typographical features at the same time, instead of in the piecemeal, hit-or-miss fashion of today.

While the theoretical benefits are clear, overcoming the obstacles of differing APIs and even just thinking about all of the work that might be required to re-engineer a host of popular and rapidly maturing FLOSS software may give developers second thoughts, headaches, or both!

On the other hand, exciting developments are afoot in the world of Open Source typography that cannot be ignored. SIL's Graphite technology is maturing rapidly, even though Graphite-enabled fonts remain scarce and the technology is arguably under-utilized. Pango has recently become capable of vertical text layout. Numerous fonts for world scripts are being developed and released under Open Source licenses like the GPL and the new Open Font License (OFL) from SIL. And programs like Open‍Office, Scribus, Firefox, the Gimp, and Inkscape have become serious challengers to proprietary counterparts. Governments and other organizations around the world are taking serious interest in FLOSS systems and special initiatives such as the One Laptop Per Child (OLPC) program.

The confluence of all of these developments and more make it even more important —and more exciting— that the FLOSS community gets it right when designing the text layout engine for future FLOSS systems. Please contribute by outlining the categories and topics for discussion that are important to you and the community at large:

1.2. Topics

1.2.1. Shaper interface requirements for line-breaking

Shaping can depend in part on line-break choices —

Different responses to this:

1.2.2. Shaper interface requirements for justification

When a line contains runs of different scripts, we need to find out how much extension/shrinking opportunity there is within each run. Different opportunities have different priorities: e.g. in english text we want to space out/condense word spaces more than letter spaces. Based on http://www.w3.org/TR/css3-text/#text-justify (or the more recent draft at http://fantasai.inkedblade.net/style/specs/css3-text/scratchpad, which mentions Tibetan), it appears that deciding spacing requires knowing:

Some rules for justification of Tibetan: http://www.tug.org/pipermail/xetex/2005-April/002147.html. Mentions a "space after ga" option not mentioned by the above-referenced CSS3 draft.

Consumer Device Support

Consumer devices running FOSS software are becoming increasingly important and prevalent. Many also support network connectivity and some sort of open browsing software. With these capabilities, the need to support advanced text layout in a large number of languages becomes important. A goal of the layout engine should be to provide a small kernel of core services without extensive dependencies on external libraries. In addition in and embedded device the object api is often provided by the device software so it would be nice if this api was object ready but procedural in nature to allow direct wrapping with and externally defined api. An example of a object ready procedural api is one that accepts a user data pointer and passes it back through callbacks. Also for interfaces the structure or class implementations used by the api should be provided by the user instead of being defined internally. This api should consist of the following.

A number of assumptions could be made for example the font interface from Freetype could be adopted for the font list. The actual data structure for the font list and layout results, and line breaks should be user supplied with the api providing the base structure this allows additional implementation data to be added. Next a text file format will allow systems that don't support dynamically loaded code or don't allow unsigned dynamic code to ship with a small number of supported locales but add additional ones on demand. Glyph rendering, font management, text storage etc are handled outside the layout engine.


2024-10-23 10:59