Query the initialization status of the truetype font API. You may, of course, use this before SDL::TTF::init to avoid initializing twice in a row. Or use this to determine if you need to call SDL::TTF::quit.

Shutdown and cleanup the truetype font API. After calling this the SDL::TTF functions should not be used, excepting SDL::TTF::was_init. You may, of course, use SDL::TTF::init to use the functionality again

This is the same as SDL::TTF::open_font, except you can pass an SDL::RWOps-object. If you pass true as $free, the SDL::RWOps-object will be freed by SDL_ttf library. Don't do this, perl will free this object for you.

This function tells SDL_ttf whether UNICODE (2 bytes per character) text is generally byteswapped. A UNICODE_BOM_NATIVE or UNICODE_BOM_SWAPPED character in a string will temporarily override this setting for the remainder of that string, however this setting will be restored for the next one. The default mode is non-swapped, native endianness of the CPU.

Note: TTF_STYLE_UNDERLINE may cause surfaces created by SDL::TTF::render_glyph_* functions to be extended vertically, downward only, to encompass the underline if the original glyph metrics didn't allow for the underline to be drawn below. This does not change the math used to place a glyph using glyph metrics. On the other hand TTF_STYLE_STRIKETHROUGH doesn't extend the glyph, since this would invalidate the metrics used to position the glyph when blitting, because they would likely be extended vertically upward. There is perhaps a workaround, but it would require programs to be smarter about glyph blitting math than they are currently designed for. Still, sometimes the underline or strikethrough may be outside of the generated surface, and thus not visible when blitted to the screen. In this case, you should probably turn off these styles and draw your own strikethroughs and underlines.

Set the hinting of the loaded font. You should experiment with this setting if you know which font you are using beforehand, especially when using smaller sized fonts. If the user is selecting a font, you may wish to let them select the hinting mode for that font as well.

Set whether to use kerning when rendering the loaded font. This has no effect on individual glyphs, but rather when rendering whole strings of characters, at least a word at a time. Perhaps the only time to disable this is when kerning is not working for a specific font, resulting in overlapping glyphs or abnormal spacing within words.

Get the maximum pixel height of all glyphs of the loaded font. You may use this height for rendering text as close together vertically as possible, though adding at least one pixel height to it will space it so they can't touch. Remember that SDL_ttf doesn't handle multiline printing, so you are responsible for line spacing, see the SDL::TTF::font_line_skip as well.

Get the maximum pixel ascent of all glyphs of the loaded font. This can also be interpreted as the distance from the top of the font to the baseline. It could be used when drawing an individual glyph relative to a top point, by combining it with the glyph's maxy metric to resolve the top of the rectangle used when blitting the glyph on the screen.

Get the maximum pixel descent of all glyphs of the loaded font. This can also be interpreted as the distance from the baseline to the bottom of the font. It could be used when drawing an individual glyph relative to a bottom point, by combining it with the glyph's maxy metric to resolve the top of the rectangle used when blitting the glyph on the screen.

Get the number of faces ("sub-fonts") available in the loaded font. This is a count of the number of specific fonts (based on size and style and other typographical features perhaps) contained in the font itself.

Test if the current font face of the loaded font is a fixed width font. Fixed width fonts are monospace, meaning every character that exists in the font is the same width, thus you can assume that a rendered string's width is going to be the result of glyph_width * string_length.

Returns: >0 if font is a fixed width font. 0 if not a fixed width font.

Calculate the resulting surface size of the LATIN1 encoded text rendered using $font. No actual rendering is done, however correct kerning is done to get the actual width. The height returned is the same as you can get using SDL::TTF::font_height.

Calculate the resulting surface size of the UTF8 encoded text rendered using $font. No actual rendering is done, however correct kerning is done to get the actual width. The height returned in h is the same as you can get using SDL::TTF::font_height.

Note that the first example uses the same text as in the LATIN1 example, that is because plain ASCII is UTF8 compatible.

Calculate the resulting surface size of the UNICODE encoded text rendered using $font. No actual rendering is done, however correct kerning is done to get the actual width. The height returned in h is the same as you can get using SDL::TTF::font_height.