photopea/Typr.js

Rendering Arabic ligatures without processing

minzhang2 opened this issue · 10 comments

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

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

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

Can you send me your font, please?

NotoSans-Bold.ttf
font.zip

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.

I tried, and it was amazing

@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

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

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

ok, very thanks