microsoft / DWriteShapePy

Python extension for streamlined DirectWrite text shaping.
MIT License
13 stars 8 forks source link

Analysis is incorrect - RTL text is backwards #7

Open simoncozens opened 2 weeks ago

simoncozens commented 2 weeks ago

DWriteShapePy doesn't seem to analyse RTL texts correctly:

PS C:\Users\simon\Desktop> python3 -m dwriteshapepy --language ar .\NNUTest.ttf -u 06cc,0679,06d2
[alefMaksura-ar.fina.alt=0+504.0|tahabove-ar=1@348.0,-389.0+0.0|behDotless-ar.init.yeh=4@0.0,375.0+204.0|nobari=0+0.0|yehbarree-ar.isol=0+1409.0]

The text should be the other way around. (06cc FARSI YEH should be in initial position, 0x6d2 YEH BARREE should be in final position)

paullinnerud commented 2 weeks ago

Yes, the initial requirements for this project did not require RTL. I don't think it would be hard to add such support though.