> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/latex/ar/mqalat-mtamqh/43-step-7-using-noto-sans-and-roboto-mono-variable-fonts-with-latex.md).

# الخطوة 7: استخدام الخطوط المتغيرة Noto Sans وRoboto Mono مع LaTeX

[مقدمة](https://www.overleaf.com/learn/latex/Articles/How_to_use_OpenType_variable_fonts_with_LaTeX?preview=true) [الخطوة 1](https://www.overleaf.com/learn/latex/Articles/Step_1:_Setting_up_an_Overleaf_project_to_use_variable_fonts?preview=true) [الخطوة 2](https://www.overleaf.com/learn/latex/Articles/Step_2:_An_introduction_to_LaTeX_fonts?preview=true) [الخطوة 3](https://www.overleaf.com/learn/latex/Articles/Step_3:_Replacing_LaTeX’s_default_fonts_with_variable_fonts?preview=true) [الخطوة 4](https://www.overleaf.com/learn/latex/Articles/Step_4:_How_to_configure_an_italic_variable_font_using_fontspec?preview=true) [الخطوة 5](https://www.overleaf.com/learn/latex/Articles/Step_5:_LaTeX_font_weights_and_named_instances_of_variable_fonts?preview=true) [الخطوة 6](https://www.overleaf.com/learn/latex/Articles/Step_6:_Using_variable_fonts_to_add_bold_fonts_to_an_Overleaf_project?preview=true) [الخطوة 7](https://www.overleaf.com/learn/latex/Articles/Step_7:_Using_Noto_Sans_and_Roboto_Mono_variable_fonts_with_LaTeX?preview=true) [الخطوة 8](https://www.overleaf.com/learn/latex/Articles/Step_8:_How_to_create_a_simple_LaTeX_package_to_configure_your_variable_fonts?preview=true) [أمثلة ومشاريع](https://www.overleaf.com/learn/latex/Articles/Overleaf_projects_showing_how_to_use_variable_fonts_with_LaTeX?preview=true)

في هذه الخطوة نقوم بتهيئة أنماط الخط العريض والمائل والمائل العريض لكلٍّ من Noto Sans وRoboto Mono، ونوضح استخدامهما في تنضيد الأحرف الكبيرة الصغيرة العادية والمائلة والعريضة والمائلة العريضة.

افتح مشروع Overleaf الحالي الذي تم تهيئته في الخطوة 6.

## تهيئة Noto Sans وRoboto Mono

نريد تفعيل أنماط الخط العريض والمائل والمائل العريض لكلٍّ من Noto Sans وRoberto Mono. وتُوجَز هذه المتطلبات في الجدول التالي باستخدام مُعرِّفات السلسلة والشكل القياسية في LaTeX. تذكّر أن m تُحذف من معرّف السلسلة *باستثناء* حيث *كلا* العرض والوزن هما m (متوسط).

| **وصف الخط**                                      | **معرّف السلسلة** | **الوزن** | **العرض** | **الشكل** |
| ------------------------------------------------- | ----------------- | --------- | --------- | --------- |
| خط بوزن عريض وعرض متوسط وبالشكل العادي (المستقيم) | b                 | b         | m         | n         |
| خط بوزن متوسط وعرض متوسط وبالشكل المائل           | m                 | m         | m         | م         |
| خط بوزن عريض وعرض متوسط وبالشكل المائل            | b                 | b         | m         | م         |

توضح الأقسام التالية كيفية تهيئة Noto Sans وRoberto Mono لاستخدام سلاسل الخطوط والأشكال هذه. يوضح القسم [دمج كل ذلك معًا](#putting-it-all-together) كيفية تفعيل أشكال الخط هذه باستخدام `\setsansfont` و `\setmonofont` الأوامر.

### اختيار قيمة لمحور الوزن للوزنين المتوسط والعريض

سنبدأ باختيار قيم لمحور الوزن لتعريف مثيلات بوزن متوسط وعريض (رابط إلى قسم الدرس) لكلٍّ من Noto Sans وRoberto Mono. إن [محور الوزن في Noto Sans](https://fonts.google.com/specimen/Noto+Sans/tester) يتراوح من 100 إلى 900، بينما [Roboto Mono](https://fonts.google.com/specimen/Roboto+Mono/tester) يتراوح من 100 إلى 700، مما يشير إلى قيم الوزن التالية:

| **اسم الخط** | **الوزن المتوسط** | **الوزن العريض** |
| ------------ | ----------------- | ---------------- |
| Noto Sans    | 400               | 600              |
| Roboto Mono  | 300               | 550              |

### تهيئة خط مائل بوزن متوسط لكلٍّ من Noto Sans وRoboto Mono

لإضافة الخطوط المائلة نستخدم المفتاح `ItalicFont` في fontspec، والذي يأتي بالشكل

```
ItalicFont=⟨اسم الخط⟩
```

حيث إن ⟨اسم الخط⟩ هو اسم خط، أو اسم ملف خط.

يحتوي `VariableFonts` مجلد مشروع Overleaf على ملفات الخطوط المائلة التي نحتاج إلى استخدامها:

* NotoSans-Italic-VariableFont-wdth-wght.ttf
* RobotoMono-VariableFont-wght.ttf

وباستخدام هذه الأسماء للملفات وقيم محور الوزن المذكورة أعلاه، يمكن إضافة الخطوط المائلة بوزن متوسط باستخدام الأوامر الموضحة في الأقسام التالية.

#### إعدادات خطوط Noto Sans المستقيمة والمائلة بوزن متوسط

بالنسبة إلى Noto Sans، سيُضاف الكود التالي إلى مقدمة المستند (انظر القسم [دمج كل ذلك معًا](#putting-it-all-together)).

```latex
\setsansfont{NotoSans-VariableFont-wdth-wght.ttf}[
Weight=400,
ItalicFont=NotoSans-Italic-VariableFont-wdth-wght.ttf
]
```

#### إعدادات خطوط Roboto Mono المستقيمة والمائلة بوزن متوسط

بالنسبة إلى Roboto Mono، سيُضاف الكود التالي إلى مقدمة المستند (انظر القسم [دمج كل ذلك معًا](#putting-it-all-together)).

```latex
\setmonofont{RobotoMono-VariableFont-wght.ttf}[
Weight=300,
ItalicFont=RobotoMono-Italic-VariableFont-wght.ttf
]
```

### تهيئة الخطين العريض والمائل العريض لكلٍّ من Noto Sans وRoboto Mono

كما هو موضح في الخطوة XXX (رابط) سنضيف الخطوط العريضة باستخدام المفتاح `FontFace` في fontspec، والذي يأتي بالشكل التالي

```
FontFace = {⟨series⟩}{⟨shape⟩}{ Font = ⟨font name⟩ , ⟨features⟩ }
```

حيث

* `⟨series⟩` هو مُعرّف سلسلة LaTeX (رابط إلى القسم)
* `⟨shape⟩` هو مُعرّف شكل LaTeX (رابط إلى القسم)
* `⟨font name⟩` هو اسم ملف خط أو اسم خط
* `⟨features⟩` تحتوي على الإعدادات التي سنستخدمها لتهيئة خطوطنا المتغيرة، مثل تعيين قيم لمحور العرض أو الوزن

#### إعدادات خطوط Noto Sans العريضة والمائلة العريضة

بالنسبة للشكل العادي (المستقيم) بوزن عريض لدينا:

* `⟨series⟩` = b
* `⟨shape⟩` = n
* `⟨font name⟩` = NotoSans-VariableFont-wdth-wght.ttf
* `⟨features⟩` = Weight=600

فينتج عن ذلك

```
FontFace = {b}{n}{Font = NotoSans-VariableFont-wdth-wght.ttf, Weight=600}
```

بالنسبة للشكل المائل بوزن عريض:

* `⟨series⟩` = b
* `⟨shape⟩` = it
* `⟨font name⟩` = NotoSans-VariableFont-wdth-wght.ttf
* `⟨features⟩` = Weight=600

فينتج عن ذلك

```
FontFace = {b}{it}{Font = NotoSans-VariableFont-wdth-wght.ttf, Weight=600}
```

#### إعدادات خطوط Roboto Mono العريضة والمائلة العريضة

بالنسبة للشكل العادي (المستقيم) بوزن عريض لدينا:

* `⟨series⟩` = b
* `⟨shape⟩` = n
* `⟨font name⟩` = RobotoMono-VariableFont-wght.ttf
* `⟨features⟩` = Weight=550

فينتج عن ذلك

```
FontFace = {b}{n}{Font = RobotoMono-VariableFont-wght.ttf, Weight=550}
```

أما بالنسبة للشكل المائل بوزن عريض لدينا:

* `⟨series⟩` = b
* `⟨shape⟩` = it
* `⟨font name⟩` = RobotoMono-VariableFont-wght.ttf
* `⟨features⟩` = Weight=550

فينتج عن ذلك

```
FontFace = {b}{it}{Font = RobotoMono-VariableFont-wght.ttf, Weight=550}
```

## دمج كل ذلك معًا

لتطبيق الإعدادات التي نوقشت أعلاه، افتح مشروع Overleaf الحالي واستبدل `\setsansfont` و `\setmonofont` الأوامر الموجودة بالإصدارات التالية.

```latex
% خط عائلة المستند sans serif
\setsansfont{NotoSans-VariableFont-wdth-wght.ttf}[
Weight=400,
ItalicFont=NotoSans-Italic-VariableFont-wdth-wght.ttf,
FontFace = {b}{n}{Font = NotoSans-VariableFont-wdth-wght.ttf, Weight=600},
FontFace = {b}{it}{Font =NotoSans-Italic-VariableFont-wdth-wght.ttf,Weight=600}
]
```

```latex
% خط عائلة المستند monospace
\setmonofont{RobotoMono-VariableFont-wght.ttf}[
Weight=400,
ItalicFont=RobotoMono-Italic-VariableFont-wght.ttf,
FontFace = {b}{n}{Font =RobotoMono-VariableFont-wght.ttf, Weight=550},
FontFace = {b}{it}{Font = RobotoMono-Italic-VariableFont-wght.ttf, Weight=550}
]
```

## كيفية استخدام خطوطنا الجديدة

باستخدام fontspec قمنا بتهيئة الخطوط العريضة والمائلة والمائلة العريضة لجميع عائلات خطوط المستند الثلاث. بالإضافة إلى الخطوط التي قمنا بتهيئتها، فعّل fontspec أيضًا نسخ الأحرف الكبيرة الصغيرة كما يمكن رؤيته من خلال لصق الكود التالي في مستندك (بعد \begin{document}):

```latex
\begin{itemize}
\item عائلة النص الأساسي (Noto Serif):
\begin{itemize}
    \item \textsc{الأحرف الكبيرة الصغيرة العادية}
    \item \textit{\scshape الأحرف الكبيرة الصغيرة المائلة}  
    \item \textbf{\scshape الأحرف الكبيرة الصغيرة العريضة}
    \item \textbf{\itshape\scshape الأحرف الكبيرة الصغيرة العريضة المائلة}
\end{itemize}
\item عائلة sans serif (Noto Sans):
\begin{itemize}
    \item \textsc{\sffamily الأحرف الكبيرة الصغيرة العادية}
    \item \textit{\sffamily\scshape الأحرف الكبيرة الصغيرة المائلة}  
    \item \textbf{\sffamily\scshape الأحرف الكبيرة الصغيرة العريضة}
    \item \textbf{\sffamily\itshape\scshape الأحرف الكبيرة الصغيرة العريضة المائلة}
\end{itemize}
\item عائلة الأحرف أحادية المسافة (Roboto Mono):
\begin{itemize}
    \item \textsc{\ttfamily الأحرف الكبيرة الصغيرة العادية}
    \item \textit{\ttfamily\scshape الأحرف الكبيرة الصغيرة المائلة}  
    \item \textbf{\ttfamily\scshape الأحرف الكبيرة الصغيرة العريضة}
    \item \textbf{\ttfamily\itshape\scshape الأحرف الكبيرة الصغيرة العريضة المائلة}
\end{itemize}
```

ينتج هذا الكود المخرجات التالية

![صورة تُظهر تنضيد الأحرف الكبيرة الصغيرة بشكل عادي وعريض وعريض مائل باستخدام عائلات خطوط المستند الثلاث جميعها.](/files/51d1cc9c50dc6504369d48796720e97fb8342304)

## في الخطوة التالية

أصبح مقدّمة مستند مشروعنا الآن مزدحمةً بالكثير من كود تهيئة fontspec. في الخطوة 8، ننقل كود إعداد fontspec إلى مشروع بسيط، مما يؤدي إلى تبسيط مقدمة المستند وجعل تحديث خطوطنا أسهل.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/latex/ar/mqalat-mtamqh/43-step-7-using-noto-sans-and-roboto-mono-variable-fonts-with-latex.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
