---
name: "SDL::TTF::Font"
section: "3pm"
platform: "linux"
package: "libsdl-perl"
version: "2.548-5+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL::TTF::Font"
---

# SDL::TTF::Font(3pm)

Font object type for SDL\_ttf

## NAME

SDL::TTF::Font - Font object type for SDL\_ttf

## CATEGORY

TTF, Structure

## METHODS

## CONSTRUCTOR

```
 my $font = SDL::TTF::Font->new($font_file, $point_size);

 my $font = SDL::TTF::Font->new($font_file, $point_size, $face_index);
```

Load file for use as a font, at the given size. This can load TTF, OTF and FON files. You can specify the face index of a font file containing multiple faces.

Returns: a SDL::TTF::Font object. `"undef"` is returned on errors.

Example:

```
 use SDL::TTF::Font;

 my $font = SDL::TTF::Font->new('arial.ttf', 24);
```

## AUTHORS

See "AUTHORS" in SDL.

## SEE ALSO

SDL::TTF
