From: Tobias Leich Date: Thu, 18 Mar 2010 14:37:42 +0000 (+0100) Subject: added docs for glyphs X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=sdlgit%2FSDL-Site.git;a=commitdiff_plain;h=c5291845aae25078edccea7589f9dd9aae805c3e added docs for glyphs --- diff --git a/pages/SDL-TTF.html-inc b/pages/SDL-TTF.html-inc index 394a88d..9779aaa 100644 --- a/pages/SDL-TTF.html-inc +++ b/pages/SDL-TTF.html-inc @@ -378,7 +378,7 @@ 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.

Example:

-
 my ($minx, $maxx, $miny, $maxy, $advance) = @{ SDL::TTF::glyph_metrics($font, 'M') };
+
 my ($minx, $maxx, $miny, $maxy, $advance) = @{ SDL::TTF::glyph_metrics($font, "\0M") };
 
  $rect->y( $top + SDL::TTF::font_ascent($font) - $maxy );
 
@@ -395,7 +395,7 @@ 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.

Example:

-
 my ($minx, $maxx, $miny, $maxy, $advance) = @{ SDL::TTF::glyph_metrics($font, 'M') };
+
 my ($minx, $maxx, $miny, $maxy, $advance) = @{ SDL::TTF::glyph_metrics($font, "\0M") };
 
  $rect->y( $bottom - SDL::TTF::font_descent($font) - $maxy );
 
@@ -468,11 +468,29 @@ in the font is the same width, thus you can assume that a rendered string's widt
 
 

glyph_is_provided

+
 my $glyph_is_provided = SDL::TTF::glyph_is_provided($font, $unicode_char);
+
+
+

Get the status of the availability of the glyph from the loaded font.

+

Returns: the index of the glyph in font, or 0 for an undefined character code.

+

Note: You have to pass this unicode character either as UTF16/UCS-2 big endian without BOM, or with BOM as UTF16/UCS-2 big/little endian.

+

Note: at least SDL_ttf 2.0.10 needed

+

Example:

+
 print("We have this char!\n") if SDL::TTF::glyph_is_provided($font, "\0M");
+
+

glyph_metrics

-
 my @glyph_metrics = @{ SDL::TTF::glyph_metrics($font, 'M') };
+
 my @glyph_metrics = @{ SDL::TTF::glyph_metrics($font, $unicode_char) };
+
+
+

Get desired glyph metrics of the UNICODE char from the loaded font.

+

See also: The FreeType2 Documentation Tutorial

+

Note: You have to pass this unicode character either as UTF16/UCS-2 big endian without BOM, or with BOM as UTF16/UCS-2 big/little endian.

+

Example:

+
 my ($minx, $maxx, $miny, $maxy, $advance) = @{ SDL::TTF::glyph_metrics($font, "\0M") };
 
 
diff --git a/pages/documentation.html-inc b/pages/documentation.html-inc index 3d57f78..d0ebb06 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