Closed GaetanBaehr closed 8 months ago
here the text Grtsk میتوان در بسیاری
Yes, maybe we need a writingDirection()
function or something like it. I'm not sure how this should work internally.
CoreText has support we can wrap: https://developer.apple.com/documentation/coretext/ctwritingdirection?language=objc
Can this be part of our language()
function, or do you think it's better to add a new API function?
well a writingDirection(direction)
sound good and explicit...
with direction
options:
None
-> kCTWritingDirectionNatural (also the default)"l2r"
-> kCTWritingDirectionLeftToRight"r2l"
-> kCTWritingDirectionRightToLeftIt could possible be automated related to language('ar')
but then we need to find out what the language direction is...
a quick PR is comming (no test yet)
@typemytype
It could possible be automated related to language('ar') but then we need to find out what the language direction is...
It is probably best not attempted as a single language can be written in two scripts with different directionality, e.g. Uzbek. But if you wanted contemporary defaults and used only the 2-letter codes, there are not that many…
true, @MrBrezina I prefer an explicit api, no magic guessing
In Drawbot if the Arabic text starts with a Latin word, the Latin word appears at the wrong place, here on the left, but it should be on the right.
In text edit at first it behave the same
but if we change the writing direction to right to left, then the text is correct
As far as I know, in Drawbot looks to be impossible to change the writing direction.