--- license: other license_name: mixed-mit-and-restricted-fonts license_link: https://github.com/MohamadHajjRabee/quran-qcf4/blob/main/LICENSE.md language: - ar tags: - quran - arabic - islam - font - mushaf - qcf - qcf4 - hafs - madinah - rendering - nlp - ocr pretty_name: QCF4 Quran Database size_categories: - 1K خط قرآن مصحف المدينة النبوية ١٤٤١هـ — الإصدار الرابع — رواية حفص عن عاصم ## Dataset Structure ``` ├── pages/ # 604 JSON files — one per Mushaf page ├── fonts/ # 47 QCF4 TTF font files + BSML header font ├── fonts-woff2/ # 47 QCF4 WOFF2 font files + BSML header font ├── index.json # Master index — all 114 chapter metadata ├── verses.json # Verse-key → page/line lookup (e.g. "2:255") └── font-map.json # Page number → font name mapping ``` ## Data Fields Each page file (`pages/NNN.json`) contains: | Field | Type | Description | |-------|------|-------------| | `page` | int | Mushaf page number (1–604) | | `font` | string | Main font for this page | | `surahs` | array | Chapters present on this page | | `lines` | array | Lines on the page, each containing words | Each word contains: | Field | Type | Description | |-------|------|-------------| | `char` | string | Unicode character mapping to the glyph | | `code` | int | Unicode code point | | `font` | string | Font to use for rendering this word | | `type` | string | `word`, `end`, `surah_header`, `bismillah`, `quarter` | | `verse_key` | string | e.g. `"2:255"` (for type `word` and `end`) | | `position` | int | Word position within the verse | | `text` | string | Human-readable Arabic text | ## Use Cases - **Quran apps** — render pixel-perfect Mushaf pages in web or mobile apps - **Arabic OCR** — ground-truth glyph-to-text alignment data - **Tajweed analysis** — word-level verse segmentation - **NLP research** — structured Arabic text with positional metadata - **Accessibility tools** — verse highlighting, word-by-word navigation ## Quick Start ```python import json import requests # Load a page page = requests.get( "https://raw.githubusercontent.com/MohamadHajjRabee/quran-qcf4/main/pages/001.json" ).json() # Print all words on the page for line in page["lines"]: for word in line["words"]: if word["type"] == "word": print(word["verse_key"], word["text"]) ``` ```js // Web — load font and render a word const page = await fetch( "https://raw.githubusercontent.com/MohamadHajjRabee/quran-qcf4/main/pages/001.json" ).then(r => r.json()); // Load the font via jsDelivr const style = document.createElement("style"); style.textContent = `@font-face { font-family: "${page.font}"; src: url("https://cdn.jsdelivr.net/gh/MohamadHajjRabee/quran-qcf4@main/fonts-woff2/${page.font}_W.woff2"); }`; document.head.appendChild(style); ``` ## Stats | Property | Value | |----------|-------| | Total pages | 604 | | Total chapters | 114 | | Total verses | 6,236 | | Font files | 47 + 1 header | | Recitation | Hafs ʿan ʿĀṣim | | Script | Madinah Mushaf 1441 AH | ## Related Resources - 📦 **npm package**: [quran-qcf4](https://www.npmjs.com/package/quran-qcf4) - 💻 **GitHub**: [MohamadHajjRabee/quran-qcf4](https://github.com/MohamadHajjRabee/quran-qcf4) - 🌐 **Live Demo**: [mohamadhajjrabee.github.io/quran-qcf4/demo.html](https://mohamadhajjrabee.github.io/quran-qcf4/demo.html) - 🔤 **Font source**: [Ahmad ElGharib on Telegram](https://t.me/quranfont) ## License - **JSON data & schema**: MIT License © 2026 Mohamad Hajj Rabee - **Font files**: Property of the King Fahd Quran Complex. Provided for Quranic rendering purposes only. See [LICENSE.md](https://github.com/MohamadHajjRabee/quran-qcf4/blob/main/LICENSE.md). ## Credits - Calligraphy: **Uthman Taha** - Produced by: **King Fahd Quran Complex** (مجمع الملك فهد لطباعة المصحف الشريف) - Font version: **Ahmad ElGharib** — [Telegram](https://t.me/quranfont) - Chapter metadata: [Quran.com](https://quran.com) open data - Dataset packaged by: **Mohamad Hajj Rabee**