Dataset Viewer
Auto-converted to Parquet Duplicate
font
stringclasses
3 values
case
stringclasses
5 values
text
stringclasses
5 values
path
stringclasses
4 values
iou_vs_reference
float64
0.07
1
verdict
stringclasses
3 values
missing_glyphs
listlengths
0
8
glyphs_ok
bool
2 classes
SFArabic
greeting
ู…ุฑุญุจุง ุจูƒู…
raqm_plain
1
identical
[]
true
SFArabic
greeting
ู…ุฑุญุจุง ุจูƒู…
raqm_reshaped
0.223
broken
[]
true
SFArabic
greeting
ู…ุฑุญุจุง ุจูƒู…
basic_plain
0.181
broken
[]
true
SFArabic
greeting
ู…ุฑุญุจุง ุจูƒู…
basic_reshaped
0.847
recognisable
[]
true
SFArabic
sentence
ุงู„ุชุฒุงู…ู†ุง ุจุงู„ู†ุฒุงู‡ุฉ
raqm_plain
1
identical
[]
true
SFArabic
sentence
ุงู„ุชุฒุงู…ู†ุง ุจุงู„ู†ุฒุงู‡ุฉ
raqm_reshaped
0.199
broken
[]
true
SFArabic
sentence
ุงู„ุชุฒุงู…ู†ุง ุจุงู„ู†ุฒุงู‡ุฉ
basic_plain
0.11
broken
[]
true
SFArabic
sentence
ุงู„ุชุฒุงู…ู†ุง ุจุงู„ู†ุฒุงู‡ุฉ
basic_reshaped
0.814
recognisable
[]
true
SFArabic
with_digits
ููŠ ุนุงู… 2026
raqm_plain
1
identical
[ "2", "0", "6" ]
false
SFArabic
with_digits
ููŠ ุนุงู… 2026
raqm_reshaped
0.27
broken
[ "2", "0", "6" ]
false
SFArabic
with_digits
ููŠ ุนุงู… 2026
basic_plain
0.234
broken
[ "2", "0", "6" ]
false
SFArabic
with_digits
ููŠ ุนุงู… 2026
basic_reshaped
0.839
recognisable
[ "2", "0", "6" ]
false
SFArabic
mixed_latin
ุดุฑูƒุฉ Pixelogik ู„ู„ุฅู†ุชุงุฌ
raqm_plain
1
identical
[ "P", "i", "x", "e", "l", "o", "g", "k" ]
false
SFArabic
mixed_latin
ุดุฑูƒุฉ Pixelogik ู„ู„ุฅู†ุชุงุฌ
raqm_reshaped
0.677
recognisable
[ "P", "i", "x", "e", "l", "o", "g", "k" ]
false
SFArabic
mixed_latin
ุดุฑูƒุฉ Pixelogik ู„ู„ุฅู†ุชุงุฌ
basic_plain
0.559
broken
[ "P", "i", "x", "e", "l", "o", "g", "k" ]
false
SFArabic
mixed_latin
ุดุฑูƒุฉ Pixelogik ู„ู„ุฅู†ุชุงุฌ
basic_reshaped
0.853
recognisable
[ "P", "i", "x", "e", "l", "o", "g", "k" ]
false
SFArabic
diacritics
ู…ูŽุฑู’ุญูŽุจู‹ุง ุจููƒูู…ู’
raqm_plain
1
identical
[]
true
SFArabic
diacritics
ู…ูŽุฑู’ุญูŽุจู‹ุง ุจููƒูู…ู’
raqm_reshaped
0.167
broken
[]
true
SFArabic
diacritics
ู…ูŽุฑู’ุญูŽุจู‹ุง ุจููƒูู…ู’
basic_plain
0.172
broken
[]
true
SFArabic
diacritics
ู…ูŽุฑู’ุญูŽุจู‹ุง ุจููƒูู…ู’
basic_reshaped
0.345
broken
[]
true
GeezaPro
greeting
ู…ุฑุญุจุง ุจูƒู…
raqm_plain
1
identical
[]
true
GeezaPro
greeting
ู…ุฑุญุจุง ุจูƒู…
raqm_reshaped
0.252
broken
[]
true
GeezaPro
greeting
ู…ุฑุญุจุง ุจูƒู…
basic_plain
0.166
broken
[]
true
GeezaPro
greeting
ู…ุฑุญุจุง ุจูƒู…
basic_reshaped
0.763
recognisable
[]
true
GeezaPro
sentence
ุงู„ุชุฒุงู…ู†ุง ุจุงู„ู†ุฒุงู‡ุฉ
raqm_plain
1
identical
[]
true
GeezaPro
sentence
ุงู„ุชุฒุงู…ู†ุง ุจุงู„ู†ุฒุงู‡ุฉ
raqm_reshaped
0.186
broken
[]
true
GeezaPro
sentence
ุงู„ุชุฒุงู…ู†ุง ุจุงู„ู†ุฒุงู‡ุฉ
basic_plain
0.097
broken
[]
true
GeezaPro
sentence
ุงู„ุชุฒุงู…ู†ุง ุจุงู„ู†ุฒุงู‡ุฉ
basic_reshaped
0.665
recognisable
[]
true
GeezaPro
with_digits
ููŠ ุนุงู… 2026
raqm_plain
1
identical
[ "2", "0", "6" ]
false
GeezaPro
with_digits
ููŠ ุนุงู… 2026
raqm_reshaped
0.102
broken
[ "2", "0", "6" ]
false
GeezaPro
with_digits
ููŠ ุนุงู… 2026
basic_plain
0.087
broken
[ "2", "0", "6" ]
false
GeezaPro
with_digits
ููŠ ุนุงู… 2026
basic_reshaped
0.638
recognisable
[ "2", "0", "6" ]
false
GeezaPro
mixed_latin
ุดุฑูƒุฉ Pixelogik ู„ู„ุฅู†ุชุงุฌ
raqm_plain
1
identical
[ "P", "i", "x", "e", "l", "o", "g", "k" ]
false
GeezaPro
mixed_latin
ุดุฑูƒุฉ Pixelogik ู„ู„ุฅู†ุชุงุฌ
raqm_reshaped
0.27
broken
[ "P", "i", "x", "e", "l", "o", "g", "k" ]
false
GeezaPro
mixed_latin
ุดุฑูƒุฉ Pixelogik ู„ู„ุฅู†ุชุงุฌ
basic_plain
0.195
broken
[ "P", "i", "x", "e", "l", "o", "g", "k" ]
false
GeezaPro
mixed_latin
ุดุฑูƒุฉ Pixelogik ู„ู„ุฅู†ุชุงุฌ
basic_reshaped
0.4
broken
[ "P", "i", "x", "e", "l", "o", "g", "k" ]
false
GeezaPro
diacritics
ู…ูŽุฑู’ุญูŽุจู‹ุง ุจููƒูู…ู’
raqm_plain
1
identical
[]
true
GeezaPro
diacritics
ู…ูŽุฑู’ุญูŽุจู‹ุง ุจููƒูู…ู’
raqm_reshaped
0.099
broken
[]
true
GeezaPro
diacritics
ู…ูŽุฑู’ุญูŽุจู‹ุง ุจููƒูู…ู’
basic_plain
0.072
broken
[]
true
GeezaPro
diacritics
ู…ูŽุฑู’ุญูŽุจู‹ุง ุจููƒูู…ู’
basic_reshaped
0.138
broken
[]
true
IBMPlexSansArabic
greeting
ู…ุฑุญุจุง ุจูƒู…
raqm_plain
1
identical
[]
true
IBMPlexSansArabic
greeting
ู…ุฑุญุจุง ุจูƒู…
raqm_reshaped
0.167
broken
[]
true
IBMPlexSansArabic
greeting
ู…ุฑุญุจุง ุจูƒู…
basic_plain
0.191
broken
[]
true
IBMPlexSansArabic
greeting
ู…ุฑุญุจุง ุจูƒู…
basic_reshaped
0.847
recognisable
[]
true
IBMPlexSansArabic
sentence
ุงู„ุชุฒุงู…ู†ุง ุจุงู„ู†ุฒุงู‡ุฉ
raqm_plain
1
identical
[]
true
IBMPlexSansArabic
sentence
ุงู„ุชุฒุงู…ู†ุง ุจุงู„ู†ุฒุงู‡ุฉ
raqm_reshaped
0.148
broken
[]
true
IBMPlexSansArabic
sentence
ุงู„ุชุฒุงู…ู†ุง ุจุงู„ู†ุฒุงู‡ุฉ
basic_plain
0.117
broken
[]
true
IBMPlexSansArabic
sentence
ุงู„ุชุฒุงู…ู†ุง ุจุงู„ู†ุฒุงู‡ุฉ
basic_reshaped
0.678
recognisable
[]
true
IBMPlexSansArabic
with_digits
ููŠ ุนุงู… 2026
raqm_plain
1
identical
[]
true
IBMPlexSansArabic
with_digits
ููŠ ุนุงู… 2026
raqm_reshaped
0.129
broken
[]
true
IBMPlexSansArabic
with_digits
ููŠ ุนุงู… 2026
basic_plain
0.142
broken
[]
true
IBMPlexSansArabic
with_digits
ููŠ ุนุงู… 2026
basic_reshaped
0.203
broken
[]
true
IBMPlexSansArabic
mixed_latin
ุดุฑูƒุฉ Pixelogik ู„ู„ุฅู†ุชุงุฌ
raqm_plain
1
identical
[]
true
IBMPlexSansArabic
mixed_latin
ุดุฑูƒุฉ Pixelogik ู„ู„ุฅู†ุชุงุฌ
raqm_reshaped
0.149
broken
[]
true
IBMPlexSansArabic
mixed_latin
ุดุฑูƒุฉ Pixelogik ู„ู„ุฅู†ุชุงุฌ
basic_plain
0.142
broken
[]
true
IBMPlexSansArabic
mixed_latin
ุดุฑูƒุฉ Pixelogik ู„ู„ุฅู†ุชุงุฌ
basic_reshaped
0.311
broken
[]
true
IBMPlexSansArabic
diacritics
ู…ูŽุฑู’ุญูŽุจู‹ุง ุจููƒูู…ู’
raqm_plain
1
identical
[]
true
IBMPlexSansArabic
diacritics
ู…ูŽุฑู’ุญูŽุจู‹ุง ุจููƒูู…ู’
raqm_reshaped
0.151
broken
[]
true
IBMPlexSansArabic
diacritics
ู…ูŽุฑู’ุญูŽุจู‹ุง ุจููƒูู…ู’
basic_plain
0.151
broken
[]
true
IBMPlexSansArabic
diacritics
ู…ูŽุฑู’ุญูŽุจู‹ุง ุจููƒูู…ู’
basic_reshaped
0.403
broken
[]
true

ArShape โ€” when does the standard Arabic rendering recipe break Arabic?

Author: Syamjith NK Write-up: The Arabic fix everyone recommends is now the thing breaking your Arabic Companion dataset: ArNum-TTS โ€” the same failure mode in speech.

The finding

arabic_reshaper + python-bidi before drawing is the standard advice for rendering Arabic in Python. On any renderer that already performs complex-text layout it corrupts the output, because the shaping and the bidi reorder both happen twice.

The word is "welcome":

rendered as
correct (no preprocessing) ู…ุฑุญุจุง ุจูƒู…
after reshaper + bidi ู…ูƒุจ ุงุจุญุฑู…

Each string sits alone in its own table cell, because putting them either side of an arrow on one line lets the bidi algorithm reorder them - which, on a page about Arabic being silently reordered, is exactly the wrong mistake to make.

Whether your renderer already does this work is a runtime property, not a version number. Since Pillow 8.2.0 the wheels bundle libraqm, but libraqm links FriBiDi at runtime - so the same wheel is Raqm-enabled on one machine and not on another. Check the environment that actually renders:

import PIL.features
PIL.features.check("raqm")   # True  -> do NOT reshape, it is already shaping
                             # False -> you must reshape

The recipe was correct when it was written; text stacks caught up and the advice did not.

Correction, 2026-08-21. An earlier version of this card said "Pillow 12 links Raqm/HarfBuzz, so it already does this work." That tied the behaviour to a Pillow version, which is wrong: it is a property of the environment, not of the release. The same correction was filed upstream at python-arabic-reshaper#102.

Measured

3 Arabic fonts ร— 5 strings ร— 4 rendering paths, scored on shape similarity against a verified-correct reference:

rendering path identical recognisable broken
modern engine, text as-is 15 0 0
modern engine + reshaper + bidi 0 1 14
no shaping engine, text as-is 0 0 15
no shaping engine + reshaper + bidi 0 9 6

The last row is the useful nuance: on a renderer without shaping the recipe is a partial rescue. Plain Arabic recovers, but digits, embedded Latin and diacritics still fail โ€” positioning combining marks and resolving bidirectional runs needs real shaping regardless of what you pre-process.

Note, 27 October 2026. Four of the ten recognisable rows draw digits or Latin as .notdef boxes (glyphs_ok = false): SF Arabic mixed_latin on the modern engine with reshaper + bidi, and SF Arabic with_digits, SF Arabic mixed_latin and Geeza Pro with_digits on the no-engine path with reshaper + bidi. Those fonts have no digit or Latin glyphs, so the reference render is missing them too and shape similarity cannot see the loss. The claim that digits and embedded Latin still fail without a shaping engine is therefore measured on IBM Plex Sans Arabic only, where both are broken. Diacritics fail in all three fonts. Filter on glyphs_ok as well as verdict. No records or scores changed.

Font coverage trap

Checked against the font cmap tables, not by eye: SF Arabic and Geeza Pro contain no Latin letters or digits at all. ููŠ ุนุงู… 2026 renders the year as .notdef boxes while looking entirely correct to anyone not reading the number. IBM Plex Sans Arabic has full coverage.

The practical version

  • Check whether your renderer does complex-text layout โ€” in Pillow, PIL.features.check("raqm").
  • If it does: pass Arabic through untouched. Do not reshape.
  • If it does not: reshape, and test digits, Latin and diacritics separately, because those will still be wrong.
  • Check the font actually contains every character you are about to draw.

Tooling

The check above tells you whether your renderer is about to corrupt Arabic. It does not tell you whether corruption is already sitting in your data โ€” the recipe applied once and the result written back to a JSON file, a localisation string, an export.

arabic-lint finds that:

pip install arabic-lint
arabic-lint ./src

It flags Arabic Presentation Forms-B in stored text and exits 1, so it drops into CI. It reports rather than rewrites, because the obvious repair is unsafe: NFKC + reverse round-trips exactly except across a lam-alef ligature, where one codepoint decomposes to two in logical order inside visual-order text and the pair comes out swapped. ุงู„ุฅู…ุงุฑุงุช recovers as ุงุฅู„ู…ุงุฑุงุช, and ุงู„ุณู„ุงู… as ุงู„ุณุงู„ู… โ€” a real but different word, so it survives a proofread. Source: Syamjith-NK/arabic-lint.

The documentation gap behind all of this is filed upstream at Pillow #9907.

Honesty about method

Two errors, both caught only by looking at the output rather than the score, and both recorded because they are instructive:

  1. The premise was backwards. I was confident reshaping was required, so I made it the reference the others were scored against โ€” which meant the correct renderings scored worst.
  2. The metric compared position as well as shape, so a visually identical render scored zero because two layout engines place glyphs a few pixels apart. Fixed by normalising to the ink bounding box, then reporting three bands instead of pass/fail โ€” which is what exposed the partial-rescue result above.

A benchmark inherits the assumptions of whoever wrote it. The only reliable way to find them is to look at the output.

Reproduce

python render_bench.py

Renders every combination to out/ and writes results.jsonl. Images are not shipped โ€” they regenerate in seconds and the fonts are system fonts. SF Arabic and Geeza Pro ship only with macOS (render_bench.py reads them from /System/Library/Fonts), so a full re-run needs a Mac; IBM Plex Sans Arabic is a free download.

The glyphs_ok column, and the trap it exposes

verdict is scored on shape similarity (IoU) against a reference render. That measures whether the Arabic letterforms are correct. It does not measure whether every character in the string was drawn at all.

Four rows score verdict = identical at IoU 1.000 while rendering 2026 and Pixelogik as .notdef boxes, because SF Arabic and Geeza Pro contain no Latin glyphs or digits. The Arabic is perfect; the rest of the string is missing.

glyphs_ok (added 21 August 2026) makes that queryable instead of leaving it in prose:

import json
rows = [json.loads(l) for l in open("results.jsonl")]
[r for r in rows if r["verdict"] == "identical" and not r["glyphs_ok"]]
# 4 rows: SFArabic/GeezaPro x with_digits/mixed_latin, raqm_plain

The published 15/15 figure is unchanged and still correct โ€” it is a statement about shaping, which is what this benchmark measures. glyphs_ok is a second, independent axis: font coverage. Anyone filtering on verdict alone should filter on both.

Does Arabic Survive the Pipeline?

This is one of three reproducible benchmarks, one per stage of a real production pipeline. Each measures an Arabic failure that looks correct to anyone who does not read Arabic โ€” which is exactly why it ships.

  • ArNum-TTS โ€” do numbers survive speech synthesis?
  • ArShape โ€” does the standard reshaping recipe survive rendering? โ† you are here
  • ArPDF โ€” does Arabic survive a PDF round trip?

All three are CC BY 4.0 and ship the scorer, the raw per-item results, and an explicit statement of what the measurement does not establish. Code is MIT (see LICENSE).

Related

This benchmark measures one failure in isolation. syamjithnk/arabic-corpus-audit reports a scan of 341 public Arabic datasets on the Hub, of which 276 were readable, covering 119,517 text fields. A follow-up check of one OCR dataset found stored Arabic presentation forms in all 1,000 sampled labels; this is a sample finding, not a claim that every label is corrupted. The checked labels remain in logical word order, and NFKC normalization recovered ordinary Arabic text in that sample. Presentation-form detection alone does not establish reversed word order or incorrect transcription. See the audit card's correction log for the evidence.

11 October 2026 โ€” wording correction: the earlier summary called the OCR dataset "100% corrupted". The text above replaces that overstatement with the measured sample result and distinguishes stored glyph forms from word order. No benchmark records or scores changed.

The audit is archived on Zenodo: 10.5281/zenodo.22733934 for the version described there, or 10.5281/zenodo.22733933 for all versions. Those DOIs identify the audit, not this benchmark; to cite this dataset, use the BibTeX entry below. (Corrected 27 October 2026: this paragraph previously read as though the DOI belonged to this dataset.)

Sibling benchmarks: arshape (rendering), arnum-tts (speech), arpdf (extraction). The tool: arabic-lint.

Citation

@misc{syamjithnk_arshape_2026,
  author       = {Syamjith NK},
  title        = {ArShape: Arabic shaping across text rendering paths},
  year         = {2026},
  publisher    = {Hugging Face},
  howpublished = {\url{https://huggingface.co/datasets/syamjithnk/arshape}},
  note         = {Data CC BY 4.0; code MIT}
}
Downloads last month
54

Collection including syamjithnk/arshape