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

# Passo 4: Como configurar um tipo de letra variável itálico usando fontspec

[Introdução](https://www.overleaf.com/learn/latex/Articles/How_to_use_OpenType_variable_fonts_with_LaTeX?preview=true) [Passo 1](https://www.overleaf.com/learn/latex/Articles/Step_1:_Setting_up_an_Overleaf_project_to_use_variable_fonts?preview=true) [Passo 2](https://www.overleaf.com/learn/latex/Articles/Step_2:_An_introduction_to_LaTeX_fonts?preview=true) [Passo 3](https://www.overleaf.com/learn/latex/Articles/Step_3:_Replacing_LaTeX’s_default_fonts_with_variable_fonts?preview=true) [Passo 4](https://www.overleaf.com/learn/latex/Articles/Step_4:_How_to_configure_an_italic_variable_font_using_fontspec?preview=true) [Passo 5](https://www.overleaf.com/learn/latex/Articles/Step_5:_LaTeX_font_weights_and_named_instances_of_variable_fonts?preview=true) [Passo 6](https://www.overleaf.com/learn/latex/Articles/Step_6:_Using_variable_fonts_to_add_bold_fonts_to_an_Overleaf_project?preview=true) [Passo 7](https://www.overleaf.com/learn/latex/Articles/Step_7:_Using_Noto_Sans_and_Roboto_Mono_variable_fonts_with_LaTeX?preview=true) [Passo 8](https://www.overleaf.com/learn/latex/Articles/Step_8:_How_to_create_a_simple_LaTeX_package_to_configure_your_variable_fonts?preview=true) [Exemplos e projetos](https://www.overleaf.com/learn/latex/Articles/Overleaf_projects_showing_how_to_use_variable_fonts_with_LaTeX?preview=true)

Nesta etapa, vamos configurar uma fonte variável itálica para corrigir um dos três avisos de “forma indefinida”.

## Resumo dos avisos de “forma indefinida” do nosso projeto

Atualmente, o LaTeX avisa que faltam três formas de fonte no nosso projeto:

![Imagem mostrando avisos de fontes em falta do LaTeX.](/files/a26de4b93fb801ef86f9b04e64a693b699f11225)

Estes estão resumidos na tabela abaixo, mas lembre-se de que m é omitido do identificador da série *exceto* onde *ambos* a largura e o peso são m (médio). Neste artigo, mostraremos como corrigir o segundo aviso adicionando uma fonte com peso médio, largura média e na forma itálica.

| **Número do aviso** | **Descrição do aviso**                                                        | **Identificador da série** | **Peso** | **Largura** | **Forma** |
| ------------------- | ----------------------------------------------------------------------------- | -------------------------- | -------- | ----------- | --------- |
| 1                   | **b**peso antigo, **m**fonte de largura média na **n**forma normal (vertical) | b                          | b        | m           | n         |
| 2                   | **m**peso médio, **m**fonte de largura média na **it**forma itálica           | m                          | m        | m           | it        |
| 3                   | **b**peso antigo, **m**fonte de largura média na **it**forma itálica          | b                          | b        | m           | it        |

## Dois ficheiros de fonte para Noto Serif

Os estilos de fonte vertical e itálico (tipos de letra) são muitas vezes demasiado diferentes para permitir uma transição suave entre eles através de um eixo de design numa fonte variável. As formas vertical e itálica precisam cada uma de um ficheiro de fonte dedicado para preservar as características únicas do seu design. Como resultado, o projeto tutorial do Overleaf contém os seguintes ficheiros para Noto Serif:

* para a forma vertical: `NotoSerif-VariableFont-wdth-wght.ttf`
* para a forma itálica: `NotoSerif-Italic-VariableFont-wdth-wght.ttf`

## Como adicionar a fonte itálica Noto Serif

A nossa fonte de texto principal do documento, Noto Serif, é configurada usando a `\setmainfont` comando:

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

Como lembrete, `\setmainfont` tem a forma geral

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

Podemos usar o opcional `⟨font features⟩` para ativar uma forma itálica para a fonte principal do documento usando a `ItalicFont` chave.

### Configuração de uma fonte variável itálica

Use os passos seguintes para ativar (configurar) a fonte variável itálica Noto Serif.

1. Certifique-se de abrir o projeto do tutorial configurado no Passo 3.
2. Substitua esta linha

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

pelo seguinte

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

6. Recompile e observe os seguintes pontos.

* Há dois avisos de forma indefinida, um a menos do que antes:

![Imagem mostrando avisos de fontes em falta do LaTeX.](/files/f4a23a5b46ae8f5a87c66c61791c425f66acd19b)

Estes avisos são causados pela falta de fontes negrito para as formas de fonte normal (n) e itálica (it).

* O seguinte aviso já não aparece:

``Forma de fonte `TU/NotoSerif-VariableFont-wdth-wght.ttf(0)/m/it' indefinida``

* O texto itálico reapareceu no documento composto porque o LaTeX agora tem acesso a uma fonte de peso médio, largura média (série) itálica (forma) na `NotoSerif-VariableFont-wdth-wght.ttf(0)` família.

## No próximo passo

No Passo 5, aprendemos sobre os pesos das fontes variáveis, preparando-nos para o Passo 6, onde concluímos a configuração inicial das nossas fontes variáveis.


---

# 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/overleaf-learn-latex-pt/artigos-aprofundados/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.
