Arabic Fonts Installation Fix for Ubuntu 22.04
Problem Identified
The Docker build was failing because:
fonts-scheherazade-newis not available in Ubuntu 22.04fonts-scheherazadeis also not available in Ubuntu 22.04
Root Cause
Ubuntu 22.04 (jammy) does not include the Scheherazade font packages in its official repositories.
Solution Implemented
Used Available Arabic Fonts: Replaced unavailable font packages with officially available ones:
fonts-noto-naskh-arabicfonts-noto-kufi-arabicfonts-hosny-amiri
Manual Font Installation: Added direct download of Scheherazade New font from Google Fonts repository:
RUN mkdir -p /usr/share/fonts/truetype/scheherazade \ && wget -q https://github.com/google/fonts/raw/main/ofl/scheherazadenew/ScheherazadeNew-Regular.ttf -O /usr/share/fonts/truetype/scheherazade/ScheherazadeNew-Regular.ttf \ && wget -q https://github.com/google/fonts/raw/main/ofl/scheherazadenew/ScheherazadeNew-Bold.ttf -O /usr/share/fonts/truetype/scheherazade/ScheherazadeNew-Bold.ttf \ && fc-cache -fv
Changes Made
Dockerfile
- Removed unavailable font packages (
fonts-scheherazade-new,fonts-scheherazade) - Added available Arabic font packages for Ubuntu 22.04
- Added manual installation of Scheherazade New font from Google Fonts
- Kept all other packages and configuration the same
Expected Results
These changes should resolve the build error and provide comprehensive Arabic font support:
✅ Build Success: Docker image will build without font package errors ✅ Arabic Support: Multiple Arabic fonts available for document rendering ✅ Scheherazade New: Manually installed for users who specifically need this font ✅ Compatibility: Maintained Ubuntu 22.04 base image for Hugging Face Spaces compatibility
Font Options Now Available
- Noto Naskh Arabic - General Arabic text rendering
- Noto Kufi Arabic - Modern Arabic UI text
- Amiri - Classical Arabic typography
- Scheherazade New - Manually installed from Google Fonts
- Liberation Fonts - Latin text with Arabic support
- DejaVu Fonts - Extended character set support
Verification Steps
- Rebuild the Docker image
- Verify the image builds without errors
- Check that all fonts are properly installed:
fc-list | grep -i arabic fc-list | grep -i scheherazade fc-list | grep -i amiri - Test document conversion with Arabic text
Additional Benefits
- Better font diversity for Arabic document rendering
- Fallback options if one font is not available
- Manual installation ensures latest font versions
- No dependency on Ubuntu repository availability