> 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/41-step-5-latex-font-weights-and-named-instances-of-variable-fonts.md).

# الخطوة 5: أوزان خطوط 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)

في هذه الخطوة، نوضح طريقتين لتعيين قيمة لوزن خط متغير، باستخدام الوزن المتوسط كنقطة بداية. نعرّف المثيلات المسمّاة للخطوط المتغيرة ونستكشف كيف يمكن أن ترتبط بأوزان الخط القياسية في LaTeX.

تأكد من فتح مشروع البرنامج التعليمي الذي تم تكوينه في الخطوة 4.

## طريقتان لتعيين قيمة لمحور التصميم

توفّر صفحات اختبار الخط من Google طريقتين لتعيين قيمة لمحور التصميم في الخط المتغير: باستخدام شريط تمرير أو قائمة منسدلة بالأسماء والقيم. صفحة [الاختبار لخط Noto Serif](https://fonts.google.com/noto/specimen/Noto+Serif/tester) توفّر شريطًا لمحور الوزن يتراوح من 100 إلى 900، إلى جانب قائمة بالمثيلات المسمّاة التي تمثل أوزان خطوط مختلفة.

![صورة تُظهر طريقتين لتعيين قيمة لمحور التصميم: باستخدام شريط تمرير أو مثيلات مسمّاة](/files/433abd9fca8039557d410c9fcbff4d900bbd26be)

### ما هو «المثيل» في الخط المتغير؟

الم *مثيل* من الخط المتغير هو مجموعة معينة من قيم المحاور تُستخدم لإنشاء أحد التنوعات الأسلوبية الممكنة العديدة. إن إعطاء اسم لمجموعة من قيم المحاور يعرّف مثيلًا مسمّى. تُخزَّن بيانات المثيلات المسمّاة داخل ملفات الخطوط المتغيرة.

## أسماء أوزان الخط في LaTeX

كما ذُكر في الخطوة 2، يعرّف LaTeX تسعة أوزان قياسية للخطوط، ولكل منها معرّف قصير واسم وصفي أطول:

|                     |                   |
| ------------------- | ----------------- |
| **معرّف وزن LaTeX** | **اسم وزن LaTeX** |
| ul                  | رفيع جدًا         |
| el                  | خفيف جدًا         |
| l                   | خفيف              |
| sl                  | شبه خفيف          |
| m                   | متوسط (عادي)      |
| sb                  | شبه عريض          |
| b                   | عريض              |
| eb                  | عريض جدًا         |
| ub                  | عريض جدًا للغاية  |

تتراوح قيم محور الوزن في Noto Serif من 100 إلى 900، ما يوفّر بشكل ملائم تسع قيم لمثيلات مسمّاة بزيادات قدرها 100. يمكن مطابقة كل مثيل مسمّى مع أحد الأوزان القياسية التسعة في LaTeX، كما هو موضح في الجدول التالي.

|                 |                                    |              |              |
| --------------- | ---------------------------------- | ------------ | ------------ |
| **أوزان LaTeX** | **المثيلات المسمّاة للخط المتغير** |              |              |
| *معرّف LaTeX*   | *الاسم*                            | *قيمة الوزن* | *اسم المثيل* |
| ul              | رفيع جدًا                          | 100          | رفيع         |
| el              | خفيف جدًا                          | 200          | خفيف جدًا    |
| l               | خفيف                               | 300          | خفيف         |
| sl              | شبه خفيف                           | 400          | عادي         |
| m               | متوسط (عادي)                       | 500          | متوسط        |
| sb              | شبه عريض                           | 600          | شبه عريض     |
| b               | عريض                               | 700          | عريض         |
| eb              | عريض جدًا                          | 800          | عريض جدًا    |
| ub              | عريض جدًا للغاية                   | 900          | أسود         |

## اختيار قيمة لوزن LaTeX «المتوسط» (العادي)

في LaTeX، يعني «المتوسط» و«العادي» الشيء نفسه: وزن الخط المستخدم لمعظم نص مستندك. وهذا يختلف عن المثيلات المسمّاة في Noto Serif، حيث يكون وزن Regular هو 400 ووزن Medium هو 500. الأمر متروك لنا لتحديد القيمة التي تُختار لوزن LaTeX المتوسط. سنجرب 400، ولكن إذا لم ينجح ذلك (أو لم يظهر بشكل جميل)، فيمكننا بسهولة التبديل إلى قيمة أخرى — التحكّم الطباعي، وهذه هي ميزة الخطوط المتغيرة.

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

قبل إضافة الخطوط العريضة، ينبغي أن نعيّن قيمة لوزن LaTeX المتوسط (العادي) لخط Noto Serif المستخدم في مشروعنا.

يوفّر fontspec ميزتين لتعيين قيمة لمحور الوزن:

* Weight = ⟨value⟩ يعيّن محور الوزن إلى أي ⟨value⟩ مدعوم
* Instance = ⟨named instance⟩ يعيّن الوزن كما هو محدد بواسطة إعداد ⟨named instance⟩

### تعيين الوزن المتوسط إلى 400

لتعيين الوزن المتوسط إلى 400، عدّل أمر \setmainfont في المشروع الحالي ليصبح كما يلي

```
\setmainfont{NotoSerif-VariableFont-wdth-wght.ttf}[
Weight=400,
% أو يمكننا استبدال Weight=400 بـ
% Instance=Regular,
ItalicFont=NotoSerif-Italic-VariableFont-wdth-wght.ttf
]
```

سيكون للخط المائل أيضًا قيمة 400 لمحور الوزن.

إذا لم يعجبك الناتج المطبوع بعد إعادة تجميع المستند، فيمكنك تجربة ما يلي:

* استخدم قيمة مختلفة لمحور Weight
* جرّب حجم الخط وتباعد الأسطر باستخدام الأمر `\fontsize` ؛ على سبيل المثال، جرّب كتابة

```
\fontsize{9}{11}\selectfont
```

مباشرة بعد `\begin{document}`

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

في الخطوة التالية، سنقوم بتهيئة الخطوط المتغيرة لتوفير خطوط عريضة وعريضة مائلة.


---

# 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/41-step-5-latex-font-weights-and-named-instances-of-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.
