Skip to content

Commit

Permalink
Added support for Android 15
Browse files Browse the repository at this point in the history
  • Loading branch information
Hassan-kareem committed Dec 9, 2024
1 parent ac90bf0 commit a22e03b
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 27 deletions.
6 changes: 3 additions & 3 deletions Module/module.prop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id=NotoNastaliqUrdu
name=Noto Nastaliq Urdu
version=2
versionCode=120
version=3.0
versionCode=300
author=Hassan-karim
description=Noto Nastaliq Urdu Font for Urdu language
minMagisk=20400
updateJson=https://raw.githubusercontent.com/Hassan-kareem/Nastaliq-Urdu_font/NotoNastaliqUrdu/update.json
36 changes: 18 additions & 18 deletions Module/post-fs-data.sh
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
#!/system/bin/sh

# Define paths
MODDIR=${0%/*}
FONTS_XML_PATH="/system/etc/fonts.xml"
FONT_FALLBACK_XML_PATH="/system/etc/font_fallback.xml"
MODIFIED_FONTS_XML_PATH="$MODDIR/system/etc/fonts.xml"

# Get Android API level
MODIFIED_FONT_FALLBACK_XML_PATH="$MODDIR/system/etc/font_fallback.xml"
APILEVEL=$(getprop ro.build.version.sdk)

# Copy original fonts.xml to the MODDIR to overwrite dummy file
mkdir -p "$MODDIR/system/etc"
cp "$FONTS_XML_PATH" "$MODIFIED_FONTS_XML_PATH"

# Function to add urdu family before ethi family
add_ur_arab_family() {
if [ "$APILEVEL" -ge 31 ]; then
# Android 12 and later format
if [ "$APILEVEL" -le 30 ]; then
cp "$FONTS_XML_PATH" "$MODIFIED_FONTS_XML_PATH"
sed -i '/<!-- fallback fonts -->/a \
<family lang="ur-Arab" variant="elegant"> \
<font weight="400" style="normal"> NotoNastaliqUrdu-Regular.ttf </font> \
<font weight="700" style="normal"> NotoNastaliqUrdu-Bold.ttf </font> \
</family>' "$MODIFIED_FONTS_XML_PATH"
elif [ "$APILEVEL" -ge 31 ] && [ "$APILEVEL" -lt 34 ]; then
cp "$FONTS_XML_PATH" "$MODIFIED_FONTS_XML_PATH"
sed -i '/<family lang="und-Ethi">/i \
<family lang="ur-Arab" variant="elegant"> \
<font weight="400" style="normal" postScriptName="NotoNastaliqUrdu"> NotoNastaliqUrdu-Regular.ttf </font> \
<font weight="700" style="normal"> NotoNastaliqUrdu-Bold.ttf </font> \
</family>' "$MODIFIED_FONTS_XML_PATH"
else
# Android 11 and earlier format
sed -i '/<!-- fallback fonts -->/a \
elif [ "$APILEVEL" -ge 34 ]; then
cp "$FONT_FALLBACK_XML_PATH" "$MODIFIED_FONT_FALLBACK_XML_PATH"
sed -i '/<family lang="und-Ethi">/i \
<family lang="ur-Arab" variant="elegant"> \
<font weight="400" style="normal"> NotoNastaliqUrdu-Regular.ttf </font> \
<font weight="400" style="normal" postScriptName="NotoNastaliqUrdu"> NotoNastaliqUrdu-Regular.ttf </font> \
<font weight="700" style="normal"> NotoNastaliqUrdu-Bold.ttf </font> \
</family>' "$MODIFIED_FONTS_XML_PATH"
</family>' "$MODIFIED_FONT_FALLBACK_XML_PATH"
else
exit 1
fi
}

# Call the function to add the ur-Arab family language above Ethi
add_ur_arab_family
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
![Urdu Banner](Images/Banner.png)
## Noto Nastaliq Font Module for Urdu Users

* Tested on Android 7 and 13,14, it will work on every Android device that has secondary and primary language options. Watch the [video](https://youtu.be/2xI-Kagl1yI?si=ja5x8huKUiWJnF9J&t=46) to learn how to check, including OneUI, OxygenOS, and all AOSP-based ROMs.
* Tested on Android 7 and 13,14,15, it will work on every Android device that has secondary and primary language options. Watch the [video](https://youtu.be/2xI-Kagl1yI?si=ja5x8huKUiWJnF9J&t=46) to learn how to check, including OneUI, OxygenOS, and all AOSP-based ROMs.

> [!Important]
>[![Image](Images/Non-Rooted.jpg)](https://github.com/Hassan-kareem/Nastaliq-Urdu_font/tree/Non-Rooted)
Expand All @@ -12,13 +12,13 @@
## Installation
![Downloads](https://img.shields.io/github/downloads/Hassan-kareem/Nastaliq-Urdu_font/total.svg?style=plastic&label=Downloads)
[![Telegram Channel](https://img.shields.io/badge/Join-Telegram-blue?style=plastic&logo=telegram)](https://t.me/HassansTechInsights)
[![Download Noto Nastaliq Urdu](https://img.shields.io/badge/Download-Noto%20Nastaliq%20Urdu-orange?style=plastic&logo=github)](https://github.com/Hassan-kareem/Nastaliq-Urdu_font/releases/download/NotoNastaliq-v2/NotoNastaliqUrdu-v2.zip)
[![Download Noori Kasheeda](https://img.shields.io/badge/Download-Noori%20Kasheeda-brightgreen?style=plastic&logo=github)](https://github.com/Hassan-kareem/Nastaliq-Urdu_font/releases/download/Noori-Kasheeda-v3/Nastaliq-Urdu_Kasheeda-v3.zip)
[![Download Noori Regular](https://img.shields.io/badge/Download-Noori%20Regular-darkgreen?style=plastic&logo=github)](https://github.com/Hassan-kareem/Nastaliq-Urdu_font/releases/download/Noori-Regular-v3/Nastaliq-Urdu_Regular-v3.zip)
[![Download Mehr Nastaliq](https://img.shields.io/badge/Download-Mehr%20Nastaliq-dark?style=plastic&logo=github)](https://github.com/Hassan-kareem/Nastaliq-Urdu_font/releases/download/MehrNastaliq/Mehr_Nastaliq-v1.zip)
[![Download Noto Nastaliq Urdu](https://img.shields.io/badge/Download-Noto%20Nastaliq%20Urdu-orange?style=plastic&logo=github)](https://github.com/Hassan-kareem/Nastaliq-Urdu_font/releases/download/NotoNastaliq-v3.0/NotoNastaliqUrdu-v3.0.zip)
[![Download Noori Kasheeda](https://img.shields.io/badge/Download-Noori%20Kasheeda-brightgreen?style=plastic&logo=github)](https://github.com/Hassan-kareem/Nastaliq-Urdu_font/releases/download/Noori-Kasheeda-v5.0/Nastaliq-Urdu_Kasheeda-v5.0.zip)
[![Download Noori Regular](https://img.shields.io/badge/Download-Noori%20Regular-darkgreen?style=plastic&logo=github)](https://github.com/Hassan-kareem/Nastaliq-Urdu_font/releases/download/Noori-Regular-v5.0/Nastaliq-Urdu_Regular-v5.0.zip)
[![Download Mehr Nastaliq](https://img.shields.io/badge/Download-Mehr%20Nastaliq-dark?style=plastic&logo=github)](https://github.com/Hassan-kareem/Nastaliq-Urdu_font/releases/download/MehrNastaliq-v3.0/Mehr_Nastaliq-Urdu-v3.0.zip)
[![XDA Thread](https://img.shields.io/badge/XDA%20Thread-Visit%20Now-green?style=plastic)](https://xdaforums.com/t/module-font-nastaliq-urdu-font.4645787/)

1. **Download:** Obtain the latest zip from Releases: [Noto Nastaliq Urdu](https://github.com/Hassan-kareem/Nastaliq-Urdu_font/releases/download/NotoNastaliq-v1/NotoNastaliqUrdu-v1.zip).
1. **Download:** Obtain the latest zip from Releases: [Noto Nastaliq Urdu](https://github.com/Hassan-kareem/Nastaliq-Urdu_font/releases/download/NotoNastaliq-v3.0/NotoNastaliqUrdu-v3.0.zip), [Kasheeda](https://github.com/Hassan-kareem/Nastaliq-Urdu_font/releases/download/Noori-Kasheeda-v5.0/Nastaliq-Urdu_Kasheeda-v5.0.zip) or [Regular](https://github.com/Hassan-kareem/Nastaliq-Urdu_font/releases/download/Noori-Regular-v5.0/Nastaliq-Urdu_Regular-v5.0.zip), [Mehr Nastaliq](https://github.com/Hassan-kareem/Nastaliq-Urdu_font/releases/download/MehrNastaliq-v3.0/Mehr_Nastaliq-Urdu-v3.0.zip)
2. **Flash:** Install the downloaded file using Magisk or KernelSU.

> [!NOTE]
Expand Down
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
I have a YouTube Channel!
If you have any questions, use the following link to comment:

https://www.youtube.com/@HassansTechInsights

# v3.0
- Added support for Android 15
6 changes: 6 additions & 0 deletions update.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"version": "3.0",
"versionCode": 300,
"zipUrl": "https://github.com/Hassan-kareem/Nastaliq-Urdu_font/releases/download/NotoNastaliq-v3.0/NotoNastaliqUrdu-v3.0.zip",
"changelog": "https://raw.githubusercontent.com/Hassan-kareem/Nastaliq-Urdu_font/NotoNastaliqUrdu/changelog.md"
}

0 comments on commit a22e03b

Please sign in to comment.