From: Tobias Leich Date: Sat, 20 Mar 2010 16:04:05 +0000 (+0100) Subject: docs for TTF done X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=sdlgit%2FSDL-Site.git;a=commitdiff_plain;h=c5f5ab4d690f60611dcb537ce0ea89ec74f1ca36 docs for TTF done --- diff --git a/pages/SDL-TTF.html-inc b/pages/SDL-TTF.html-inc index 709d1d3..08b5efe 100644 --- a/pages/SDL-TTF.html-inc +++ b/pages/SDL-TTF.html-inc @@ -67,22 +67,31 @@
  • Font Rendering +
  • + +
  • AUTHOR
  • SEE ALSO
  • @@ -96,7 +105,7 @@

    CATEGORY

    Top

    -

    TODO, TTF

    +

    TTF

    METHODS

    Top

    @@ -561,53 +570,188 @@ is done to get the actual width. The height returned in h is the same as you can
    -

    render_glyph_solid

    +

    Solid

    +
    + +
    +

    render_glyph_solid

    +
     my $surface = SDL::TTF::render_glyph_solid($font, $char, $color);
    +
    +
    +

    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: See space-character bug. You have to upgrade libfreetype2 to at least version 2.3.5

    -

    render_glyph_shaded

    -
    +

    render_text_solid

    +
    +
     my $surface = SDL::TTF::render_text_solid($font, $text, $color);
    +
    +
    +

    Render the LATIN1 encoded text onto a new surface, using the Solid mode. After that you can blit this surface to your display-surface.

    +

    Note: See space-character bug. You have to upgrade libfreetype2 to at least +version 2.3.5

    +

    Example:

    +
     use SDL;
    + use SDL::Video;
    + use SDL::Color;
    + use SDL::TTF;
    + use SDL::TTF::Font;
    +
    + SDL::init(SDL_INIT_VIDEO);
    +
    + 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_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);
    +
    +
    -

    render_glyph_blended

    -
    +

    render_utf8_solid

    +
    +
     my $surface = SDL::TTF::render_utf8_solid($font, $text, $color);
    +
    +
    +

    Render the UTF8 encoded text onto a new surface, using the Solid mode. After that you can blit this surface to your display-surface.

    +

    Note: See space-character bug. You have to upgrade libfreetype2 to at least +version 2.3.5

    -

    render_text_solid

    -
    -

    Note: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=374062

    +

    render_unicode_solid

    +
    +
     my $surface = SDL::TTF::render_unicode_solid($font, $text, $color);
    +
    +
    +

    Render 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: See space-character bug. You have to upgrade libfreetype2 to at least +version 2.3.5

    -

    render_text_shaded

    -
    +

    Shaded

    +
    -

    render_text_blended

    -
    +

    render_glyph_shaded

    +
    +
     my $surface = SDL::TTF::render_glyph_shaded($font, $char, $color, $background_color);
    +
    +
    +

    Render 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.

    -

    render_utf8_solid

    -
    +

    render_text_shaded

    +
    +
     my $surface = SDL::TTF::render_text_shaded($font, $text, $color, $background_color);
    +
    +
    +

    Render the LATIN1 encoded text onto a new surface. The surface is filled with $background_color. After that you can blit this surface to +your display-surface.

    +

    Example:

    +
     use SDL;
    + use SDL::Video;
    + use SDL::Color;
    + use SDL::TTF;
    + use SDL::TTF::Font;
    +
    + SDL::init(SDL_INIT_VIDEO);
    +
    + 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);
    +
    +
    -

    render_utf8_shaded

    +

    render_utf8_shaded

    +
     my $surface = SDL::TTF::render_utf8_shaded($font, $text, $color, $background_color);
    +
    +
    +

    Render the UTF8 encoded text onto a new surface. The surface is filled with $background_color. After that you can blit this surface to +your display-surface.

    -

    render_utf8_blended

    -
    +

    render_unicode_shaded

    +
    +
     my $surface = SDL::TTF::render_unicode_shaded($font, $text, $color, $background_color);
    +
    +
    +

    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.

    -

    render_unicode_solid

    -
    +

    Blended

    +
    -

    render_unicode_shaded

    -
    +

    render_glyph_blended

    +
    +
     my $surface = SDL::TTF::render_glyph_blended($font, $char, $color);
    +
    +
    +

    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.

    -

    render_unicode_blended

    +

    render_text_blended

    +
    +
     my $surface = SDL::TTF::render_text_blended($font, $text, $color);
    +
    +
    +

    Render the LATIN1 encoded text onto a new surface. After that you can blit this surface to your display-surface.

    +

    Example:

    +
     use SDL;
    + use SDL::Video;
    + use SDL::Color;
    + use SDL::TTF;
    + use SDL::TTF::Font;
    +
    + SDL::init(SDL_INIT_VIDEO);
    +
    + 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);
    +
    +
    + +
    +

    render_utf8_blended

    +
    +
     my $surface = SDL::TTF::render_utf8_blended($font, $text, $color);
    +
    +
    +

    Render the UTF8 encoded text onto a new surface. After that you can blit this surface to your display-surface.

    + +
    +

    render_unicode_blended

    +
     my $surface = SDL::TTF::render_unicode_blended($font, $text, $color);
    +
    +
    +

    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.

    AUTHOR

    Top

    diff --git a/pages/documentation.html-inc b/pages/documentation.html-inc index be0e462..4d59eb6 100644 --- a/pages/documentation.html-inc +++ b/pages/documentation.html-inc @@ -1,2 +1,2 @@
    -

    Documentation (latest development branch)

    Core
    thumbSDL- Simple DirectMedia Layer for Perl
    thumbSDL::Time- a SDL perl extension for managing timers.
    Audio
    thumbSDL::Audio- SDL Bindings for Audio
    Structure
    thumbSDL::AudioCVT- Audio Conversion Structure
    thumbSDL::AudioSpec- SDL Bindings for structure SDL::AudioSpec
    CDROM
    thumbSDL::CDROM- SDL Bindings for the CDROM device
    Structure
    thumbSDL::CD- SDL Bindings for structure SDL_CD
    thumbSDL::CDTrack- SDL Bindings for structure SDL_CDTrack
    Events
    thumbSDL::Events- Bindings to the Events Category in SDL API
    Structure
    thumbSDL::Event- General event structure
    Joystick
    thumbSDL::Joystick- SDL Bindings for the Joystick device
    Mouse
    thumbSDL::Mouse- SDL Bindings for the Mouse device
    Structure
    thumbSDL::Cursor- Mouse cursor structure
    Structure
    thumbSDL::Version- SDL Bindings for structure SDL_Version
    Video
    thumbSDL::Video- Bindings to the video category in SDL API
    Structure
    thumbSDL::Color- Format independent color description
    thumbSDL::Overlay- YUV Video overlay
    thumbSDL::Palette- Color palette for 8-bit pixel formats
    thumbSDL::PixelFormat- Stores surface format information
    thumbSDL::Rect- Defines a rectangular area
    thumbSDL::Surface- Graphic surface structure.
    thumbSDL::VideoInfo- Video Target Information

    Cookbook
    thumbSDL::Cookbook
    thumbSDL::Cookbook::PDL

    Extension
    thumbSDL::App- a SDL perl extension

    GFX
    thumbSDL::GFX::Framerate- framerate calculating functions
    thumbSDL::GFX::Primitives- basic drawing functions
    Structure
    thumbSDL::GFX::FPSManager- data structure used by SDL::GFX::Framerate

    Image
    thumbSDL::Image- Bindings for the SDL_Image library

    Mixer
    thumbSDL::Mixer- Sound and music functions
    thumbSDL::Mixer::Channels- SDL::Mixer channel functions and bindings
    thumbSDL::Mixer::Effects- sound effect functions
    thumbSDL::Mixer::Groups- Audio channel group functions
    thumbSDL::Mixer::Music- functions for music
    thumbSDL::Mixer::Samples- functions for loading sound samples
    Structure
    thumbSDL::Mixer::MixChunk- SDL Bindings for structure SDL_MixChunk
    thumbSDL::Mixer::MixMusic- SDL Bindings for structure SDL_MixMusic
    TODO
    Core
    MultiThread
    thumbSDL::MultiThread- Bindings to the MultiThread category in SDL API
    Structure
    thumbSDL::RWOps- SDL Bindings to SDL_RWOPs
    GFX
    thumbSDL::GFX::BlitFunc- blitting functions
    thumbSDL::GFX::ImageFilter- image filtering functions
    thumbSDL::GFX::Rotozoom- rotation and zooming functions for surfaces
    TTF
    thumbSDL::TTF- True Type Font functions (libfreetype)

    Tutorials
    thumbSDL::Tutorial- introduction to Perl SDL
    thumbSDL::Tutorial::Animation
    thumbSDL::Tutorial::Images
    thumbSDL::Tutorial::LunarLander- a small tutorial on Perl SDL
    thumbSDL::Tutorial::Pong- Get started pong
    thumbSDL::Tutorial::Tetris- Let's Make Tetris

    UNCATEGORIZED
    thumbSDL::Font- a SDL perl extension
    thumbSDL::Game::Palette- a perl extension
    thumbSDL::MPEG- a SDL perl extension
    thumbSDL::Music- a perl extension
    thumbSDL::OpenGL- a perl extension
    thumbSDL::SFont- a perl extension
    thumbSDL::SMPEG- a SDL perl extension
    thumbSDL::Sound- a perl extension
    thumbSDL::TTFont- a SDL perl extension
    thumbSDL::Tool::Font- a perl extension
    thumbSDL::Tool::Graphic
    +

    Documentation (latest development branch)

    Core
    thumbSDL- Simple DirectMedia Layer for Perl
    thumbSDL::Time- a SDL perl extension for managing timers.
    Audio
    thumbSDL::Audio- SDL Bindings for Audio
    Structure
    thumbSDL::AudioCVT- Audio Conversion Structure
    thumbSDL::AudioSpec- SDL Bindings for structure SDL::AudioSpec
    CDROM
    thumbSDL::CDROM- SDL Bindings for the CDROM device
    Structure
    thumbSDL::CD- SDL Bindings for structure SDL_CD
    thumbSDL::CDTrack- SDL Bindings for structure SDL_CDTrack
    Events
    thumbSDL::Events- Bindings to the Events Category in SDL API
    Structure
    thumbSDL::Event- General event structure
    Joystick
    thumbSDL::Joystick- SDL Bindings for the Joystick device
    Mouse
    thumbSDL::Mouse- SDL Bindings for the Mouse device
    Structure
    thumbSDL::Cursor- Mouse cursor structure
    Structure
    thumbSDL::Version- SDL Bindings for structure SDL_Version
    Video
    thumbSDL::Video- Bindings to the video category in SDL API
    Structure
    thumbSDL::Color- Format independent color description
    thumbSDL::Overlay- YUV Video overlay
    thumbSDL::Palette- Color palette for 8-bit pixel formats
    thumbSDL::PixelFormat- Stores surface format information
    thumbSDL::Rect- Defines a rectangular area
    thumbSDL::Surface- Graphic surface structure.
    thumbSDL::VideoInfo- Video Target Information

    Cookbook
    thumbSDL::Cookbook
    thumbSDL::Cookbook::PDL

    Extension
    thumbSDL::App- a SDL perl extension

    GFX
    thumbSDL::GFX::Framerate- framerate calculating functions
    thumbSDL::GFX::Primitives- basic drawing functions
    Structure
    thumbSDL::GFX::FPSManager- data structure used by SDL::GFX::Framerate

    Image
    thumbSDL::Image- Bindings for the SDL_Image library

    Mixer
    thumbSDL::Mixer- Sound and music functions
    thumbSDL::Mixer::Channels- SDL::Mixer channel functions and bindings
    thumbSDL::Mixer::Effects- sound effect functions
    thumbSDL::Mixer::Groups- Audio channel group functions
    thumbSDL::Mixer::Music- functions for music
    thumbSDL::Mixer::Samples- functions for loading sound samples
    Structure
    thumbSDL::Mixer::MixChunk- SDL Bindings for structure SDL_MixChunk
    thumbSDL::Mixer::MixMusic- SDL Bindings for structure SDL_MixMusic
    TODO
    Core
    MultiThread
    thumbSDL::MultiThread- Bindings to the MultiThread category in SDL API
    Structure
    thumbSDL::RWOps- SDL Bindings to SDL_RWOPs
    GFX
    thumbSDL::GFX::BlitFunc- blitting functions
    thumbSDL::GFX::ImageFilter- image filtering functions
    thumbSDL::GFX::Rotozoom- rotation and zooming functions for surfaces

    TTF
    thumbSDL::TTF- True Type Font functions (libfreetype)

    Tutorials
    thumbSDL::Tutorial- introduction to Perl SDL
    thumbSDL::Tutorial::Animation
    thumbSDL::Tutorial::Images
    thumbSDL::Tutorial::LunarLander- a small tutorial on Perl SDL
    thumbSDL::Tutorial::Pong- Get started pong
    thumbSDL::Tutorial::Tetris- Let's Make Tetris

    UNCATEGORIZED
    thumbSDL::Font- a SDL perl extension
    thumbSDL::Game::Palette- a perl extension
    thumbSDL::MPEG- a SDL perl extension
    thumbSDL::Music- a perl extension
    thumbSDL::OpenGL- a perl extension
    thumbSDL::SFont- a perl extension
    thumbSDL::SMPEG- a SDL perl extension
    thumbSDL::Sound- a perl extension
    thumbSDL::TTFont- a SDL perl extension
    thumbSDL::Tool::Font- a perl extension
    thumbSDL::Tool::Graphic