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

# Krok 4: Jak skonfigurować kursywną czcionkę zmienną za pomocą fontspec

[Wstęp](https://www.overleaf.com/learn/latex/Articles/How_to_use_OpenType_variable_fonts_with_LaTeX?preview=true) [Krok 1](https://www.overleaf.com/learn/latex/Articles/Step_1:_Setting_up_an_Overleaf_project_to_use_variable_fonts?preview=true) [Krok 2](https://www.overleaf.com/learn/latex/Articles/Step_2:_An_introduction_to_LaTeX_fonts?preview=true) [Krok 3](https://www.overleaf.com/learn/latex/Articles/Step_3:_Replacing_LaTeX’s_default_fonts_with_variable_fonts?preview=true) [Krok 4](https://www.overleaf.com/learn/latex/Articles/Step_4:_How_to_configure_an_italic_variable_font_using_fontspec?preview=true) [Krok 5](https://www.overleaf.com/learn/latex/Articles/Step_5:_LaTeX_font_weights_and_named_instances_of_variable_fonts?preview=true) [Krok 6](https://www.overleaf.com/learn/latex/Articles/Step_6:_Using_variable_fonts_to_add_bold_fonts_to_an_Overleaf_project?preview=true) [Krok 7](https://www.overleaf.com/learn/latex/Articles/Step_7:_Using_Noto_Sans_and_Roboto_Mono_variable_fonts_with_LaTeX?preview=true) [Krok 8](https://www.overleaf.com/learn/latex/Articles/Step_8:_How_to_create_a_simple_LaTeX_package_to_configure_your_variable_fonts?preview=true) [Przykłady i projekty](https://www.overleaf.com/learn/latex/Articles/Overleaf_projects_showing_how_to_use_variable_fonts_with_LaTeX?preview=true)

W tym kroku skonfigurujemy kursywną czcionkę zmienną, aby naprawić jedno z trzech ostrzeżeń „niezdefiniowany kształt”.

## Podsumowanie ostrzeżeń projektu dotyczących „niezdefiniowanego kształtu”

LaTeX obecnie ostrzega, że w naszym projekcie brakuje trzech kształtów czcionki:

![Obraz pokazujący ostrzeżenia LaTeX o brakujących czcionkach.](/files/6c54878fb73342a9593cb1fe2df8046b6acbed0a)

Zostały one podsumowane w tabeli poniżej, ale pamiętaj, że m jest pomijane w identyfikatorze serii *z wyjątkiem* gdzie *obu* szerokość i grubość to m (medium). W tym artykule pokażemy, jak naprawić drugie ostrzeżenie, dodając czcionkę o średniej grubości, średniej szerokości i kursywnym kształcie.

| **Numer ostrzeżenia** | **Opis ostrzeżenia**                                                                         | **Identyfikator serii** | **Grubość** | **Szerokość** | **Kształt** |
| --------------------- | -------------------------------------------------------------------------------------------- | ----------------------- | ----------- | ------------- | ----------- |
| 1                     | **b**stara grubość, **m**czcionka o średniej szerokości w **n**normalnym (prostym) kształcie | b                       | b           | m             | n           |
| 2                     | **m**średnia grubość, **m**czcionka o średniej szerokości w **it**kursywny kształt           | m                       | m           | m             | it          |
| 3                     | **b**stara grubość, **m**czcionka o średniej szerokości w **it**kursywny kształt             | b                       | b           | m             | it          |

## Dwa pliki czcionek dla Noto Serif

Konstrukcja prostych i kursywnych stylów czcionki (krójów pisma) często różni się zbyt mocno, aby umożliwić płynne przejście między nimi za pomocą osi projektu w czcionce zmiennej. Proste i kursywne kształty potrzebują każdego własnego pliku czcionki, aby zachować unikalne cechy ich projektu. W rezultacie projekt samouczka Overleaf zawiera następujące pliki dla Noto Serif:

* dla kształtu prostego: `NotoSerif-VariableFont-wdth-wght.ttf`
* dla kształtu kursywnego: `NotoSerif-Italic-VariableFont-wdth-wght.ttf`

## Jak dodać kursywną czcionkę Noto Serif

Nasza główna czcionka tekstu dokumentu, Noto Serif, jest konfigurowana za pomocą `\setmainfont` polecenia:

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

Dla przypomnienia, `\setmainfont` ma ogólną postać

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

Możemy użyć opcjonalnego `⟨font features⟩` aby włączyć kształt kursywy dla głównej czcionki dokumentu za pomocą `ItalicFont` klucza.

### Konfigurowanie kursywowej czcionki zmiennej

Wykonaj poniższe kroki, aby aktywować (skonfigurować) kursywową czcionkę zmienną Noto Serif.

1. Upewnij się, że otwarty jest projekt samouczka skonfigurowany w Kroku 3.
2. Zastąp ten wiersz

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

następującym

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

6. Przekompiluj i zwróć uwagę na następujące punkty.

* Pojawiają się dwa ostrzeżenia o niezdefiniowanym kształcie, o jedno mniej niż wcześniej:

![Obraz pokazujący ostrzeżenia LaTeX o brakujących czcionkach.](/files/b00105cb6e406c847e9002c8323d312c6117c279)

Te ostrzeżenia są spowodowane brakiem pogrubionych czcionek dla zwykłych (n) i kursywowych (it) kształtów czcionki.

* Następujące ostrzeżenie nie pojawia się już:

``Font shape `TU/NotoSerif-VariableFont-wdth-wght.ttf(0)/m/it' undefined``

* Tekst kursywą pojawił się ponownie w składanym dokumencie, ponieważ LaTeX ma teraz dostęp do czcionki o średniej grubości, średniej szerokości (serii) i kursywnym (kształcie) w `NotoSerif-VariableFont-wdth-wght.ttf(0)` rodzinie.

## W następnym kroku

W Kroku 5 dowiemy się o grubościach czcionek zmiennych, przygotowując się do Kroku 6, w którym zakończymy początkową konfigurację naszych czcionek zmiennych.


---

# 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/pl/artykuly-szczegolowe/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.
