SDL2-FFI

 view release on metacpan or  search on metacpan

lib/SDL2/TTF.pm  view on Meta::CPAN

                SDL2::FFI::SDL_VERSIONNUM( SDL_TTF_MAJOR_VERSION(), SDL_TTF_MINOR_VERSION(),
                    SDL_TTF_PATCHLEVEL() );
            }
        ],
        [   SDL_TTF_VERSION_ATLEAST => sub ( $X, $Y, $Z ) {
                ( SDL_TTF_COMPILEDVERSION() >= SDL_VERSIONNUM( $X, $Y, $Z ) )
            }
        ]
    ];
    attach ttf => { TTF_Linked_Version => [ [], 'SDL_Version' ] };
    define ttf => [ [ UNICODE_BOM_NATIVE => 0xFEFF ], [ UNICODE_BOM_SWAPPED => 0xFFFE ] ];

    package SDL2::TTF::Font {
        use SDL2::Utils;
        our $TYPE = has();
    };
    attach ttf => {
        TTF_Init    => [ [], 'int' ],
        TTF_WasInit => [ [], 'int' ],
        TTF_Quit    => [ [] ],
        #

lib/SDL2/TTF.pm  view on Meta::CPAN


=back

=head1 Attribute Functions

These functions deal with L<SDL2::TTF::Font> and global attributes.

=head2 C<TTF_ByteSwappedUNICODE( ... )>

This function tells C<SDL_ttf> whether UNICODE (Uint16 per character) text is
generally byteswapped. A B<UNICODE_BOM_NATIVE> or B<UNICODE_BOM_SWAPPED>
character in a string will temporarily override this setting for the remainder
of that string, however this setting will be restored for the next one. The
default mode is non-swapped, native endianness of the CPU.

    # Turn on byte swapping for UNICODE text
    TTF_ByteSwappedUNICODE( 1 );

Expected parameters include:

=over

lib/SDL2/TTF.pm  view on Meta::CPAN

SDL_ttf library major number at compilation time.

=item C<TTF_MINOR_VERSION>

SDL_ttf library minor number at compilation time.

=item C<TTF_PATCHLEVEL>

SDL_ttf library patch level at compilation time.

=item C<UNICODE_BOM_NATIVE>

This allows you to switch byte-order of UNICODE text data to native order,
meaning the mode of your CPU. This is meant to be used in a UNICODE string that
you are using with the SDL_ttf API.

=item C<UNICODE_BOM_SWAPPED>

This allows you to switch byte-order of UNICODE text data to swapped order,
meaning the reversed mode of your CPU. So if your CPU is LSB, then the data
will be interpreted as MSB. This is meant to be used in a UNICODE string that
you are using with the SDL_ttf API.

=item C<TTF_STYLE_NORMAL>

Used to indicate regular, normal, plain rendering style.

src/ppport.h  view on Meta::CPAN

block_start|5.004000|5.004000|
BmFLAGS|5.009005||Viu
BmPREVIOUS|5.003007||Viu
BmRARE|5.003007||Viu
BmUSEFUL|5.003007||Viu
BOL|5.003007||Viu
BOL_t8_p8|5.033003||Viu
BOL_t8_pb|5.033003||Viu
BOL_tb_p8|5.033003||Viu
BOL_tb_pb|5.033003||Viu
BOM_UTF8|5.025005|5.003007|p
BOM_UTF8_FIRST_BYTE|5.019004||Viu
BOM_UTF8_TAIL|5.019004||Viu
bool|5.003007||Viu
boolSV|5.004000|5.003007|p
boot_core_mro|5.009005||Viu
boot_core_PerlIO|5.007002||Viu
boot_core_UNIVERSAL|5.003007||Viu
BOUND|5.003007||Viu
BOUNDA|5.013009||Viu
BOUNDA_t8_p8|5.033003||Viu
BOUNDA_t8_pb|5.033003||Viu
BOUNDA_tb_p8|5.033003||Viu

src/ppport.h  view on Meta::CPAN

#endif

#if defined(is_utf8_string) && defined(UTF8SKIP)
#ifndef isUTF8_CHAR
#define isUTF8_CHAR(s, e) ((e) <= (s) || !is_utf8_string(s, UTF8_SAFE_SKIP(s, e)) ? 0 : UTF8SKIP(s))
#endif

#endif

#if 'A' == 65
#ifndef BOM_UTF8
#define BOM_UTF8 "\xEF\xBB\xBF"
#endif

#ifndef REPLACEMENT_CHARACTER_UTF8
#define REPLACEMENT_CHARACTER_UTF8 "\xEF\xBF\xBD"
#endif

#elif '^' == 95
#ifndef BOM_UTF8
#define BOM_UTF8 "\xDD\x73\x66\x73"
#endif

#ifndef REPLACEMENT_CHARACTER_UTF8
#define REPLACEMENT_CHARACTER_UTF8 "\xDD\x73\x73\x71"
#endif

#elif '^' == 176
#ifndef BOM_UTF8
#define BOM_UTF8 "\xDD\x72\x65\x72"
#endif

#ifndef REPLACEMENT_CHARACTER_UTF8
#define REPLACEMENT_CHARACTER_UTF8 "\xDD\x72\x72\x70"
#endif

#else
#error Unknown character set
#endif

t/05_ttf.t  view on Meta::CPAN

    isa_ok TTF_RenderUNICODE_Blended( $font, 'Testing!', $red ), ['SDL2::Surface'],
        'TTF_RenderUNICODE_Blended( ... ) returns an SDL2::Surface';
    isa_ok TTF_RenderGlyph_Blended( $font, 'H', $red ), ['SDL2::Surface'],
        'TTF_RenderGlyph_Blended( ... ) returns an SDL2::Surface';
}
#
can_ok $_ for qw[
    SDL_TTF_MAJOR_VERSION
    SDL_TTF_MINOR_VERSION
    SDL_TTF_PATCHLEVEL
    UNICODE_BOM_NATIVE
    UNICODE_BOM_SWAPPED
    TTF_STYLE_NORMAL
    TTF_STYLE_BOLD
    TTF_STYLE_ITALIC
    TTF_STYLE_UNDERLINE
    TTF_STYLE_STRIKETHROUGH
    TTF_HINTING_NORMAL
    TTF_HINTING_LIGHT
    TTF_HINTING_MONO
    TTF_HINTING_NONE
    TTF_HINTING_LIGHT_SUBPIXEL];



( run in 0.762 second using v1.01-cache-2.11-cpan-e9daa2b36ef )