Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reverse arabic and persian text when using writing marks #466

Open
d4rksky opened this issue Jan 30, 2021 · 5 comments
Open

reverse arabic and persian text when using writing marks #466

d4rksky opened this issue Jan 30, 2021 · 5 comments

Comments

@d4rksky
Copy link

d4rksky commented Jan 30, 2021

hi , i have problem with writing marks( ! , . , ... ) in arabic and persian text
The text is reversed when I use marks just like picture
image
Imagine I want write hello!how are you?
but it reversed it to how how are you?!hello
anyone has any idea to solve this problem tell me please .

@smaznet
Copy link

smaznet commented Jun 1, 2021

Same issue here
i fixed it in javascript by reversing words but its not good way

let text = 'سلام ؟ خوبی ؟ ❤️ چه خبرا.';
let regex = /[\u0600-\u06FF\s]+/gu;
let chars = text.match(regex);
let newText;
if (chars) {
  chars = chars.reverse();
  let splited = text.split(regex);
  newText = splited.reverse()
  .map((text, index) => chars[index]?text + " "+chars[index]:text)
  .join('');
}else {
  newText = text;
}
let paths = font.getPaths(newText)

@mstking147
Copy link

Same issue
please fix it

@ILOVEPIE
Copy link
Contributor

Are you using 1.3.4 because that version is outdated.

@mstking147
Copy link

Are you using 1.3.4 because that version is outdated.

Yes, I'm using 1.3.4
Isn't this the latest version?

@Connum
Copy link
Contributor

Connum commented Jul 7, 2024

Yes, I'm using 1.3.4 Isn't this the latest version?

See the note at https://github.com/opentypejs/opentype.js/releases/tag/1.3.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants