> 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/40-step-4-how-to-configure-an-italic-variable-font-using-fontspec.md).

# الخطوة 4: كيفية تهيئة خط متغير مائل باستخدام fontspec

[مقدمة](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)

في هذه الخطوة، سنُهيّئ خطًا متغيرًا مائلًا لإصلاح أحد تحذيرات «الشكل غير المعرّف» الثلاثة.

## ملخص تحذيرات «الشكل غير المعرّف» في مشروعنا

يحذّر LaTeX حاليًا من أن ثلاثة أشكال خطوط مفقودة من مشروعنا:

![صورة تُظهر تحذيرات LaTeX الخاصة بغياب الخطوط.](/files/72b27ea4047c311a8440d02ec04bd95fc0c207b2)

هذه مُلخَّصة في الجدول أدناه، لكن تذكّر أن m تُحذف من معرّف السلسلة *باستثناء* حيث *كلا* فإن العرض والوزن هما m (متوسط). في هذه المقالة سنُظهر كيف نصلح التحذير الثاني بإضافة خط بوزن متوسط، وعرض متوسط، وبالشكل المائل.

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

## ملفّان للخط Noto Serif

غالبًا ما يكون تصميم أنماط الخطوط القائمة والمائلة (الطرازات) مختلفًا جدًا بحيث لا يسمح بانتقال سلس بينهما عبر محور تصميم في خط متغير. يحتاج كلٌّ من الشكل القائم والشكل المائل إلى ملف خط مخصص للحفاظ على الخصائص الفريدة لتصميمهما. ونتيجةً لذلك، يحتوي مشروع Overleaf التعليمي على الملفات التالية لـ Noto Serif:

* للشكل القائم: `NotoSerif-VariableFont-wdth-wght.ttf`
* للشكل المائل: `NotoSerif-Italic-VariableFont-wdth-wght.ttf`

## كيفية إضافة خط Noto Serif المائل

يُهيَّأ خط النص الرئيسي في مستندنا، Noto Serif، باستخدام `\setmainfont` الأمر:

```
\setmainfont{NotoSerif-VariableFont-wdth-wght.ttf}
```

تذكيرًا، `\setmainfont` له الصيغة العامة

```
\setmainfont{⟨font⟩}[⟨font features⟩]
```

يمكننا استخدام `⟨ميزات الخط⟩` لتمكين شكل مائل لخط المستند الرئيسي باستخدام مفتاح `ItalicFont` .

### تهيئة خط متغير مائل

اتبع الخطوات التالية لتفعيل (تهيئة) خط Noto Serif المتغير المائل.

1. تأكد من فتح مشروع الدرس التطبيقي المُهيأ في الخطوة 3.
2. استبدل هذا السطر

```
\setmainfont{NotoSerif-VariableFont-wdth-wght.ttf}
```

بالسطر التالي

```
\setmainfont{NotoSerif-VariableFont-wdth-wght.ttf}
[
ItalicFont=NotoSerif-Italic-VariableFont-wdth-wght.ttf
]
```

6. أعِد الترجمة ولاحظ النقاط التالية.

* هناك تحذيران بالشكل غير المعرّف، أي أقل بواحد مما سبق:

![صورة تُظهر تحذيرات LaTeX الخاصة بغياب الخطوط.](/files/b51762bc88d3652d3e757f62cacf67beb6c494c1)

تنجم هذه التحذيرات عن عدم وجود خطوط عريضة للأشكال الخطية العادية (n) والمائلة (it).

* لم يعد التحذير التالي يظهر:

``شكل الخط `TU/NotoSerif-VariableFont-wdth-wght.ttf(0)/m/it' غير مُعرّف``

* عاد النص المائل للظهور في المستند المُنسَّق لأن LaTeX أصبح الآن لديه وصول إلى خط بوزن متوسط وعرض متوسط (سلسلة) وبشكل مائل في `NotoSerif-VariableFont-wdth-wght.ttf(0)` العائلة.

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

في الخطوة 5 نتعرف على أوزان الخطوط المتغيرة، استعدادًا للخطوة 6 حيث نُكمل الإعداد الأولي لخطوطنا المتغيرة.


---

# 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/40-step-4-how-to-configure-an-italic-variable-font-using-fontspec.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.
