A community-maintained open-source font for the Saudi Riyal currency symbol.
This font allows you to use the Saudi Riyal symbol in websites, applications, and documents, ensuring compatibility where the symbol is not natively supported.
π¦ Package Information
π Repository Stats
π Compatibility
π Project Status
π₯ Social
π Check out the live demo here:
π Saudi Riyal Font Demo
Below is a screenshot of the example demo page:
π Cross-Platform Compatibility β Works on Windows, macOS, Linux, Web, and Mobile.
π Unicode Private Use Area (U+E900
) β Ensures seamless integration.
π Web-Optimized β Includes .woff
, .woff2
, and .ttf
formats for fast loading.
π NPM Support β Easily install via NPM for web projects.
π CDN Hosting β Use without installation via jsDelivr or unpkg.
π Open Source & Free β Released under the SIL Open Font License (OFL).
π Customizable β Modify and enhance as needed.
The easiest way to use this font in a web project is by installing it via NPM:
npm install @emran-alhaddad/saudi-riyal-font
Then, import it in your project:
import '@emran-alhaddad/saudi-riyal-font/index.css';
Use it in HTML:
<span class="icon-saudi_riyal"></span>
Alternatively, insert the symbol using Unicode:
<span style="font-family: 'saudi_riyal'"></span>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@emran-alhaddad/saudi-riyal-font/index.css">
<link rel="stylesheet" href="https://unpkg.com/@emran-alhaddad/saudi-riyal-font/index.css">
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Saudi Riyal Font Demo</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@emran-alhaddad/saudi-riyal-font/index.css">
</head>
<body>
<h1>Saudi Riyal Font Demo</h1>
<p>Price: <span class="icon-saudi_riyal"></span> 100</p>
</body>
</html>
Important note for React Native / Expo users
The JavaScript entry point of this package uses the browser URL
API to locate font assets. When running under ReactΒ Native with the Hermes engine (for example, Expo SDKΒ 53), the URL
API is not implemented. This causes an error like:
ERROR [runtime not ready]: Error: URL.protocol is not implemented, js engine: hermes
ERROR [runtime not ready]: Invariant Violation: "main" has not been registered.
To use the Saudi Riyal Font in ReactΒ Native or Expo:
-
Install a URL polyfill (recommended) Install
react-native-url-polyfill
and import it before any other code. This polyfillsURL.protocol
and related methods so Hermes can run code that depends on theURL
API.npm install react-native-url-polyfill
// In your entry file (e.g. index.js or App.tsx) import 'react-native-url-polyfill/auto'; // ...rest of your imports
-
Load the font file directly Alternatively, skip the JavaScript entry point of this package and load the
.ttf
file directly withexpo-font
:import { useFonts } from 'expo-font'; // Adjust the path to the TTF file as needed const [loaded] = useFonts({ SaudiRiyal: require('./node_modules/@emran-alhaddad/saudi-riyal-font/fonts/saudi_riyal.ttf'), });
Once the font is loaded, apply it by name in your styles.
For more details or to track progress on ReactΒ Native support, see issue #19.
π Download Saudi Riyal Font
- Download
saudi_riyal.ttf
from the link above. - Right-click the file and select "Install".
- Open Microsoft Word, Photoshop, or any editor, select "Saudi Riyal" as the font.
- Type
E900
and pressAlt + X
to display the Saudi Riyal symbol.
- Download
saudi_riyal.ttf
from the link above. - Double-click the file and select "Install Font".
- Open any text editor (e.g., Pages, Photoshop), select "Saudi Riyal" as the font.
- Type
E900
to insert the Riyal symbol.
-
Copy the font to your local fonts directory:
cp saudi_riyal.ttf ~/.fonts/ fc-cache -fv
-
Use it in applications that support custom fonts.
- Download
saudi_riyal.ttf
to your phone. - Android: Use iFont or FontFix apps to install.
- iOS: Install via iFont or a font management app.
- Use in supported apps like Word, Photoshop, or Notes.
We welcome contributions! To contribute:
- Fork this repository.
- Make your changes (improve the font, add glyphs).
- Submit a Pull Request for review.
If you find issues, please report them via the Issues section.
This font is released under the SIL Open Font License (OFL). β Attribution is required!
π Created by: Emran Alhaddad π§ Contact: [email protected]
π’ Any usage, modification, or distribution must credit the original creator.
Saudi Riyal Font Β© Emran Alhaddad - Used under SIL Open Font License 1.1
π© For questions, feedback, or collaborations, reach out via GitHub Issues or email at [email protected].
π Enjoy the Saudi Riyal Font!