# @emran-alhaddad/saudi-riyal-font 中文文档

规范地址：https://npmcn.com/package/%40emran-alhaddad/saudi-riyal-font/

版本：1\.1\.0
npm 元数据更新时间：2025-09-08T11:39:53.679Z
中文译文更新时间：2026-11-13T15:55:54.547Z
软件包许可：OFL-1\.1

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40emran-alhaddad/saudi-riyal-font
原文对照：https://npmcn.com/package/%40emran-alhaddad/saudi-riyal-font/?lang=original
项目主页：https://github.com/emran-alhaddad/Saudi-Riyal-Font#readme
源码仓库：https://github.com/emran-alhaddad/Saudi-Riyal-Font

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：3.7 MB，27 个文件
- TypeScript 类型：未声明
- 运行依赖：0 个
- 首次发布：2025-02-25T14:50:22.189Z
- 最新版本发布：2025-09-08T11:39:53.508Z
- 近 30 天下载量：23777（2026-10-14 至 2026-11-12，npm 官方下载统计）
- 已发布版本数：4（近 12 个月 0 个）

## 中文简介

沙特里雅尔货币符号的官方开源字体.

## 安装

```sh
npm install @emran-alhaddad/saudi-riyal-font
```

也可以使用：`pnpm add @emran-alhaddad/saudi-riyal-font`、`yarn add @emran-alhaddad/saudi-riyal-font`、`bun add @emran-alhaddad/saudi-riyal-font`

## README

# 沙特里亚尔字体

**一个社区维护沙特里亚尔货币符号的开源字体.**

这个软件包提供了web ,mobile 和桌面 已准备好的字体来显示沙特里雅尔货币符号. 它使得货币符号甚至在您的平台或操作系统支持其本土化之前就可以使用. 两者兼有的字体船 **常设经常** 财务报告和审定财务报表 **粗体** 重量和支持两个不同的代码点:

-   **铀+20C1** – 即将到来的沙特里雅尔标志被计划以Unicode 17编码. 这是该符号的官方拟议代码点并被推荐用于新项目.
-   **铀+E900** - 一个私人密码点 这个字体的旧版本使用U+E900作为占位符,直到Unicode在货币符号块中指定了代码点. 对于后向兼容,您可以继续使用;但是,如果可能,您应该迁移到 **铀+20C1**。 。 。 .

![Saudi Riyal Symbol](https://npmcn.com/package/%40emran-alhaddad/saudi-riyal-font/examples/saudi_riyal-sample.jpg)

* * *

## 软件包信息

[![NPM Version](https://img.shields.io/npm/v/@emran-alhaddad/saudi-riyal-font)](https://www.npmjs.com/package/@emran-alhaddad/saudi-riyal-font) [![NPM Downloads](https://img.shields.io/npm/dt/@emran-alhaddad/saudi-riyal-font?label=npm%20downloads)](https://www.npmjs.com/package/@emran-alhaddad/saudi-riyal-font) [![jsDelivr Hits](https://img.shields.io/jsdelivr/npm/hm/@emran-alhaddad/saudi-riyal-font)](https://www.jsdelivr.com/package/npm/@emran-alhaddad/saudi-riyal-font) [![Font Size](https://img.shields.io/badge/Font%20Size-Lightweight-success)](https://github.com/emran-alhaddad/Saudi-Riyal-Font) [![Unicode](https://img.shields.io/badge/Unicode-U%2BE900%20%7C%20U%2B20C1-blueviolet)](https://emran-alhaddad.github.io/Saudi-Riyal-Font/examples/demo.html)

## \* \* \* 存储器

[![GitHub Stars](https://img.shields.io/github/stars/emran-alhaddad/Saudi-Riyal-Font)](https://github.com/emran-alhaddad/Saudi-Riyal-Font/stargazers) [![GitHub Forks](https://img.shields.io/github/forks/emran-alhaddad/Saudi-Riyal-Font)](https://github.com/emran-alhaddad/Saudi-Riyal-Font/network/members) [![GitHub Issues](https://img.shields.io/github/issues/emran-alhaddad/Saudi-Riyal-Font)](https://github.com/emran-alhaddad/Saudi-Riyal-Font/issues) [![Code Size](https://img.shields.io/github/languages/code-size/emran-alhaddad/Saudi-Riyal-Font)](https://github.com/emran-alhaddad/Saudi-Riyal-Font) [![Contributors](https://img.shields.io/github/contributors/emran-alhaddad/Saudi-Riyal-Font)](https://github.com/emran-alhaddad/Saudi-Riyal-Font/graphs/contributors) [![GitHub release](https://img.shields.io/github/release/emran-alhaddad/Saudi-Riyal-Font)](https://github.com/emran-alhaddad/Saudi-Riyal-Font/releases) [![GitHub last commit](https://img.shields.io/github/last-commit/emran-alhaddad/Saudi-Riyal-Font)](https://github.com/emran-alhaddad/Saudi-Riyal-Font/commits)

## 兼容性

[![Browsers Support](https://img.shields.io/badge/Browsers-Chrome%20%7C%20Firefox%20%7C%20Safari%20%7C%20Edge-brightgreen)](https://emran-alhaddad.github.io/Saudi-Riyal-Font/examples/demo.html) [![Platforms](https://img.shields.io/badge/Platforms-Windows%20%7C%20Mac%20%7C%20Linux%20%7C%20Android%20%7C%20iOS-blue)](https://github.com/emran-alhaddad/Saudi-Riyal-Font) [![TypeScript Ready](https://img.shields.io/badge/TypeScript-Ready-blue)](https://www.typescriptlang.org/)

## 项目状况

[![License](https://img.shields.io/badge/license-OFL--1.1-blue)](https://github.com/emran-alhaddad/Saudi-Riyal-Font/blob/main/LICENSE.txt) [![Website](https://img.shields.io/website?url=https%3A%2F%2Femran-alhaddad.github.io%2FSaudi-Riyal-Font%2Fexamples%2Fdemo.html)](https://emran-alhaddad.github.io/Saudi-Riyal-Font/examples/demo.html) [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/emran-alhaddad/Saudi-Riyal-Font/graphs/commit-activity) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/emran-alhaddad/Saudi-Riyal-Font/pulls) [![Open Source](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://opensource.org/)

## 现场直播

🎉 **看这里的现场演示:**  
🔗 [沙特里亚尔字体Demo](https://emran-alhaddad.github.io/Saudi-Riyal-Font/examples/demo.html)

以下是示例演示页的截图:

![Example Demo](https://npmcn.com/package/%40emran-alhaddad/saudi-riyal-font/examples/example-demo.png)

* * *

## \* 特性

👉 **交叉式相容性** – 在Windows,macOS,Linux,Web,和Mobile上工作.  
👉 **双码点** - 支持未来的Unicode代码点 `U+20C1` 和一个遗留下来的私人区域代码点 `U+E900`。 。 。 .  
👉 **常规粗体重( B)** – 有真实的正字形和粗体字体的船舶,用于一致的打字.  
👉 **网络化** - 包括 `.woff`, (中文(简体) ), `.woff2` 财务报告和审定财务报表 `.ttf` 用于快速加载的格式.  
👉 **国家预防机制支助** - 通过国家防范机制为网络项目轻松安装.  
👉 **CDN 托管** - 不安装即通过 **日记** 或者说 **(单位:公斤)**。 。 。 .  
👉 **打开源码自由( F)** - 释放 **SIL 开放字体许可证( OFL)**。 。 。 .  
👉 **可自定义** - 视需要修改和加强.

* * *

## 安装和使用

### 1️⃣ 通过国家预防机制安装(建议网络开发者使用)

安装软件包 :

```

npm install @emran-alhaddad/saudi-riyal-font

```

然后导入您工程中捆绑的样式表 :

```js
import "@emran-alhaddad/saudi-riyal-font/index.css";
```

使用 HTML 中的符号,方法是增加一个提供的图标类。 套接字定义了遗留下来的私用代码点和新的Unicode代码点的类:

```html
<!-- Private‑use code point (U+E900) -->
<span class="icon-saudi_riyal"></span> 100
<span class="icon-saudi_riyal_bold"></span> 100

<!-- New Unicode code point (U+20C1) -->
<span class="icon-saudi_riyal_new"></span> 100
<span class="icon-saudi_riyal_bold_new"></span> 100
```

每个类都使用相适应的字体重量和代码点. 您可以通过标准的 CSS 调整大小和颜色( 例如) `font-size` 或者说 `color`) (中文(简体) ).

* * *

### 通过 CDN (不需要安装) 使用网络

如果您不愿安装软件包, 您可以直接从 CDN 装入 CSS :

#### \* 使用 jsDelivr CDN

```html
<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/@emran-alhaddad/saudi-riyal-font/index.css" />
```

#### 使用 unpkg CDN

```html
<link
  rel="stylesheet"
  href="https://unpkg.com/@emran-alhaddad/saudi-riyal-font/index.css" />
```

然后可以使用上述相同的图标类.

* * *

### 3️⃣ 手动集成自定义 CSS

如果您正在手动嵌入字体( 例如在自定义工程中或在编译自己的 CSS 时), 请使用 `@font-face` 并选择您想要显示的代码点。 文件夹结构在 **1.1.0版 翻译**: 正常和粗体重量,现在生活在 `fonts/regular` 财务报告和审定财务报表 `fonts/bold`。 。 。 .

以下是如何为两个代码点加载重量并定义图标类的例子:

```css
@font-face {
  font-family: "saudi_riyal";
  src: url("fonts/regular/saudi_riyal.woff2") format("woff2"),
       url("fonts/regular/saudi_riyal.woff") format("woff"),
       url("fonts/regular/saudi_riyal.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "saudi_riyal_bold";
  src: url("fonts/bold/saudi_riyal.woff2") format("woff2"),
       url("fonts/bold/saudi_riyal.woff") format("woff"),
       url("fonts/bold/saudi_riyal.ttf") format("truetype");
  font-weight: bold;
  font-style: normal;
}

/* Legacy private‑use code point (U+E900) */
.icon-saudi_riyal::before {
  content: "\e900";
  font-family: "saudi_riyal" !important;
  font-size: inherit;
  color: inherit;
}

.icon-saudi_riyal_bold::before {
  content: "\e900";
  font-family: "saudi_riyal_bold" !important;
  font-size: inherit;
  color: inherit;
}

/* New Unicode currency sign (U+20C1).  Use this when your platform or font stack supports Unicode 17 or when you wish to future‑proof your site. */
.icon-saudi_riyal_new::after {
  content: "\20c1";
  font-family: "saudi_riyal" !important;
  font-size: inherit;
  color: inherit;
}

.icon-saudi_riyal_bold_new::after {
  content: "\20c1";
  font-family: "saudi_riyal_bold" !important;
  font-size: inherit;
  color: inherit;
}
```

在将此 CSS 添加到您的项目后, 在内置元素上使用相应的类( 例如 ) , `<span>` 或者说 `<i>`) (中文(简体) ). 例如:

```html
Price: <span class="icon-saudi_riyal_new"></span> 50.00
```

> **说明:** 如果符号在您的具体设计中显示的比周边文字略高,您可以用CSS来调整其垂直位置. 例如,将符号包入容器并使用 `vertical-align: -0.1em` 放在容器上把它推倒.

* * *

### \* 反应原生/展览使用

此软件包的 JavaScript 入口使用浏览器 `URL` API 查找字体资产 。 当在 React Natural 下运行时,使用Hermes 引擎(例如, Expo SDK 53) `URL` API没有执行. 这造成了如下错误:

```
ERROR [runtime not ready]: Error: URL.protocol is not implemented, js engine: hermes
ERROR [runtime not ready]: Invariant Violation: "main" has not been registered.
```

要在本地或博览会中使用沙特里雅尔字体:

1.  **安装 URL 多填充( 建议)** - 安装 [`react-native-url-polyfill`](https://github.com/zmotree/react-native-url-polyfill) 并在其他代码之前导入。 这种多填充 `URL.protocol` 和相关方法,使Hermes能够运行依赖于 `URL` API (英语).
    
    ```
    npm install react-native-url-polyfill
    ```
    
    ```js
    // In your entry file (e.g. index.js or App.tsx)
    import "react-native-url-polyfill/auto";
    // ...rest of your imports
    ```
    
2.  **直接装入字体文件** - 或者,跳过此软件包的 JavaScript 切入点并装入 `.ttf` 文件直接与 `expo-font`数字 :
    
    ```js
    import { useFonts } from "expo-font";
    // Adjust the path to the TTF files as needed
    const [loaded] = useFonts({
      SaudiRiyal: require("./node_modules/@emran-alhaddad/saudi-riyal-font/fonts/regular/saudi_riyal.ttf"),
      SaudiRiyalBold: require("./node_modules/@emran-alhaddad/saudi-riyal-font/fonts/bold/saudi_riyal.ttf"),
    });
    ```
    
    一旦字体被装入,请在样式中按名称应用. 对符号和周围的文字使用不同的字体家族来避免数字与符号结合后消失.
    

欲了解更多详情或跟踪React Independence支持的进展情况,请参见 [问题19](https://github.com/emran-alhaddad/Saudi-Riyal-Font/issues/19)。 。 。 .

* * *

### 4️⃣ 在Windows, Mac, Linux, Android & iOS 上下载并安装

如果您需要桌面或移动应用程序的字体, 您可以下载 `.ttf` 文档并手动安装。 这些文件生活在 `fonts/regular` 财务报告和审定财务报表 `fonts/bold` 此仓库中的目录 。 详细指示载于 [困难指南](https://npmcn.com/package/%40emran-alhaddad/saudi-riyal-font/TROUBLESHOOTING.md) 每个平台.

* * *

## QQ 解决问题和问题

如果遇到错误的符号等问题,请访问InfoFinland上的 `<select>` 元素、电子邮件模板、wkhtmltopdf、移动应用程序或覆盖字体的框架,请查阅 [解决问题指南](https://npmcn.com/package/%40emran-alhaddad/saudi-riyal-font/TROUBLESHOOTING.md)它从该项目的GitHub问题中收集已知的问题,并提供实际的变通办法.

* * *

## \* 发展和贡献

欢迎 **捐款**贡献:

1.  **叉头** 此仓库 .
2.  **做你的改变** (改进字体,更新示例,加入glyphs).
3.  **提交拉动请求** 供审查.

如果你发现问题,请通过 [问题](https://github.com/emran-alhaddad/Saudi-Riyal-Font/issues) 节。 在提交问题时,请描述环境、框架,并酌情提供代码片段。 这有助于我们迅速复制和解决问题.

* * *

## 许可证

此字体在 **SIL 开放字体许可证( OFL)**需要归属.

```
Saudi Riyal Font © Emran Alhaddad – Used under SIL Open Font License 1.1
```

* * *

## 联系人

关于问题、反馈或合作,请通过 [GitHub 问题](https://github.com/emran-alhaddad/Saudi-Riyal-Font/issues) 或电子邮件在 **[埃姆兰.alhaddad.dev@gmail.com](mailto:emran.alhaddad.dev@gmail.com)**。 。 。 .

* * *

🚀 **享受沙特里雅尔字体吧!**

## 常见问题

### @emran-alhaddad/saudi-riyal-font 是什么？

沙特里雅尔货币符号的官方开源字体\.

### 如何安装 @emran-alhaddad/saudi-riyal-font？

在项目目录运行 npm install @emran-alhaddad/saudi-riyal-font，或使用 pnpm add / yarn add / bun add。

### @emran-alhaddad/saudi-riyal-font 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/emran-alhaddad\_\_saudi-riyal-font 是否存在。

### @emran-alhaddad/saudi-riyal-font 可以商用吗？

@emran-alhaddad/saudi-riyal-font 使用 OFL-1\.1 许可。声明的许可为 OFL-1\.1，请阅读许可原文确认使用条件。以上为概括，不构成法律意见，请以许可原文为准。

### @emran-alhaddad/saudi-riyal-font 的下载量有多少？

根据 npm 官方下载统计，@emran-alhaddad/saudi-riyal-font 在 2026/10/14 – 2026/11/12 这 30 天内被下载 23,777 次，日均约 793 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @emran-alhaddad/saudi-riyal-font 还在维护吗？

最新版本 1\.1\.0 发布于 2025/09/08（1\.2 年前）；至今共发布 4 个版本，其中过去 12 个月发布了 0 个；首次发布于 2025/02/25。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

