You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TLDR: the problem is the font, missing a ligature info from 0627 0644 0644 0647 to FDF2
The diacritics are 0651 0670 (ARABIC SHADDA, ARABIC LETTER SUPERSCRIPT ALEF)
The input does not matter, only the rendering.
You can see the problem by visiting https://en.wikipedia.org/wiki/Allah on an Android device, and on a desktop.
Depending on the fonts on your desktop the first paragraphs there will render with or without the diacritics.
But more often than not (tried with various browsers on various OSes) it is rendered WITH diacritics.
On Android that page is rendered without diacritics.
The font contains the proper glyph in U+FDF2 (ARABIC LIGATURE ALLAH ISOLATED FORM) and that renders properly on Android.
See the first paragraph in the "Unicode" section.
I attached a test.html file rendering trying to render 0627 0644 0644 0647 and FDF2 with NotoNaskhArabic-Regular.ttf.
Edited test.html to use the new NotoNaskhArabic-Regular#1.ttf instead of NotoNaskhArabic-Regular.ttf.
And the result is
WARNING 1: No opinion if Allah must always be written with diacritics or not.
Looks like it should be, but I don't speak / read / write Arabic.
So I defer to native speakers.
I only tackled the technical part.
WARNING 2: I don't claim that this is the right fix.
I only know enough about fonts to be dangerous :-)
It might be that the proper fix requires a new <Lookup> element. Or a new <LigatureSubst> or a new <LigatureSet>.
But I am pretty sure that cause of the bug is the font, and it is a missing ligature mapping.
After all, the Unicode Decomposition Mapping (dm) for U+FDF2 is <isolated> 0627 0644 0644 0647
WARNING 3: It might be good to check that other very useful Arabic ligatures also have GSUB entries.
Probably the Unicode ligatures that already exist in the NotoNaskhArabic font:
As for the other ligatures mentioned, these are all legacy ligatures and the Unicode decomposition is a compatibility decomposition, which is a weak form of equivalence in Unicode and should not be generally taken as true equivalence (i.e. the decomposed sequence should not be mapped to the composed form automatically).
Internally b/386702135 was reported, so I'm upcycling this here.
Font
NotoNaskhArabic-Regular.ttf
Where the font came from, and when
AOSP, and GF API
Issue
@mihnita investigated this and said:
TLDR: the problem is the font, missing a ligature info from
0627 0644 0644 0647
toFDF2
The diacritics are
0651 0670
(ARABIC SHADDA, ARABIC LETTER SUPERSCRIPT ALEF)The input does not matter, only the rendering.
You can see the problem by visiting https://en.wikipedia.org/wiki/Allah on an Android device, and on a desktop.
Depending on the fonts on your desktop the first paragraphs there will render with or without the diacritics.
But more often than not (tried with various browsers on various OSes) it is rendered WITH diacritics.
On Android that page is rendered without diacritics.
The font contains the proper glyph in
U+FDF2
(ARABIC LIGATURE ALLAH ISOLATED FORM) and that renders properly on Android.See the first paragraph in the "Unicode" section.
I attached a
test.html
file rendering trying to render0627 0644 0644 0647
andFDF2
withNotoNaskhArabic-Regular.ttf
.Download the attached
test.html
, download and unzip the font from https://fonts.google.com/noto/specimen/Noto+Naskh+Arabic, and copy theNotoNaskhArabic-Regular.ttf
file from the zip in the same folder withtest.html
.I patched the font using the Python library
fonttools
I edited the
NotoNaskhArabic-Regular.G_S_U_B_.ttx
file and found (at line 2610) the following entry:and I added entries for the sequences without diacritics:
Rebuilt the font:
Edited
test.html
to use the newNotoNaskhArabic-Regular#1.ttf
instead ofNotoNaskhArabic-Regular.ttf
.And the result is
WARNING 1: No opinion if Allah must always be written with diacritics or not.
Looks like it should be, but I don't speak / read / write Arabic.
So I defer to native speakers.
I only tackled the technical part.
WARNING 2: I don't claim that this is the right fix.
I only know enough about fonts to be dangerous :-)
It might be that the proper fix requires a new
<Lookup>
element. Or a new<LigatureSubst>
or a new<LigatureSet>
.But I am pretty sure that cause of the bug is the font, and it is a missing ligature mapping.
After all, the Unicode Decomposition Mapping (dm) for
U+FDF2
is<isolated> 0627 0644 0644 0647
WARNING 3: It might be good to check that other very useful Arabic ligatures also have GSUB entries.
Probably the Unicode ligatures that already exist in the NotoNaskhArabic font:
The text was updated successfully, but these errors were encountered: