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

Nuqta not rendering correctly in Jameel Noori Nastaleeq #3487

Closed
TheBluuDot opened this issue Mar 18, 2022 · 3 comments · Fixed by #3489
Closed

Nuqta not rendering correctly in Jameel Noori Nastaleeq #3487

TheBluuDot opened this issue Mar 18, 2022 · 3 comments · Fixed by #3489

Comments

@TheBluuDot
Copy link
Contributor

TheBluuDot commented Mar 18, 2022

Bug

Pay attention to this dot image under the letter. Ever since harfbuzz/harfbuzz@43be5ba, Jameel Noori Nastaleeq is having this bug with the sample string میرے ڈھول جدائیاں دی تینوں خبر کیویں ہووے.

Expected behavior

image

Actual behavior

image

From mpv-player/mpv#9977 :

$ util/hb-shape "Jameel Noori Nastaleeq.ttf" 'میرے ڈھول جدائیاں دی تینوں خبر کیویں ہووے'
[.notdef280=40+1873|.notdef251=39+561|.notdef18216=37+1183|.notdef293=36+5|.notdef19365=34+1470|.notdef12797=31+1366|.notdef293=30+5|.notdef8030=27+1556|.notdef293=26+5|.notdef276=25+1228|.notdef1650=21+0|.notdef465=21@390,1635+0|.notdef459=21@630,375+0|.notdef467=21@1200,1815+0|.notdef805=21+1455|.notdef293=20+5|.notdef279=19+1116|.notdef233=18+571|.notdef293=17+5|.notdef276=16+1228|.notdef18694=13+1032|.notdef225=12+299|.notdef1651=10+0|.notdef457=10@600,75+0|.notdef1547=10+1375|.notdef293=9+5|.notdef247=8+1169|.notdef18504=6+1251|.notdef271=5+591|.notdef293=4+5|.notdef280=3+1873|.notdef16651=0+1619]

# Since 43be5ba and also on current master 49fb8f9072
$ util/hb-shape "Jameel Noori Nastaleeq.ttf" 'میرے ڈھول جدائیاں دی تینوں خبر کیویں ہووے'
[.notdef280=40+1873|.notdef251=39+561|.notdef18216=37+1183|.notdef293=36+5|.notdef19365=34+1470|.notdef12797=31+1366|.notdef293=30+5|.notdef8030=27+1556|.notdef293=26+5|.notdef276=25+1228|.notdef1650=21+0|.notdef465=21@390,1635+0|.notdef459=21@630,375+0|.notdef467=21@1200,1815+0|.notdef805=21+1455|.notdef293=20+5|.notdef279=19+1116|.notdef233=18+571|.notdef293=17+5|.notdef276=16+1228|.notdef18694=13+1032|.notdef225=12+299|.notdef1651=10+0|.notdef457=10@-270,420+0|.notdef1547=10+1375|.notdef293=9+5|.notdef247=8+1169|.notdef18504=6+1251|.notdef271=5+591|.notdef293=4+5|.notdef280=3+1873|.notdef16651=0+1619]

#Highlighting the only difference via `git diff -U0 --word-diff --word-diff-regex=. --no-index -- <
.notdef457=10@[-60-]{+-27+}0,[-75-]{+420+}+0

Sample files

Urdu Font

@jfkthame
Copy link
Collaborator

I haven't specifically debugged the testcase, but from reading through harfbuzz/harfbuzz@43be5ba, it looks like that could have changed behavior because _hb_allocate_lig_id (hb_buffer_t *buffer) no longer guarantees to return a non-zero value.

Since that change, next_serial () checks that its return value will be non-zero, but if it is a multiple of 8, the masking in _hb_allocate_lig_id will turn it into zero.

@TheBluuDot If you restore the lines

  if (unlikely (!lig_id))
    lig_id = _hb_allocate_lig_id (buffer); /* in case of overflow */

that were deleted from the _hb_allocate_lig_id function, does that make a difference?

@behdad
Copy link
Member

behdad commented Mar 18, 2022

Dropping those two lines seems unintentional.

@TheBluuDot
Copy link
Contributor Author

So I checked @jfkthame 's suggestion and restoring those two lines did indeed change the output to pre harfbuzz/harfbuzz@43be5ba behavior.

After restoring the 2 lines as suggested
$ util/hb-shape "Jameel Noori Nastaleeq.ttf" 'میرے ڈھول جدائیاں دی تینوں خبر کیویں ہووے'

[.notdef280=40+1873|.notdef251=39+561|.notdef18216=37+1183|.notdef293=36+5|.notdef19365=34+1470|.notdef12797=31+1366|.notdef293=30+5|.notdef8030=27+1556|.notdef293=26+5|.notdef276=25+1228|.notdef1650=21+0|.notdef465=21@390,1635+0|.notdef459=21@630,375+0|.notdef467=21@1200,1815+0|.notdef805=21+1455|.notdef293=20+5|.notdef279=19+1116|.notdef233=18+571|.notdef293=17+5|.notdef276=16+1228|.notdef18694=13+1032|.notdef225=12+299|.notdef1651=10+0|.notdef457=10@600,75+0|.notdef1547=10+1375|.notdef293=9+5|.notdef247=8+1169|.notdef18504=6+1251|.notdef271=5+591|.notdef293=4+5|.notdef280=3+1873|.notdef16651=0+1619]

Current master
$ util/hb-shape "Jameel Noori Nastaleeq.ttf" 'میرے ڈھول جدائیاں دی تینوں خبر کیویں ہووے'

[.notdef280=40+1873|.notdef251=39+561|.notdef18216=37+1183|.notdef293=36+5|.notdef19365=34+1470|.notdef12797=31+1366|.notdef293=30+5|.notdef8030=27+1556|.notdef293=26+5|.notdef276=25+1228|.notdef1650=21+0|.notdef465=21@390,1635+0|.notdef459=21@630,375+0|.notdef467=21@1200,1815+0|.notdef805=21+1455|.notdef293=20+5|.notdef279=19+1116|.notdef233=18+571|.notdef293=17+5|.notdef276=16+1228|.notdef18694=13+1032|.notdef225=12+299|.notdef1651=10+0|.notdef457=10@-270,420+0|.notdef1547=10+1375|.notdef293=9+5|.notdef247=8+1169|.notdef18504=6+1251|.notdef271=5+591|.notdef293=4+5|.notdef280=3+1873|.notdef16651=0+1619]


#Highlighting the only difference via `git diff -U0 --word-diff --word-diff-regex=. --no-index -- <
.notdef457=10@[-60-]{+-27+}0,[-75-]{+420+}+0

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

Successfully merging a pull request may close this issue.

3 participants