Hello there,
I’m currently building an OpenType typeface for the Engsvanyáli script, as found in the ConScript Unicode Registry. Like the Arabic script, Engsvanyáli is written right-to-left, except for its numbers, which are written left-to-right. The script is used to write the Tsolyáni constructed language. All of the Engsvanyáli characters are in the primary Unicode Private Use Area (PUA) in the Basic Multilingual Plane, between U+E100 and U+E14F. Unlike Latin and Arabic characters, no character in the PUA has any inherent directionality.
To ease entry of Engsvanyáli text, the typeface has a ‘ccmp’ OpenType feature, with many rules to substitute Latin glyphs for Engsvanyáli glyphs. For example, the Tsolyáni word “ngangmuru” (“hello”) is typed with those nine Latin letters, and is rendered as seven Engsvanyáli glyphs, viz: ng.init a.comb ng.medi m.medi u.comb r.fina u.comb. [Like the Arabic script, most consonants in the Engsvanyáli script have four forms: init(ial), medi(al), fina(l), and isol(ated). Its vowels have two forms, init(ial) and comb(ining marks for non-initial). For a given Engsvanyáli consonant, the same PUA character is used to represent all of its forms.]
Since PUA characters do not have inherent directionality, neither LibreOffice’s Right-To-Left text mode (entered with ⇧⌘D on macOS) nor the insertion of the U+200F RIGHT-TO-LEFT MARK (RLM) character can be used to cause “ngangmuru” to be rendered in right-to-left order as “urumgnagn”.
However, the insertion of a U+2067 RIGHT-TO-LEFT ISOLATE (RLI), U+202B RIGHT-TO-LEFT EMBEDDING (RLE), or U+202E RIGHT-TO-LEFT OVERRIDE (RLO) character can be used to render “ngangmuru” as “urumgnagn”, depending on operating system support. [The U+2069 POP DIRECTIONAL ISOLATE (PDI) character marks the end of the right-to-left area for RLI, and U+202C POP DIRECTIONAL FORMATTING (PDF) character marks the end of the right-to-left area for both RLE and RLO.]
Because I use LibreOffice 6.2.8.2 on OS X 10.9 Mavericks—the latest version of each that my old computer supports—RLI and RLE are not supported, but RLO is. When I type “ngangmuru” in a Latin typeface, and change the typeface to the Engsvanyáli one, the Engsvanyáli glyphs are faithfully rendered, but in left-to-right order, since the underlying characters are Latin. When I type “ngangmuru” in a Latin typeface followed by the (invisible) PDF character, and then insert the (invisible) RLO character at the beginning of the string, the text is correctly rendered as “urumgnagn”. However, when I then change the text’s typeface to the Engsvanyáli one, the Engsvanyáli glyphs are rendered incorrectly, as the nine glyphs u.init r.init u.comb m.medi g.medi n.medi a.comb g.fina n.fina.
It seems as though LibreOffice’s text parser is applying OpenType features to right-to-left Latin text in the rendering order rather than in the text’s logical order. This isn’t surprising, since a Latin typeface with a “fi” ligature would typically display e.g. the reversed word “fin” with the three glyphs n i f rather than the two glyphs n fi. However, without the ability to render reversed text in logical order, a right-to-left script in a PUA such as Engsvanyáli would be unusable in LibreOffice by entering left-to-right characters and simply changing the typeface.
Is there a way to direct LibreOffice to render right-to-left Latin text according to its logical order rather than its rendering order?