two
October 17, 2026, 12:36pm
1
there are bugs like RTL file names cause LTR message text to be broken into disconnected pieces in dialog and toast messages (#4217) · Issues · GNOME / Files · GitLab when adding text of different directions, in html this bug would be solved by <bdi></bdi> or <span dir=auto>, but how would it in pango ?
in Pango.AttrType there seems to not be anything like DIRECTION
there was a post before, but it didnt answer the original question
I think you may be in a similar situation to librsvg, which uses Pango to draw text that comes from SVG documents. It uses Cairo but not GTK; the caller of the library passes a Cairo context to it, and the library draws everything to that cairo_t, including text with Pango.
You create a PangoLayout from a PangoContext; in the case of librsvg this is a context created from a PangoCairoFontMap. The basic codes goes like this:
Create a Pango context from a Cairo fontmap .
Set the context’s base…
federico
(Federico Mena Quintero)
October 19, 2026, 1:24am
2
Totally untested: when composing the "%s.%s" moved to wastebasket string (or however it looks), start the %s.%s part for the filename.extension with a First Strong Isolate (U+2068) character and end it with a Pop Directional Isolate (U+2069) character. This should make Pango isolate the span between the directional formatting characters.