Cairo

Synopsis

use HarfBuzz::Shaper::Cairo :&cairo-glyphs;
    use HarfBuzz::Shaper;
    use Cairo;
    my Cairo::Glyphs $glyphs;
    my $file = 't/fonts/NimbusRoman-Regular.otf';
    my $text = 'Hell€!';
    # -- functional interface --
    my HarfBuzz::Shaper $shaper .= new: :font{:$file}, :buf{:$text};
    $glyphs = cairo-glyphs($shaper);
    # -- OO interface --
    my HarfBuzz::Shaper::Cairo $shaper2 .= new: :font{:$file}, :buf{:$text};
    $glyphs = $shaper2.cairo-glyphs;
    # -- FreeType integration --
    use Font::FreeType;
    use Font::FreeType::Face;
    use Harfbuzz::Shaper::Cairo::Font;
    my Font::FreeType::Face $ft-face = Font::FreeType.face: $file;
    my Harfbuzz::Shaper::Cairo::Font $font .= new: :$file;
    my HarfBuzz::Shaper::Cairo $shaper3 .= $font.shaper: {:$text};
    $glyphs = $shaper3.cairo-glyphs;

Description

This module compiles a set of shaped glyphs into a Cairo::Glyphs object; suitable for use by the Cairo::Context `show_glyphs()` and `glyph_path()` methods.

Please see the `examples/` folder, for a full working example.

Methods

The returned object is typically passed to either the Cairo::Context show_glyphs() or glyph_path() methods

HarfBuzz::Shaper::Cairo v0.0.5

Cairo integeration for the HarfBuzz font shaping library

Authors

  • David Warring

License

Artistic-2.0

Dependencies

HarfBuzz:ver<0.0.11+>HarfBuzz::Font::FreeType:ver<0.0.5+>Cairo:ver<0.2.7+>

Test Dependencies

Provides

  • HarfBuzz::Font::Cairo
  • HarfBuzz::Shaper::Cairo

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