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

Rendering Arabic ligatures without processing #38

Open
minzhang2 opened this issue Nov 19, 2020 · 10 comments
Open

Rendering Arabic ligatures without processing #38

minzhang2 opened this issue Nov 19, 2020 · 10 comments

Comments

@minzhang2
Copy link

minzhang2 commented Nov 19, 2020

I needed to render Arabic and found that the ligatures were not processed, so I introduced HarfBuzz and used it according to the instructions, but it didn’t work.
image
I want this
image

@photopea
Copy link
Owner

Hi, when you call shapeHB(), do you set the third parameter "ltr" to "false"?

@minzhang2
Copy link
Author

No, the default value is "undefined", i do not think need to set "false"

@photopea
Copy link
Owner

Can you send me your font, please?

@minzhang2
Copy link
Author

minzhang2 commented Nov 19, 2020

NotoSans-Bold.ttf
font.zip

@photopea
Copy link
Owner

That is really strange. If you replace your font with DejaVu Sans (https://www.fontsquirrel.com/fonts/dejavu-sans) and keep your code without change, it is rendered correctly. I will have to look into it.

@minzhang2
Copy link
Author

I tried, and it was amazing

@photopea
Copy link
Owner

@minzhang2 turns out your font has some old shaping mechanism. Could you use the latest font instead? Officially, you are supposed to use this font: https://github.com/googlefonts/noto-fonts/blob/master/hinted/ttf/NotoSansArabic/NotoSansArabic-Bold.ttf

@minzhang2
Copy link
Author

I use fabricjs is ok,I don't understand why

@photopea
Copy link
Owner

In fabric JS, the text is rendered by a web browser (which supports old shaping mechanisms). Just replace your TTF file with the newer on.e

@minzhang2
Copy link
Author

ok, very thanks

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

2 participants