Raw

NAME

module Font::FreeType::Raw - bindings to the freetype library

SYNOPSIS

# E.g. build an array of advance widths by glyph ID
    use Font::FreeType::Face;
    use Font::FreeType::Raw;
    use Font::FreeType::Raw::Defs;
sub face-unicode-map(Font::FreeType::Face $face) {
        my uint16 @advance[$face.num-glyphs];
        my FT_Face  $struct = $face.raw;  # get the raw native face object
        my FT_UInt  $glyph-idx;
        my FT_ULong $char-code = $struct.FT_Get_First_Char( $glyph-idx);
        while $glyph-idx {
            # FT_Load_Glyph updates $struct.glyph, so is not thread safe
            $face.protect: {
                $struct.FT_Load_Glyph( $gid, FT_LOAD_NO_SCALE );
                @advance[$glyph-idx] = $struct.glyph.metrics.hori-advance;
            }
            $char-code = $struct.FT_Get_Next_Char( $char-code, $glyph-idx);
        }
    }

DESCRIPTION

This class contains structure definitions and bindings for the FreeType library.

Containing classes, by convention, have a `raw()` accessor, which can be used, if needed, to gain access to native objects from this class:

Class | raw() binding | Description
Font::FreeType | FT_Library | A handle to a freetype library instance
Font::FreeType::Face | FT_Face | A Handle to a typographic face object
Font::FreeType::Glyph | FT_GlyphSlot | A handle to a glyph container
Font::FreeType::GlyphImage | FT_Glyph | A specific glyph bitmap or outline object
Font::FreeType::BitMap | FT_Bitmap | A rendered bitmap for a glyph
Font::FreeType::Outline | FT_Outline | A scalable glyph outline

Font::FreeType v0.4.0

read font files and render glyphs from Raku using FreeType2

Authors

  • David Warring

License

Artistic-2.0

Dependencies

Method::Also

Test Dependencies

Provides

  • Font::FreeType
  • Font::FreeType::BBox
  • Font::FreeType::BitMap
  • Font::FreeType::CharMap
  • Font::FreeType::Error
  • Font::FreeType::Face
  • Font::FreeType::Glyph
  • Font::FreeType::GlyphImage
  • Font::FreeType::NamedInfo
  • Font::FreeType::Native
  • Font::FreeType::Native::Defs
  • Font::FreeType::Outline
  • Font::FreeType::Raw
  • Font::FreeType::Raw::Defs
  • Font::FreeType::Raw::TT_Sfnt

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.