<ul><li><a href="#NAME">NAME</a></li>
<li><a href="#CATEGORY">CATEGORY</a></li>
+<li><a href="#CONSTANTS">CONSTANTS</a></li>
<li><a href="#METHODS">METHODS</a>
<ul><li><a href="#General_methods">General methods</a>
<ul><li><a href="#linked_version">linked_version</a></li>
</ul>
</li>
<li><a href="#Font_Rendering">Font Rendering</a>
+<ul><li><a href="#Solid">Solid</a>
<ul><li><a href="#render_glyph_solid">render_glyph_solid</a></li>
-<li><a href="#render_glyph_shaded">render_glyph_shaded</a></li>
-<li><a href="#render_glyph_blended">render_glyph_blended</a></li>
<li><a href="#render_text_solid">render_text_solid</a></li>
-<li><a href="#render_text_shaded">render_text_shaded</a></li>
-<li><a href="#render_text_blended">render_text_blended</a></li>
<li><a href="#render_utf8_solid">render_utf8_solid</a></li>
-<li><a href="#render_utf8_shaded">render_utf8_shaded</a></li>
-<li><a href="#render_utf8_blended">render_utf8_blended</a></li>
<li><a href="#render_unicode_solid">render_unicode_solid</a></li>
+</ul>
+</li>
+<li><a href="#Shaded">Shaded</a>
+<ul><li><a href="#render_glyph_shaded">render_glyph_shaded</a></li>
+<li><a href="#render_text_shaded">render_text_shaded</a></li>
+<li><a href="#render_utf8_shaded">render_utf8_shaded</a></li>
<li><a href="#render_unicode_shaded">render_unicode_shaded</a></li>
+</ul>
+</li>
+<li><a href="#Blended">Blended</a>
+<ul><li><a href="#render_glyph_blended">render_glyph_blended</a></li>
+<li><a href="#render_text_blended">render_text_blended</a></li>
+<li><a href="#render_utf8_blended">render_utf8_blended</a></li>
<li><a href="#render_unicode_blended">render_unicode_blended</a></li>
</ul>
</li>
</ul>
</li>
-<li><a href="#AUTHOR">AUTHOR</a></li>
+</ul>
+</li>
+<li><a href="#AUTHORS">AUTHORS</a></li>
<li><a href="#SEE_ALSO">SEE ALSO</a>
</li>
</ul><hr />
</div>
<h1 id="CATEGORY">CATEGORY</h1><p><a href="#TOP" class="toplink">Top</a></p>
<div id="CATEGORY_CONTENT">
-<p>TODO, TTF</p>
+<p>TTF</p>
+
+</div>
+<h1 id="CONSTANTS">CONSTANTS</h1><p><a href="#TOP" class="toplink">Top</a></p>
+<div id="CONSTANTS_CONTENT">
+<p>The constants are exported by default. You can avoid this by doing:</p>
+<pre> use SDL::TTF ();
+
+</pre>
+<p>and access them directly:</p>
+<pre> SDL::TTF::TTF_HINTING_NORMAL;
+
+</pre>
+<p>Available constants for "hinting":</p>
+<ul>
+ <li>TTF_HINTING_NORMAL </li>
+ <li>TTF_HINTING_LIGHT </li>
+ <li>TTF_HINTING_MONO </li>
+ <li>TTF_HINTING_NONE</li>
+</ul>
+
+<p>Available constants for "style":</p>
+<ul>
+ <li>TTF_STYLE_NORMAL </li>
+ <li>TTF_STYLE_BOLD </li>
+ <li>TTF_STYLE_ITALIC </li>
+ <li>TTF_STYLE_UNDERLINE </li>
+ <li>TTF_STYLE_STRIKETHROUGH</li>
+</ul>
+
</div>
<h1 id="METHODS">METHODS</h1><p><a href="#TOP" class="toplink">Top</a></p>
</pre>
<p>Query the initilization status of the truetype font API.
-You may, of course, use this before <a href="/SDL-TTF.html#init">SDL::TTF::init</a> to avoid initializing twice in a row. Or use this to determine if you need to call
-<a href="/SDL-TTF.html#quit">SDL::TTF::quit</a>.</p>
+You may, of course, use this before <a href="/SDL-TTF.html#init">SDL::TTF::init</a> to avoid initializing twice in a row. Or use this to determine if you need to
+call <a href="/SDL-TTF.html#quit">SDL::TTF::quit</a>.</p>
</div>
<h3 id="quit">quit</h3>
</pre>
<p>Shutdown and cleanup the truetype font API.
-After calling this the SDL::TTF functions should not be used, excepting <a href="/SDL-TTF.html#was_init">SDL::TTF::was_init</a>. You may, of course, use <a href="/SDL-TTF.html#init">SDL::TTF::init</a> to
-use the functionality again</p>
+After calling this the SDL::TTF functions should not be used, excepting <a href="/SDL-TTF.html#was_init">SDL::TTF::was_init</a>. You may, of course, use
+<a href="/SDL-TTF.html#init">SDL::TTF::init</a> to use the functionality again</p>
</div>
<h2 id="Management_functions">Management functions</h2>
<pre> my $font = SDL::TTF::open_font($font_file, $point_size);
</pre>
-<p>Load file for use as a font, at the given size. This is actually <code>SDL::TTF::open_font_index(..., ..., $index = 0)</code>. This can load TTF and FON files.</p>
+<p>Load file for use as a font, at the given size. This is actually <code>SDL::TTF::open_font_index(..., ..., $index = 0)</code>. This can load TTF, OTF and FON files.</p>
<p>Returns: a <a href="SDL-TTF-Font.html">SDL::TTF::Font</a> object. <code>undef</code> is returned on errors.</p>
<p>Example:</p>
<pre> use SDL::TTF;
use SDL::TTF::Font;
- my $font = SDL::TTF::open_font('arial.ttf', '24);
+ my $font = SDL::TTF::open_font('arial.ttf', 24);
</pre>
<p>Get the current kerning setting of the loaded font.</p>
<p>Returns: <code>0</code>(zero) if kerning is disabled. A non-zero value is returned when enabled. The default for a newly loaded font is enabled(<code>1</code>). </p>
<p><strong>Note</strong>: at least SDL_ttf 2.0.10 needed</p>
+<p><strong>Note</strong>: This function returns wrong values: See <a href="http://bugzilla.libsdl.org/show_bug.cgi?id=973">http://bugzilla.libsdl.org/show_bug.cgi?id=973</a></p>
</div>
<h4 id="set_font_kerning">set_font_kerning</h4>
<div id="Font_Rendering_CONTENT">
</div>
-<h3 id="render_glyph_solid">render_glyph_solid</h3>
+<h3 id="Solid">Solid</h3>
+<div id="Solid_CONTENT">
+
+</div>
+<h4 id="render_glyph_solid">render_glyph_solid</h4>
<div id="render_glyph_solid_CONTENT">
+<pre> my $surface = SDL::TTF::render_glyph_solid($font, $char, $color);
+
+</pre>
+<p>Render the unicode encoded char onto a new surface, using the Solid mode. After that you can blit this surface to your display-surface.</p>
+<p><strong>Note</strong>: The unicode char has to be passed exactly like for <a href="/SDL-TTF.html#size_unicode">SDL::TTF::size_unicode</a>.</p>
+<p><strong>Note</strong>: <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=374062">See space-character bug</a>. You have to upgrade libfreetype2 to at least version 2.3.5</p>
</div>
-<h3 id="render_glyph_shaded">render_glyph_shaded</h3>
-<div id="render_glyph_shaded_CONTENT">
+<h4 id="render_text_solid">render_text_solid</h4>
+<div id="render_text_solid_CONTENT">
+<pre> my $surface = SDL::TTF::render_text_solid($font, $text, $color);
+
+</pre>
+<p>Render the LATIN1 encoded text onto a new surface, using the Solid mode. After that you can blit this surface to your display-surface.</p>
+<p><strong>Note</strong>: <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=374062">See space-character bug</a>. You have to upgrade libfreetype2 to at least
+version 2.3.5</p>
+<p>Example:</p>
+<pre> use SDL;
+ use SDL::Rect;
+ use SDL::Video;
+ use SDL::Color;
+ use SDL::TTF;
+ use SDL::TTF::Font;
+
+ SDL::init(SDL_INIT_VIDEO);
+ SDL::TTF::init();
+ my $display = SDL::Video::set_video_mode(640, 480, 32, SDL_SWSURFACE);
+ my $font = SDL::TTF::open_font('somefont.ttf', '24');
+ die 'Coudnt make font '. SDL::get_error if !$font;
+ my $surface = SDL::TTF::render_text_solid($font, 'Hallo!', SDL::Color->new(0xFF,0xFF,0xFF));
+ SDL::Video::blit_surface($surface, SDL::Rect->new(0, 0, 640, 480), $display, SDL::Rect->new(10, 10, 640, 480));
+ SDL::Video::update_rect($display, 0, 0, 0, 0);
+ SDL::delay(5000);
+
+</pre>
</div>
-<h3 id="render_glyph_blended">render_glyph_blended</h3>
-<div id="render_glyph_blended_CONTENT">
+<h4 id="render_utf8_solid">render_utf8_solid</h4>
+<div id="render_utf8_solid_CONTENT">
+<pre> my $surface = SDL::TTF::render_utf8_solid($font, $text, $color);
+
+</pre>
+<p>Render the UTF8 encoded text onto a new surface, using the Solid mode. After that you can blit this surface to your display-surface.</p>
+<p><strong>Note</strong>: <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=374062">See space-character bug</a>. You have to upgrade libfreetype2 to at least
+version 2.3.5</p>
</div>
-<h3 id="render_text_solid">render_text_solid</h3>
-<div id="render_text_solid_CONTENT">
-<p><strong>Note</strong>: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=374062</p>
+<h4 id="render_unicode_solid">render_unicode_solid</h4>
+<div id="render_unicode_solid_CONTENT">
+<pre> my $surface = SDL::TTF::render_unicode_solid($font, $text, $color);
+
+</pre>
+<p>Render the unicode encoded text onto a new surface, using the Solid mode. After that you can blit this surface to your display-surface.</p>
+<p><strong>Note</strong>: The unicode test has to be passed exactly like for <a href="/SDL-TTF.html#size_unicode">SDL::TTF::size_unicode</a>.</p>
+<p><strong>Note</strong>: <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=374062">See space-character bug</a>. You have to upgrade libfreetype2 to at least
+version 2.3.5</p>
</div>
-<h3 id="render_text_shaded">render_text_shaded</h3>
-<div id="render_text_shaded_CONTENT">
+<h3 id="Shaded">Shaded</h3>
+<div id="Shaded_CONTENT">
</div>
-<h3 id="render_text_blended">render_text_blended</h3>
-<div id="render_text_blended_CONTENT">
+<h4 id="render_glyph_shaded">render_glyph_shaded</h4>
+<div id="render_glyph_shaded_CONTENT">
+<pre> my $surface = SDL::TTF::render_glyph_shaded($font, $char, $color, $background_color);
+
+</pre>
+<p>Render the unicode encoded char onto a new surface. The surface is filled with <code>$background_color</code>. After that you can blit this surface to
+your display-surface.</p>
+<p><strong>Note</strong>: The unicode char has to be passed exactly like for <a href="/SDL-TTF.html#size_unicode">SDL::TTF::size_unicode</a>.</p>
</div>
-<h3 id="render_utf8_solid">render_utf8_solid</h3>
-<div id="render_utf8_solid_CONTENT">
+<h4 id="render_text_shaded">render_text_shaded</h4>
+<div id="render_text_shaded_CONTENT">
+<pre> my $surface = SDL::TTF::render_text_shaded($font, $text, $color, $background_color);
+
+</pre>
+<p>Render the LATIN1 encoded text onto a new surface. The surface is filled with <code>$background_color</code>. After that you can blit this surface to
+your display-surface.</p>
+<p>Example:</p>
+<pre> use SDL;
+ use SDL::Video;
+ use SDL::Color;
+ use SDL::TTF;
+ use SDL::TTF::Font;
+
+ SDL::init(SDL_INIT_VIDEO);
+
+ SDL::TTF::init();
+
+ my $display = SDL::Video::set_video_mode(640, 480, 32, SDL_SWSURFACE);
+ my $font = SDL::TTF::open_font('arial.ttf', '24');
+ my $white = SDL::Color->new(0xFF, 0xFF, 0xFF);
+ my $black = SDL::Color->new(0x00, 0x00, 0x00);
+ my $surface = SDL::TTF::render_text_solid($font, 'Hallo!', $white, $black);
+
+ SDL::Video::blit_surface($surface, SDL::Rect->new(0, 0, 640, 480), $display, SDL::Rect->new(10, 10, 640, 480));
+ SDL::Video::update_rect($display, 0, 0, 0, 0);
+
+ SDL::delay(5000);
+
+</pre>
</div>
-<h3 id="render_utf8_shaded">render_utf8_shaded</h3>
+<h4 id="render_utf8_shaded">render_utf8_shaded</h4>
<div id="render_utf8_shaded_CONTENT">
+<pre> my $surface = SDL::TTF::render_utf8_shaded($font, $text, $color, $background_color);
+
+</pre>
+<p>Render the UTF8 encoded text onto a new surface. The surface is filled with <code>$background_color</code>. After that you can blit this surface to
+your display-surface.</p>
</div>
-<h3 id="render_utf8_blended">render_utf8_blended</h3>
-<div id="render_utf8_blended_CONTENT">
+<h4 id="render_unicode_shaded">render_unicode_shaded</h4>
+<div id="render_unicode_shaded_CONTENT">
+<pre> my $surface = SDL::TTF::render_unicode_shaded($font, $text, $color, $background_color);
+
+</pre>
+<p>Render the unicode encoded text onto a new surface. The surface is filled with <code>$background_color</code>. After that you can blit this surface to
+your display-surface.</p>
+<p><strong>Note</strong>: The unicode text has to be passed exactly like for <a href="/SDL-TTF.html#size_unicode">SDL::TTF::size_unicode</a>.</p>
</div>
-<h3 id="render_unicode_solid">render_unicode_solid</h3>
-<div id="render_unicode_solid_CONTENT">
+<h3 id="Blended">Blended</h3>
+<div id="Blended_CONTENT">
</div>
-<h3 id="render_unicode_shaded">render_unicode_shaded</h3>
-<div id="render_unicode_shaded_CONTENT">
+<h4 id="render_glyph_blended">render_glyph_blended</h4>
+<div id="render_glyph_blended_CONTENT">
+<pre> my $surface = SDL::TTF::render_glyph_blended($font, $char, $color);
+
+</pre>
+<p>Render the unicode encoded char onto a new surface. After that you can blit this surface to your display-surface.</p>
+<p><strong>Note</strong>: The unicode char has to be passed exactly like for <a href="/SDL-TTF.html#size_unicode">SDL::TTF::size_unicode</a>.</p>
+
+</div>
+<h4 id="render_text_blended">render_text_blended</h4>
+<div id="render_text_blended_CONTENT">
+<pre> my $surface = SDL::TTF::render_text_blended($font, $text, $color);
+
+</pre>
+<p>Render the LATIN1 encoded text onto a new surface. After that you can blit this surface to your display-surface.</p>
+<p>Example:</p>
+<pre> use SDL;
+ use SDL::Video;
+ use SDL::Color;
+ use SDL::TTF;
+ use SDL::TTF::Font;
+
+ SDL::init(SDL_INIT_VIDEO);
+
+ SDL::TTF::init();
+
+ my $display = SDL::Video::set_video_mode(640, 480, 32, SDL_SWSURFACE);
+ my $font = SDL::TTF::open_font('arial.ttf', '24');
+ my $surface = SDL::TTF::render_text_blended($font, 'Hallo!', SDL::Color->new(0xFF,0xFF,0xFF));
+
+ SDL::Video::blit_surface($surface, SDL::Rect->new(0, 0, 640, 480), $display, SDL::Rect->new(10, 10, 640, 480));
+ SDL::Video::update_rect($display, 0, 0, 0, 0);
+
+ SDL::delay(5000);
+
+</pre>
</div>
-<h3 id="render_unicode_blended">render_unicode_blended</h3>
+<h4 id="render_utf8_blended">render_utf8_blended</h4>
+<div id="render_utf8_blended_CONTENT">
+<pre> my $surface = SDL::TTF::render_utf8_blended($font, $text, $color);
+
+</pre>
+<p>Render the UTF8 encoded text onto a new surface. After that you can blit this surface to your display-surface.</p>
+
+</div>
+<h4 id="render_unicode_blended">render_unicode_blended</h4>
<div id="render_unicode_blended_CONTENT">
+<pre> my $surface = SDL::TTF::render_unicode_blended($font, $text, $color);
+
+</pre>
+<p>Render the unicode encoded text onto a new surface. After that you can blit this surface to your display-surface.</p>
+<p><strong>Note</strong>: The unicode char has to be passed exactly like for <a href="/SDL-TTF.html#size_unicode">SDL::TTF::size_unicode</a>.</p>
</div>
-<h1 id="AUTHOR">AUTHOR</h1><p><a href="#TOP" class="toplink">Top</a></p>
-<div id="AUTHOR_CONTENT">
-<p>Tobias Leich [FROGGS]</p>
+<h1 id="AUTHORS">AUTHORS</h1><p><a href="#TOP" class="toplink">Top</a></p>
+<div id="AUTHORS_CONTENT">
+<p>See <a href="/SDL.html#AUTHORS">/SDL.html#AUTHORS</a>.</p>
</div>
<h1 id="SEE_ALSO">SEE ALSO</h1><p><a href="#TOP" class="toplink">Top</a></p>