X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pages%2FSDL-TTF.html-inc;h=9779aaa0309d854bb45571851659c9e512c299d4;hb=c5291845aae25078edccea7589f9dd9aae805c3e;hp=394a88d282490c36f8bd4c47093132a7b921f386;hpb=b0e2356c9c3a2e11538ba77b8ff325f0f9e09b4b;p=sdlgit%2FSDL-Site.git
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'smaxy
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 widtglyph_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") };