Post

Replies

Boosts

Views

Activity

Reply to Text right-to-left direction with mathematical text
ok, this looks a bit better. I now do it only on operations and stuff the result into a HStack: HStack { ForEach(elements) { item in textFromElement(element: item).flipsForRightToLeftLayoutDirection(item.type == .OPERATION) } } } The result looks a bit nearer to what I want: Now I have to make a distinction between operators that have to be mirrored (parentheses, arithmetic operatiors...) and operators that show arabic text and hve to stay how they are.... I am not sure if that really is the best solution, but it may produce some acceptable result in the end.
3w
Reply to Text right-to-left direction with mathematical text
Ah well, found something... I had to explicitly add .flipsForRightToLeftLayoutDirection(true) to the "baked" Text at the end. That is func makeText(stuff) -> Text { result: Text = Text("") + Text(number) - Text(op) + ... + Text(...) return result ... GridRow { makeText(stuff).font(...).flipsForRightToLeftLayoutDirection(true) ... and the result looks different. now two consecutive Text items in arabic are put in the wrong order and arabic text and numbers are going the wrong way. So this is mainly useful for mirroring, with the parentheses and such
3w