> 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/37-step-1-setting-up-an-overleaf-project-to-use-variable-fonts.md).

# الخطوة 1: إعداد مشروع Overleaf لاستخدام الخطوط المتغيرة

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

لبدء هذا الدرس، افتح [مشروع Overleaf المرفق](https://www.overleaf.com/8438931911svtqtnmfvsrp#28008d) الذي يحتوي على الخطوط المتغيرة التالية:

* [Noto Serif](https://fonts.google.com/noto/specimen/Noto+Serif/tester) (نص المستند الرئيسي)
* [Noto Sans](https://fonts.google.com/noto/specimen/Noto+Sans/tester) (خط بلا زوائد)
* [Roboto Mono](https://fonts.google.com/specimen/Roboto+Mono/tester) (خط أحادي المسافة)

لم يتم إعداد هذه الخطوط بعد للاستخدام. في البداية، عند تجميع [مشروع Overleaf المرفق](https://www.overleaf.com/8438931911svtqtnmfvsrp#28008d)، ستُطبَّق خطوط النص القياسية (الافتراضية) في LaTeX. طوال هذا الدرس، ستتعلم كيفية استبدال هذه الخطوط الافتراضية بالخطوط المتغيرة المقدمة في مجلد المشروع المسمى `VariableFonts`.

إذا كنت تفضل استخدام خطوط متغيرة مختلفة، فاتبع التعليمات أدناه ببساطة. وإلا، فانتقل إلى [الخطوة 2](https://www.overleaf.com/learn/latex/Articles/Step_2:_An_introduction_to_LaTeX_fonts?preview=true) هذا الدرس.

## (اختياري) كيفية اختيار وتحميل الخطوط المتغيرة الخاصة بك

اتبع هذه الخطوات لتحميل الخطوط المتغيرة التي تختارها.

### 1. احصل على الخطوط المتغيرة من Google Fonts

[Google Fonts](https://fonts.google.com/) هو مورد ممتاز. وهو يوفّر [توثيقًا مفيدًا](https://fonts.google.com/knowledge/introducing_type/introducing_variable_fonts) والعديد من [الخطوط المتغيرة المجانية للاستخدام](https://fonts.google.com/?vfonly=true) التي يمكن رفعها إلى Overleaf وتهيئتها للاستخدام في مشاريعك.

* **نصيحة**: استخدم عوامل تصفية Google Fonts للعثور على الخطوط المتغيرة. اضبط عامل التصفية *التقنية* على *متغير* لعرض الخطوط المتغيرة فقط. استخدم عوامل تصفية إضافية، مثل *خطوط ذات زوائد*، لتضييق نطاق بحثك أكثر.

![صورة تعرض عوامل تصفية البحث في Google Fonts](/files/6be19c9ffa134eb60c221a3d50ddddac012c05e1)

* **نصيحة**: يمكنك تصفح الخطوط المتغيرة بناءً على محاور التصميم التي تدعمها: انظر <https://fonts.google.com/variablefonts>. كما توفر Google تعريفات لمحاور تصميم الخطوط المتغيرة: انظر <https://fonts.google.com/variablefonts#axis-definitions>.
* بعد تحديد أي خطوط متغيرة تريد استخدامها، نزّلها إلى جهازك المحلي وأعد تسمية أي ملفات تحتوي على أحرف إشكالية.
* تتكوّن بعض الخطوط المتغيرة من `.ttf` ملفين: أحدهما للشكل العمودي (العادي)، وإذا توفر، آخر للشكل المائل. تأكد من التحقق من ذلك لكل خط تقوم بتنزيله.

### 2. أعد تسمية أسماء ملفات خطوط Google الإشكالية

يتضمن نظام Google لتسمية ملفات الخطوط المتغيرة محاور التصميم الخاصة بالخط، مفصولة بفواصل. وللأسف، يتسبب هذا النظام في مشاكل مع fontspec، وهي حزمة أساسية لاستخدام الخطوط المتغيرة مع LuaLaTeX. على سبيل المثال، يوفّر Noto Serif محوري العرض والوزن، ويأتي في ملفين—أحدهما للخط العمودي والآخر للخط المائل:

* NotoSerif-VariableFont\_wdth,wght.ttf
* NotoSerif-Italic-VariableFont\_wdth,wght.ttf

تؤدي الفواصل في أسماء هذه الملفات إلى أخطاء عند استخدامها في الأمر `\setmainfont` في fontspec. على سبيل المثال، تؤدي كتابة

```
\setmainfont{NotoSerif-VariableFont_wdth,wght.ttf}
[ItalicFont = NotoSerif-Italic-VariableFont_wdth,wght.ttf]
```

إلى ظهور أخطاء تتضمن

```
! Package fontspec Error: The font "NotoSerif-Italic-VariableFont_wdth" cannot
(fontspec)                العثور عليه.

! LaTeX Error: The key 'fontspec-opentype/wght.ttf' is unknown and is being
(LaTeX)        تجاهله.
```

لحل هذه المشكلة، تحتاج إلى إعادة تسمية ملفات الخطوط لإزالة الفواصل (والشرطات السفلية '\_')، واستبدالها بحرف «آمن» مثل الشرطات (-)، مع التأكد من عدم إضافة أي مسافات. على سبيل المثال، يمكنك إعادة تسمية:

* NotoSans-VariableFont\_wdth,wght.ttf

إلى

* NotoSans-VariableFont-wdth-wght.ttf

ستساعدك خطوة إعادة التسمية البسيطة هذه على تجنب التعارضات وضمان التكامل السلس للخطوط المتغيرة في مستندات LaTeX الخاصة بك.

### 3. أنشئ مشروع Overleaf جديدًا

* أنشئ مشروع Overleaf جديدًا و [اضبط المترجم على LuaLaTeX](/latex/ar/qaadh-almarfh/026-changing-compiler.md) لأنه المترجم الوحيد الذي يدعم الخطوط المتغيرة.
* أضف `fontspec` الحزمة إلى مقدمة مستندك بكتابة `\usepackage{fontspec}`.
* اختر رمز رفع الملف (![Image displaying Overleaf file-upload icon](/files/69509257dc54c53003bf68d5f500662252826e90)) لإضافة ملفات الخطوط المتغيرة المعاد تسميتها محليًا إلى مشروعك الجديد:

![صورة توضح كيفية رفع ملف إلى مشروع Overleaf](/files/994dc66533a26042121772020fb68bda17e0c2d2)

### 4. (اختياري) نظم ملفات الخطوط في مشروعك

إذا كنت تريد تجربة مجموعة من الخطوط، على سبيل المثال عند اختبار تصاميم المستندات، فمن المفيد تنظيم ملفات الخطوط باستخدام مجلدات المشروع. ومع ذلك، عند وقت التجميع، لن يبحث LaTeX تلقائيًا في مجلدات مشروعك عن الخطوط؛ ستحتاج إلى مساعدة LaTeX باستخدام ملف إعداد محلي يسمى [latexmkrc](/latex/ar/mqalat-mtamqh/28-how-to-use-latexmkrc-with-overleaf.md). لن ندخل في التفاصيل هنا، لكننا نوصي بإنشاء مجلد مشروع يسمى `VariableFonts` ونسخ `latexmkrc` الملف المستخدم في [المشروع المرفق](https://www.overleaf.com/8438931911svtqtnmfvsrp#28008d).

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

يقدّم القسم 2 نموذج 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)


---

# 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/37-step-1-setting-up-an-overleaf-project-to-use-variable-fonts.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.
