{"_id":"quran-qcf4","_rev":"4-6fb2f87ca42291ceaa3d67ee3aba6de8","name":"quran-qcf4","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"quran-qcf4","version":"1.0.0","keywords":["quran","qcf","qcf4","mushaf","arabic","islam","font","hafs","madinah","uthman-taha","quran-font","quran-data"],"author":{"name":"Mohamad Hajj Rabee"},"license":"SEE LICENSE IN LICENSE.md","_id":"quran-qcf4@1.0.0","maintainers":[{"name":"mohamadhr","email":"a39630595@gmail.com"}],"homepage":"https://github.com/MohamadHajjRabee/quran-qcf4#readme","bugs":{"url":"https://github.com/MohamadHajjRabee/quran-qcf4/issues"},"dist":{"shasum":"7d635b34280bdc3fd9de8caf709c43aa7c88ee05","tarball":"https://registry.npmjs.org/quran-qcf4/-/quran-qcf4-1.0.0.tgz","fileCount":705,"integrity":"sha512-Gi4DgH/NonVsk9YjJIllrGfkZsjuM+vKAlI+RthLxgfKiFV/3IILVp0EU+2L4TTSCXMaUDVGw+yikVff6d8OAQ==","signatures":[{"sig":"MEYCIQDlsw1gKbSsAcmTW1axcOlorJ8qYvlPcvcOCLbvXkedXQIhANtz1Xd7blJ19QOGy5ZvGQd/d0PYgnJtTJyE3Kk7VXmw","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":155360082},"main":"index.json","exports":{".":"./index.json","./verses":"./verses.json","./fonts/*":"./fonts/*","./pages/*":"./pages/*.json","./font-map":"./font-map.json","./fonts-woff2/*":"./fonts-woff2/*"},"gitHead":"f6e7d018dc7995126728b80cc70ab033b2137eb2","_npmUser":{"name":"mohamadhr","email":"a39630595@gmail.com"},"repository":{"url":"git+https://github.com/MohamadHajjRabee/quran-qcf4.git","type":"git"},"_npmVersion":"11.4.2","description":"Developer-friendly Quran database using QCF v4 (King Fahd Complex Font) with Hafs recitation — includes fonts, page JSON, verse index, and font map.","directories":{},"_nodeVersion":"22.13.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/quran-qcf4_1.0.0_1773563957985_0.7602462689888916","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"quran-qcf4","version":"1.0.2","keywords":["quran","qcf","qcf4","mushaf","arabic","islam","font","hafs","madinah","uthman-taha","quran-font","quran-data"],"author":{"name":"Mohamad Hajj Rabee"},"license":"SEE LICENSE IN LICENSE.md","_id":"quran-qcf4@1.0.2","maintainers":[{"name":"mohamadhr","email":"a39630595@gmail.com"}],"homepage":"https://github.com/MohamadHajjRabee/quran-qcf4#readme","bugs":{"url":"https://github.com/MohamadHajjRabee/quran-qcf4/issues"},"dist":{"shasum":"a7f50e6899008f72298155003d1ad81d706a0d76","tarball":"https://registry.npmjs.org/quran-qcf4/-/quran-qcf4-1.0.2.tgz","fileCount":657,"integrity":"sha512-vKG6MDcraIeQBcelECTLX5YOCgfv/Hzp85Eaz9gm47fhxX6D6xKxGSozj3wkbuVbun821ruAxCWxnjL0hv2UDw==","signatures":[{"sig":"MEUCIQDKwZ2i0nPBHUy3vao/u/zIRYOgLc9xZFxc1uBFE8PhLAIgGS3APTvVZeP5yy0ltGGDHfWKZS9Rkj8oVO3egFkgJ1c=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":58376348},"main":"index.json","exports":{".":"./index.json","./verses":"./verses.json","./fonts/*":"./fonts/*","./pages/*":"./pages/*.json","./font-map":"./font-map.json","./fonts-woff2/*":"./fonts-woff2/*"},"gitHead":"809934c90261f00b9256bc61646f49ff78ece542","_npmUser":{"name":"mohamadhr","email":"a39630595@gmail.com"},"repository":{"url":"git+https://github.com/MohamadHajjRabee/quran-qcf4.git","type":"git"},"_npmVersion":"11.4.2","description":"Developer-friendly Quran database using QCF v4 (King Fahd Complex Font) with Hafs recitation — includes fonts, page JSON, verse index, and font map.","directories":{},"_nodeVersion":"22.13.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/quran-qcf4_1.0.2_1773564637056_0.17374133768662592","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"quran-qcf4","version":"1.0.3","keywords":["quran","qcf","qcf4","mushaf","arabic","islam","font","hafs","madinah","uthman-taha","quran-font","quran-data"],"author":{"name":"Mohamad Hajj Rabee"},"license":"SEE LICENSE IN LICENSE.md","_id":"quran-qcf4@1.0.3","maintainers":[{"name":"mohamadhr","email":"a39630595@gmail.com"}],"homepage":"https://github.com/MohamadHajjRabee/quran-qcf4#readme","bugs":{"url":"https://github.com/MohamadHajjRabee/quran-qcf4/issues"},"dist":{"shasum":"c37203edd1ad5b297de85206760d0c08752bd05f","tarball":"https://registry.npmjs.org/quran-qcf4/-/quran-qcf4-1.0.3.tgz","fileCount":658,"integrity":"sha512-PsQVcy3eCUw+an+Tn/fNhdItLWzizjXQ/y+RyS0+eH9sJ/QgAsc3E45pAzpUXD4rLAjLCFRIhNuUZjS6X2T+Ag==","signatures":[{"sig":"MEYCIQDrMNPnrpl6QZa4ZEgVwcee7zRbz4cDcvxwTpS5bmDOOgIhAMsslTu3q94hOVyQb2xp1C9g4xoCvzatutYqvf6HCMyc","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":58378475},"main":"index.json","exports":{".":"./index.json","./verses":"./verses.json","./fonts/*":"./fonts/*","./pages/*":"./pages/*.json","./font-map":"./font-map.json","./fonts-woff2/*":"./fonts-woff2/*"},"gitHead":"7c9fc7aa7cc24ee0305fdd21716edd1ad0783c54","_npmUser":{"name":"mohamadhr","email":"a39630595@gmail.com"},"repository":{"url":"git+https://github.com/MohamadHajjRabee/quran-qcf4.git","type":"git"},"_npmVersion":"11.4.2","description":"Developer-friendly Quran database using QCF v4 (King Fahd Complex Font) with Hafs recitation — includes fonts, page JSON, verse index, and font map.","directories":{},"_nodeVersion":"22.13.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/quran-qcf4_1.0.3_1773565206252_0.20808918822691003","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"quran-qcf4","version":"1.1.0","description":"Developer-friendly Quran database using QCF v4 (King Fahd Complex Font) with Hafs recitation — includes fonts, page JSON, verse index, and font map.","keywords":["quran","qcf","qcf4","mushaf","arabic","islam","font","hafs","madinah","uthman-taha","quran-font","quran-data"],"author":{"name":"Mohamad Hajj Rabee"},"license":"SEE LICENSE IN LICENSE.md","repository":{"type":"git","url":"git+https://github.com/MohamadHajjRabee/quran-qcf4.git"},"homepage":"https://github.com/MohamadHajjRabee/quran-qcf4#readme","bugs":{"url":"https://github.com/MohamadHajjRabee/quran-qcf4/issues"},"main":"index.json","exports":{".":"./index.json","./verses":"./verses.json","./font-map":"./font-map.json","./qbsml":"./qbsml.json","./pages/*":"./pages/*.json","./fonts/*":"./fonts/*","./fonts-woff2/*":"./fonts-woff2/*"},"_id":"quran-qcf4@1.1.0","gitHead":"a51076ceb85855d64239d1a2e0decfd306ad5ecc","_nodeVersion":"22.13.0","_npmVersion":"11.4.2","dist":{"integrity":"sha512-TJOKlv7l6U+eFsgaJJVP1cMkW5FOxSayJR9UJGb0KPv/+HjEGEJBMqcvNaSda/AmKpRt44xoxw1arWJPPbuG+Q==","shasum":"76bd6d9591ac1022a7efc3d9223af95b931000fb","tarball":"https://registry.npmjs.org/quran-qcf4/-/quran-qcf4-1.1.0.tgz","fileCount":659,"unpackedSize":58610117,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDBikNmic5UQPeibzdoc1t4VdZoeUsJksvs0SLVNy+RQgIgXTKIu/H1k+7nH9zNMBDVWCqDc/0Qyo/ixnwftTIRVTQ="}]},"_npmUser":{"name":"mohamadhr","email":"a39630595@gmail.com"},"directories":{},"maintainers":[{"name":"mohamadhr","email":"a39630595@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/quran-qcf4_1.1.0_1786290906078_0.2865214124023121"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-15T08:39:17.984Z","modified":"2026-08-09T15:55:06.812Z","1.0.0":"2026-03-15T08:39:20.302Z","1.0.2":"2026-03-15T08:50:38.158Z","1.0.3":"2026-03-15T09:00:07.340Z","1.1.0":"2026-08-09T15:55:06.684Z"},"bugs":{"url":"https://github.com/MohamadHajjRabee/quran-qcf4/issues"},"author":{"name":"Mohamad Hajj Rabee"},"license":"SEE LICENSE IN LICENSE.md","homepage":"https://github.com/MohamadHajjRabee/quran-qcf4#readme","keywords":["quran","qcf","qcf4","mushaf","arabic","islam","font","hafs","madinah","uthman-taha","quran-font","quran-data"],"repository":{"type":"git","url":"git+https://github.com/MohamadHajjRabee/quran-qcf4.git"},"description":"Developer-friendly Quran database using QCF v4 (King Fahd Complex Font) with Hafs recitation — includes fonts, page JSON, verse index, and font map.","maintainers":[{"name":"mohamadhr","email":"a39630595@gmail.com"}],"readme":"# QCF4 Quran Database\r\n\r\n[![npm](https://img.shields.io/npm/v/quran-qcf4?color=c9a84c&label=npm)](https://www.npmjs.com/package/quran-qcf4)\r\n[![Live Demo](https://img.shields.io/badge/demo-live-2ecc8a)](https://mohamadhajjrabee.github.io/quran-qcf4/demo.html)\r\n[![License](https://img.shields.io/badge/license-see%20repo-lightgrey)](https://github.com/MohamadHajjRabee/quran-qcf4)\r\n\r\n> **[▶ Live Demo](https://mohamadhajjrabee.github.io/quran-qcf4/demo.html)** · Renders any Mushaf page in the browser using QCF4 fonts via CDN.\r\n\r\n> **[🔤 QBSML Glyph Viewer](https://mohamadhajjrabee.github.io/quran-qcf4/qbsml.html)** · Browse every decoded surah/juz header and ornament glyph from the QBSML font.\r\n\r\nA developer-friendly Quran database using **QCF v4** (Quran Complex Font, version 4) glyph rendering for the **Hafs** recitation.\r\n\r\n## About QCF4\r\n\r\nQCF4 is a new, previously unpublished Quranic font based on the Madinah Mushaf (1441 AH), written by the calligrapher **Uthman Taha** and produced by the **King Fahd Complex** in Madinah.\r\n\r\nIt is an improved and modern edition of the second Madinah font (QCF2, 2013), with the following enhancements:\r\n\r\n1. Improved quality of letter shapes and diacritical marks\r\n2. Removal of whitespace gaps between words\r\n3. Reduced font file count to just **47 files** (down from 604 in QCF1/QCF2 which required one font per page)\r\n4. Updated verse-end marker design\r\n\r\n> خط قرآن مصحف المدينة النبوية ١٤٤١هـ\r\n> الإصدار الرابع — رواية حفص عن عاصم.\r\n> عُثمان طه. مُجمّع الملك فهد — QCF4\r\n\r\nFont version by **Ahmad ElGharib** — [Telegram Channel](https://t.me/quranfont)\r\n\r\n## What's Included\r\n\r\n```\r\n├── pages/          # 604 JSON files (one per Mushaf page)\r\n│   ├── 001.json\r\n│   ├── 002.json\r\n│   └── ...\r\n├── fonts/          # 47 QCF4 Hafs font files + BSML header font\r\n│   ├── QCF4_Hafs_01_W.ttf\r\n│   ├── QCF4_Hafs_02_W.ttf\r\n│   ├── ...\r\n│   └── QCF4_QBSML.ttf\r\n├── fonts-woff2/    # 47 QCF4 Hafs woff2 font files + BSML header font\r\n│   ├── QCF4_Hafs_01_W.woff2\r\n│   ├── QCF4_Hafs_02_W.woff2\r\n│   ├── ...\r\n│   └── QCF4_QBSML.woff2\r\n├── index.json      # Master index with chapter metadata\r\n├── verses.json     # Verse-key → page/line lookup index\r\n├── font-map.json   # Page number → font name mapping\r\n└── qbsml.json      # Decoded glyph set for the QBSML surah/juz-header font\r\n```\r\n\r\n## Page JSON Schema\r\n\r\nEach `pages/NNN.json` file represents one Mushaf page:\r\n\r\n```json\r\n{\r\n  \"page\": 1,\r\n  \"font\": \"QCF4_Hafs_01\",\r\n  \"surahs\": [\r\n    {\r\n      \"id\": 1,\r\n      \"name\": \"Al-Fatihah\",\r\n      \"name_arabic\": \"الفاتحة\",\r\n      \"verse_start\": 1,\r\n      \"verse_end\": 7\r\n    }\r\n  ],\r\n  \"lines\": [\r\n    {\r\n      \"line\": 1,\r\n      \"words\": [\r\n        {\r\n          \"code\": 61696,\r\n          \"char\": \"\\uF100\",\r\n          \"font\": \"QCF4_QBSML\",\r\n          \"text\": \"سُورَةُ الفَاتِحَةِ\",\r\n          \"type\": \"surah_header\",\r\n          \"sura\": 1\r\n        }\r\n      ]\r\n    },\r\n    {\r\n      \"line\": 2,\r\n      \"words\": [\r\n        {\r\n          \"code\": 61696,\r\n          \"char\": \"\\uF100\",\r\n          \"font\": \"QCF4_Hafs_01\",\r\n          \"text\": \"بِسْمِ\",\r\n          \"type\": \"word\",\r\n          \"verse_key\": \"1:1\",\r\n          \"position\": 1\r\n        },\r\n        ...\r\n      ]\r\n    }\r\n  ]\r\n}\r\n```\r\n\r\n### Word Types\r\n\r\n| Type | Description |\r\n|------|-------------|\r\n| `word` | Quranic word — has `verse_key` and `position` |\r\n| `end` | Verse-end marker (circled number) — has `verse_key` and `position` |\r\n| `surah_header` | Surah title banner — has `sura`, uses `QCF4_QBSML` font |\r\n| `bismillah` | Bismillah glyph — has `sura`, uses `QCF4_Hafs_01` font |\r\n| `quarter` | Quarter-hizb marker (۞) |\r\n\r\n## Verse Index (`verses.json`)\r\n\r\nQuick lookup to find any verse by key:\r\n\r\n```json\r\n{\r\n  \"1:1\": {\r\n    \"page\": 1,\r\n    \"lines\": [\r\n      { \"line\": 2, \"word_start\": 1, \"word_end\": 5 }\r\n    ]\r\n  },\r\n  \"2:255\": {\r\n    \"page\": 42,\r\n    \"lines\": [\r\n      { \"line\": 6, \"word_start\": 1, \"word_end\": 8 },\r\n      { \"line\": 7, \"word_start\": 9, \"word_end\": 19 },\r\n      { \"line\": 8, \"word_start\": 20, \"word_end\": 28 }\r\n    ]\r\n  }\r\n}\r\n```\r\n\r\nA verse can span multiple lines. Each entry tells you which page, which lines, and the word positions on each line.\r\n\r\n## Font Map (`font-map.json`)\r\n\r\nMaps each page number to its font name:\r\n\r\n```json\r\n{\r\n  \"1\": \"QCF4_Hafs_01\",\r\n  \"2\": \"QCF4_Hafs_01\",\r\n  ...\r\n  \"604\": \"QCF4_Hafs_47\"\r\n}\r\n```\r\n\r\n## QBSML Glyph Set (`qbsml.json`)\r\n\r\n`QCF4_QBSML.ttf` is a second, small font (separate from the 47 `QCF4_Hafs_NN`\r\npage fonts) used only for surah headers, juz' headers, the Bismillah, and\r\nopening-page ornaments — the same font referenced by `surah_header` and\r\n`bismillah` words in the page JSON (see [Word Types](#word-types) above).\r\n\r\n`qbsml.json` documents every non-empty glyph in that font: which Unicode PUA\r\ncode point it lives at, and what it renders (a surah name, a juz' label, a\r\nBismillah word-part, etc). It's most useful if you want to render a surah or\r\njuz' header standalone, without loading a full page.\r\n\r\n```json\r\n{\r\n  \"font\": \"QCF4_QBSML\",\r\n  \"description\": \"Deciphered glyph sets in the QCF4 Bismillah/surah-header font (QBSML)...\",\r\n  \"total_glyphs_in_font\": 2564,\r\n  \"non_empty_glyphs_investigated\": 532,\r\n  \"sets\": [\r\n    {\r\n      \"name\": \"surah_headers_style_a\",\r\n      \"label\": \"Surah name headers — Style A (spaced)\",\r\n      \"codepoint_range\": \"0xF100-0xF171\",\r\n      \"count\": 114,\r\n      \"entries\": [\r\n        {\r\n          \"sura\": 1,\r\n          \"name_arabic\": \"الفاتحة\",\r\n          \"name_en\": \"Al-Fatihah\",\r\n          \"codepoint\": 61696,\r\n          \"hex\": \"F100\",\r\n          \"char\": \"\\uf100\",\r\n          \"glyph_name\": \"glyph4\",\r\n          \"advance_width\": 7665,\r\n          \"bbox\": [-3, -806, 7667, 1414]\r\n        }\r\n      ]\r\n    }\r\n  ]\r\n}\r\n```\r\n\r\nThere are 7 sets in total:\r\n\r\n| Set | Count | Contents |\r\n|---|---|---|\r\n| `surah_headers_style_a` | 114 | One glyph per surah name, normally-kerned |\r\n| `surah_headers_style_a_merged` | 98 | Short surah names sharing a glyph, Style A |\r\n| `juz_headers_style_a` | 30 | One glyph per juz' (para) label, Style A |\r\n| `surah_headers_style_b` | 114 | Same 114 surah names, tighter/compact kerning |\r\n| `surah_headers_style_b_merged` | 98 | Short surah names sharing a glyph, Style B |\r\n| `juz_headers_style_b` | 30 | One glyph per juz' label, Style B |\r\n| `opening_matter_and_ornaments` | 48 | Bismillah word-parts, Isti'adhah, and decorative ornaments |\r\n\r\nStyle A and Style B are two complete, interchangeable renderings of the same\r\n114 surah names / 30 juz' labels — Style A uses normal letter spacing, Style\r\nB is tighter/more compact. Corresponding Style B glyphs sit exactly `0xF8`\r\ncode points above their Style A counterpart (e.g. surah 1 Style A is\r\n`0xF100`, Style B is `0xF1F8`), so you can compute one from the other without\r\na lookup table if you need to.\r\n\r\nThe font has no GSUB/ligature table — every code point maps straight to one\r\nprecomposed glyph, so no OpenType shaping engine is required to render these\r\ncorrectly; a plain `font-family` + character is enough.\r\n\r\nRender any entry the same way you'd render a page word — set\r\n`font-family: \"QCF4_QBSML\"` and write out `String.fromCodePoint(entry.codepoint)`\r\n(or the `char` field directly).\r\n\r\n## How to Render\r\n\r\n### 1. Load the Font\r\n\r\nEach page uses one main font. Load it via CSS `@font-face`:\r\n\r\n```css\r\n@font-face {\r\n  font-family: \"QCF4_Hafs_01\";\r\n  src: url(\"fonts/QCF4_Hafs_01_W.ttf\");\r\n}\r\n@font-face {\r\n  font-family: \"QCF4_QBSML\";\r\n  src: url(\"fonts/QCF4_QBSML.ttf\");\r\n}\r\n```\r\n\r\n### 2. Render Words\r\n\r\nEach word has a `char` field containing the Unicode character that maps to the correct glyph in the font:\r\n\r\n```html\r\n<span style=\"font-family: 'QCF4_Hafs_01'; font-size: 28px;\">&#xF100;</span>\r\n```\r\n\r\nOr using JavaScript:\r\n\r\n```js\r\nconst span = document.createElement(\"span\");\r\nspan.style.fontFamily = word.font;\r\nspan.textContent = word.char;\r\n```\r\n\r\n### 3. Layout\r\n\r\nWords are organized by lines as they appear on the physical Mushaf page. Render each line as a row (RTL direction), and each word as an inline element within that row.\r\n\r\n## CDN Usage (No Install Required)\r\n\r\nYou can use the data and fonts directly via jsDelivr — no npm install needed:\r\n\r\n```html\r\n<!-- Load a font -->\r\n<style>\r\n  @font-face {\r\n    font-family: \"QCF4_Hafs_01\";\r\n    src: url(\"https://cdn.jsdelivr.net/gh/MohamadHajjRabee/quran-qcf4@main/fonts-woff2/QCF4_Hafs_01_W.woff2\");\r\n  }\r\n</style>\r\n```\r\n\r\n```js\r\n// Fetch page data\r\nconst page = await fetch(\r\n  \"https://raw.githubusercontent.com/MohamadHajjRabee/quran-qcf4/main/pages/001.json\"\r\n).then(r => r.json());\r\n```\r\n\r\n> **Note:** Use `raw.githubusercontent.com` for JSON data (always up to date) and `cdn.jsdelivr.net` for font files (cached for performance).\r\n\r\n## Index (`index.json`)\r\n\r\nContains metadata for all 114 chapters:\r\n\r\n```json\r\n{\r\n  \"meta\": {\r\n    \"schema_version\": \"1.0.0\",\r\n    \"total_pages\": 604,\r\n    \"total_chapters\": 114,\r\n    \"total_verses\": 6236,\r\n    \"font_count\": 47\r\n  },\r\n  \"chapters\": [\r\n    {\r\n      \"id\": 1,\r\n      \"name\": \"Al-Fatihah\",\r\n      \"name_arabic\": \"الفاتحة\",\r\n      \"revelation_place\": \"makkah\",\r\n      \"revelation_order\": 5,\r\n      \"bismillah_pre\": false,\r\n      \"verses_count\": 7,\r\n      \"pages\": [1, 1],\r\n      \"translated_name\": \"The Opener\"\r\n    }\r\n  ]\r\n}\r\n```\r\n\r\n## Credits\r\n\r\n- **QCF4 Fonts**: Madinah Mushaf 1441 AH, calligraphy by **Uthman Taha**, produced by the **King Fahd Quran Complex** (مُجمّع الملك فهد لطباعة المصحف الشريف). QCF4 font version by **Ahmad ElGharib** — [Telegram Channel](https://t.me/quranfont)\r\n- **Chapter metadata**: Derived from [Quran.com](https://quran.com) open data\r\n- **QBSML glyph decoding** (`qbsml.json`, `qbsml.html`): Contributed by [b-acksla-sh](https://github.com/ b-acksla-sh)\r\n\r\n## License\r\n\r\nThe font files are provided for Quranic rendering purposes. Please respect the original creator's terms of use.","readmeFilename":"README.md"}