Open Collective
Open Collective
Loading

Font Fallback has been archived.

Font Fallback has been archived and is no longer active.

Font Fallback

PROJECT
Part of: Gio

Enabling Gio's text shaping, line wrapping, and glyph rendering to support mixed fonts.

About


Summary


Gio is starting a fundraising project to enable Chris Waldon to add font fallback to the current text shaping stack. You can help Gio gain this important feature by contributing to this project.

Plato Team Inc is supporting the addition of font fallback features to Gio. The funds gathered for this initiative will be used later to support additional enhancements to Gio.


Context


Gio's text shaping stack has evolved a lot since Gio's public release, but it has a long way yet to go. You may have noticed that trying to display strings containing characters from multiple languages (or emoji) will display little rectangles in place of the characters not present in the string's primary language. This is due to a lack of a feature called "font fallback."

What is font fallback?


Font fallback is a preprocessing step in text shaping. It takes as input a string and a collection of fonts, and it divides the string into runs which can each be displayed with a single font.

Why don't we have font fallback?


We actually did. The old text shaper implemented a simple font fallback technique based on opentype font collection files. However, when we switched to a text shaper capable of displaying complex scripts and RTL text, we had to drop that implementation. It didn't work with the new text shaper, and the modifications to the shaper in order to support it aren't trivial. We decided it was better to gain support for complex scripts/RTL and do the fallback work later.

What does it take to add font fallback?


The line wrapping algorithm currently accepts a single run of shaped text and divides it into lines based on the available space. This will need to change to accept an arbitrary number of runs of shaped text (each potentially in a different font). This changes a basic assumption of the algorithm, and will require substantial testing (extending the tests here) to ensure that the modification preserves the other important properties of the line-wrapper (like correct output for both RTL and LTR).

Once the line wrapper can handle the new input, Gio's glyph to path logic (converts the results of shaping text into a Gio clip path describing the font glyphs) will need to be updated to be able to consume sequences of glyphs from mixed fonts. Right now the implementation assumes that a single, constant font will be used for an entire line of text.

Additionally, there are pre-processing steps that will need to be added immediately before shaping text to divide the text by font glyph coverage into separate runs.

Proposal


Chris Waldon (author of the code that needs to change) will implement font fallback for Gio, but needs some financial support to take on the project. To support Chris in this effort, we aim to raise $2000 (USD). The Gio project will allocate $1000 (USD) of funds already gathered in OpenCollective to this effort, and invites the community to contribute towards the implementation of this feature in an OpenCollective Project. Chris will begin work once the funds are raised, and will not accept the funds until the feature is merged.

Chris is doing the work for font fallback now. Keep your eyes on the mailing list for relevant patches in the near future.

FAQ


  1. After this change, can I render emoji?
    • This change will enable single-color emoji like [Noto Emoji Monochrome](https://fonts.google.com/noto/specimen/Noto+Emoji) to work within your strings, assuming you've loaded such a font. Support for rendering colored font glyphs is separate, and would be required for color emoji fonts.
  2. After this change, can I render bidirectional text (LTR text containing RTL or vice versa)?
    • No, but this is a prerequisite to enabling bidi text layout.
  3. After this change, can I render text containing multiple styles (italics, bold, etc)?
    • This change will enable the text shaper to handle this situation, but will not design and implement a public API for describing styled subregions of text. However, adding such an API later is much easier than implementing font fallback.
  4. Why does Gio want to raise money to implement this? The project has only ever done one feature bounty, and the rest of the work on Gio has been free.
    • This isn't actually true. Elias, Chris, and a number of others are often paid to add features to Gio. Not every feature was implemented for money, but major projects like RTL support, Accessibility on Android, and others were funded by companies building with Gio.
    • Some members of the Gio community do support the project financially, that money either goes towards supporting Gio's continuous maintenance cost (Chris and Elias need to spend time maintaining, reviewing patches, responding to communications, etc) or is stored in our OpenCollective for funding future work like this. The $1000 dollars that Gio plans to allocate towards this come from that existing support. We can simply wait until the community support we currently have raises another $1000, but this will take a while.

Budget


Transparent and open finances.

View all transactions

Debit from Font Fallback to Gio

-$1,129.05USD
Completed
Balance transfer

Credit from Thomas to Font Fallback

+$100.00USD
Completed
Contribution #572554

Credit from Incognito to Font Fallback

+$50.00USD
Completed
Contribution #572512
$
Today’s balance

--.-- USD

Total raised

$1,129.05 USD

Total disbursed

$1,129.05 USD

Estimated annual budget

--.-- USD

Contributors


Font Fallback is all of us

Our contributors 3

Thank you for supporting Font Fallback.

Gio

$1,000 USD

Thomas

$100 USD

Incognito

$50 USD