Skip to content

Commit

Permalink
Added support for Arabic fonts through Noto Naskh Arabic.
Browse files Browse the repository at this point in the history
  • Loading branch information
eahmed234 committed Dec 14, 2023
1 parent f9b16d7 commit 20cb388
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 0 deletions.
5 changes: 5 additions & 0 deletions includes/SkinCitizen.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,10 @@ private function buildSkinFeatures( array &$options ) {
if ( $this->getConfigValue( 'CitizenEnableCJKFonts' ) === true ) {
$options['styles'][] = 'skins.citizen.styles.fonts.cjk';
}

// AR fonts
if ( $this->getConfigValue( 'CitizenEnableARFonts' ) === true ) {
$options['styles'][] = 'skins.citizen.styles.fonts.ar';
}
}
}
10 changes: 10 additions & 0 deletions resources/skins.citizen.styles.fonts.ar/ar.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* stylelint-disable function-url-quotes */

/* [0] */
@font-face {
font-family: 'Noto Naskh Arabic';
font-style: normal;
font-weight: 100 1000;
src: url( 'fonts/NotoNaskhArabic[wght].woff2' ) format( 'woff2-variations' );
font-display: swap;
}
Binary file not shown.
12 changes: 12 additions & 0 deletions resources/skins.citizen.styles.fonts.ar/index.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Name: Noto Naskh Arabic
* Version: 568609b
* Link: https://github.com/notofonts/arabic/tree/main
* Axis: wght
*/

@import 'ar.less';

:root {
--font-family-language-base: 'Noto Naskh Arabic';
}
22 changes: 22 additions & 0 deletions skin.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,22 @@
"resources/skins.citizen.styles.fonts.cjk/index.less"
]
},
"skins.citizen.styles.fonts.ar": {
"class": "ResourceLoaderSkinModule",
"targets": [
"desktop",
"mobile"
],
"features": {
"accessibility": false,
"content-body": false,
"interface-core": false,
"toc": false
},
"styles": [
"resources/skins.citizen.styles.fonts.ar/index.less"
]
},
"skins.citizen.scripts": {
"packageFiles": [
"resources/skins.citizen.scripts/skin.js",
Expand Down Expand Up @@ -629,6 +645,12 @@
"descriptionmsg": "citizen-config-enablecjkfonts",
"public": true
},
"EnableARFonts": {
"value": false,
"description": "Enable included Noto Naskh Arabic for wikis that serve Arabic",
"descriptionmsg": "citizen-config-enablearfonts",
"public": true
},
"EnablePreferences": {
"value": true,
"description": "Enables or disable preferences module",
Expand Down

0 comments on commit 20cb388

Please sign in to comment.