pods::...::Font(3pm)

πŸ’– NAME πŸ’–

Bestie, welcome to the pods::...::Font(3pm) page from User Contributed Perl Documentation β€” yes, we're in Perl-docs territory, and this one is all about the font object type for SDL_ttf. The actual NAME line is SDL::TTF::Font - Font object type for SDL_ttf. Periodt. πŸ’…


🌈 CATEGORY 🌈

  • TTF, Structure β€” that's the category, no cap.

πŸŽ€ METHODS πŸŽ€

πŸ› οΈ CONSTRUCTOR πŸ› οΈ

Okay so you make one like this, bestie:

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

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

It loads a file for use as a font, at the size you give it. This can load TTF, OTF and FON files. You can also specify the face index of a font file that contains multiple faces. Iconic behavior, honestly. ✨

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

Example time β€” copy it exactly, iykyk:

use SDL::TTF::Font;

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

🫢 AUTHORS 🫢

See "AUTHORS" in SDL. That's the whole section, and it ate. πŸ’–


πŸ¦‹ SEE ALSO πŸ¦‹

SDL::TTF β€” go look, bestie. πŸ‘‘


Stay iconic, and remember: this pods::...::Font(3pm) page was brought to you by perl v5.42.3, dated 2026-08-19. Mwah. πŸ’œ

πŸ“¦ where this page comes from