X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pages%2FSDL-TTF.html-inc;fp=pages%2FSDL-TTF.html-inc;h=7693e8ea37ea200cdf03f7638a655ccd95974de0;hb=1dbe16975541da864f8bfa5169c89a2ab8893bf2;hp=392a65bde30bbaef73f6ea90e5ea4757bf496939;hpb=d16cf6099f200163fdcf578d0cfd25896fbda759;p=sdlgit%2FSDL-Site.git diff --git a/pages/SDL-TTF.html-inc b/pages/SDL-TTF.html-inc index 392a65b..7693e8e 100644 --- a/pages/SDL-TTF.html-inc +++ b/pages/SDL-TTF.html-inc @@ -178,7 +178,7 @@ No prior initialization needs to be done before these function is called.
Initialize the truetype font API. -This must be called before using other functions in this library, except SDL::TTF::was_init and SDL::TTF::linked_version. +This must be called before using other functions in this library, except SDL::TTF::was_init and SDL::TTF::linked_version. SDL does not have to be initialized before this call.
Returns: 0
on success, -1
on any error.
Query the initilization 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.
+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
+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 againmy $font = SDL::TTF::open_font($font_file, $point_size, $face_index);-
This is the same as SDL::TTF::open_font, except you can specify the face index of a font file containing multiple faces. +
This is the same as SDL::TTF::open_font, except you can specify the face index of a font file containing multiple faces. This can load TTF and FON files.
@@ -237,7 +237,7 @@ This can load TTF and FON files.my $font = SDL::TTF::open_font_RW($rwops_object, $free, $point_size);-
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
+
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.
Example:
my $font = SDL::TTF::open_font_RW(SDL::RWOps->new_file($font_file, 'r'), 0, 24); @@ -250,7 +250,7 @@ will be freed by SDL_ttf library. Don't do this, perl will free this object formy $font = SDL::TTF::open_font_index_RW($rwops_object, $free, $point_size, $face_index);-This is the same as SDL::TTF::open_font_index, except you can pass an SDL::RWOps-object. If you pass true as
$free
, the +This is the same as SDL::TTF::open_font_index, except you can pass an SDL::RWOps-object. If you pass true as
@@ -405,7 +405,7 @@ overlapping glyphs or abnormal spacing within words.$free
, the SDL::RWOps-object will be freed by SDL_ttf library. Don't do this, perl will free this object for you.
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.
+printing, so you are responsible for line spacing, see the SDL::TTF::font_line_skip as well.my $font_line_skip = SDL::TTF::font_line_skip($font);-
Get the recommended pixel height of a rendered line of text of the loaded font. This is usually larger than the SDL::TTF::font_height of the +
Get the recommended pixel height of a rendered line of text of the loaded font. This is usually larger than the SDL::TTF::font_height of the font.
@@ -545,7 +545,7 @@ in the font is the same width, thus you can assume that a rendered string's widtCalculate 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.
Examples:
($width, $height) = @{ SDL::TTF::size_utf8($font, 'Hallo World!') }; # plain text, if your script is in utf8 or ansi-format @@ -578,7 +578,7 @@ done to get the actual width. The height returned in h is the same as you can ge
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.
$text
has to be:
Render the unicode encoded char onto a new surface, using the Solid mode. After that you can blit this surface to your display-surface.
-Note: The unicode char has to be passed exactly like for SDL::TTF::size_unicode.
+Note: The unicode char has to be passed exactly like for SDL::TTF::size_unicode.
Note: See space-character bug. You have to upgrade libfreetype2 to at least version 2.3.5
@@ -660,7 +660,7 @@ version 2.3.5Render the unicode encoded text onto a new surface, using the Solid mode. After that you can blit this surface to your display-surface.
-Note: The unicode test has to be passed exactly like for SDL::TTF::size_unicode.
+Note: The unicode test has to be passed exactly like for SDL::TTF::size_unicode.
Note: See space-character bug. You have to upgrade libfreetype2 to at least version 2.3.5
@@ -676,7 +676,7 @@ version 2.3.5Render the unicode encoded char onto a new surface. The surface is filled with $background_color
. After that you can blit this surface to
your display-surface.
Note: The unicode char has to be passed exactly like for SDL::TTF::size_unicode.
+Note: The unicode char has to be passed exactly like for SDL::TTF::size_unicode.
Render the unicode encoded text onto a new surface. The surface is filled with $background_color
. After that you can blit this surface to
your display-surface.
Note: The unicode text has to be passed exactly like for SDL::TTF::size_unicode.
+Note: The unicode text has to be passed exactly like for SDL::TTF::size_unicode.
Render the unicode encoded char onto a new surface. After that you can blit this surface to your display-surface.
-Note: The unicode char has to be passed exactly like for SDL::TTF::size_unicode.
+Note: The unicode char has to be passed exactly like for SDL::TTF::size_unicode.
Render the unicode encoded text onto a new surface. After that you can blit this surface to your display-surface.
-Note: The unicode char has to be passed exactly like for SDL::TTF::size_unicode.
+Note: The unicode char has to be passed exactly like for SDL::TTF::size_unicode.
See AUTHORS in SDL.
+See /SDL.html#AUTHORS.