Newsletter, November 2022
Bidirectional text is eating the world

It’s seemingly been a quiet month in the Gio project. Not many patches have landed in our repos, and one might almost think that nothing was happening. However, this quiescence is actually the result of Elias and I iterating heavily on Gio’s upcoming text API. Adding both font fallback and bidirectional text support to Gio has stretched our text abstractions to the breaking point, so we’ve had to rethink them this month. That work has primarily been on the gio-patches mailing list, so you won’t have seen it unless you’re subscribed.

I waited to write this newsletter until finishing the most recent iteration of the patches. If you’d like to see what the changes look like, you can do the following in your local git clone of Gio:

curl -s https://lists.sr.ht/~eliasnaur/gio-patches/patches/37506/mbox | git am -3

I would normally just share the link to the patches on sourcehut, but it seems that the diffstat is so complex that sourcehut times out trying to render it and displays a 502 instead.

Once this work lands, Gio applications will automatically handle bidirectional text (provided that appropriate fonts are loaded). You won’t have to change your application code unless you’ve written a widget that directly manipulates a text.Shaper. If your application uses the text widgets from package widget, no change will be needed.

Sponsorship

This month, Gio thanks the following organizations and community members for their ongoing support!

Supporting the whole team:

Supporting a maintainer:

Sponsorship money given to Gio enables Elias and I to cover the costs of running Gio’s infrastructure, to pay for some of our time spent maintaining and improving Gio, and to plan for funding significant feature work. You can support Gio by contributing on OpenCollective or GitHub Sponsors.

Changes by repo

core gio

Marko Kungla:

  • app: wayland force redraw on config change. When applying window config on runtime, it is necessary to do full redraw in order to changed config option to apply correctly. This fixes a bug where e.g window size change renders next frame in updated dimensions while native window is not scaled yet since it was waiting for stage event to apply resize. 42b2174d
  • app: add app.ID exposed to the platform.. Allow app ID to be set by linger flag -X gioui.org/app.ID=%s so that wayland can group windows, search for \({gioui.org/app.ID}.desktop file and display application name. e.g. /usr/share/applications/\){gioui.org/app.ID}.desktop ~/.local/share/applications/${appID}.desktop. a22e0f52

Elias Naur:

  • app: fix Windows IME caret positioning. Some IME editors don’t send explicit GCS_CURSORPOS messages, in which case we should assume the cursor moves to the end of the composition string. dee53b36

Chris Waldon:

  • widget: do not allow invalid utf8 in editor. This commit replaces invalid UTF8 codepoints with the replacement character when they are inserted into the editor. This ensures that the editor never moves the editing gap to an invalid location and reads its contents. 5c84cf7e

gio-x

Chris Waldon:

  • richtext: make interactive spans obey constraints. This commit fixes a bug which used the wrong copy of the gtx when laying out interactive spans, resulting in their hit areas being massively inflated. 9da08d9