> For the complete documentation index, see [llms.txt](https://csharp.progdocs.se/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://csharp.progdocs.se/annat/raylib/text.md).

# Text

## DrawText()

Ritar ut text.

```csharp
// Ritar ut texten "Hello World" på x-position 100 och y-position 50,
// med text i storlek 20 och med orange färg.
Raylib.DrawText("Hello World", 100, 50, 20, Color.ORANGE);
```

## LoadFont()

Laddar in en typsnittsfil (ttf eller otf-format)

```csharp
Font f1 = Raylib.LoadFont(@"Metrophobic.ttf");
```

{% hint style="info" %}
**OBSERVERA:** För att få å, ä och ö att fungera eller för att kunna använda typsnittet i en specifik storlek, använd LoadFontEx istället.
{% endhint %}

## LoadFontEx()

Laddar in en typsnittsfil (ttf eller otf-format) med extra parametrar

```csharp
// Ladda in typsnittsfilen Lato-Regular.ttf, i storleken 36.
//  Vi anger null eftersom vi inte vill ange exakt vilka tecken som ska laddas in.
//  Vi anger 256 eftersom vi vill ladda in de 256 första tecknen – vilket inkluderar åäö
Font f2 = Raylib.LoadFontEx(@"Lato-Regular.ttf", 36, null, 256);
```

## DrawTextEx()

Mer avancerad variant av DrawText, som använder Vector2 för positionering och tillåter att man anger typsnitt. Kräver att man lagt in `using System.Numerics;` högst upp.

```csharp
// Ritar ut texten "Hello" på x- position 20 och y-position 15,
// i storlek 40, utan något extra mellanrum mellan bokstäverna, med svart färg.
Raylib.DrawTextEx(f1, "Hello", new Vector2(20,15), 40,0,Color.BLACK);
```


---

# 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://csharp.progdocs.se/annat/raylib/text.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.
