pdf-raku / PDF-Font-Loader-raku

Font loader for the PDF tool-chain
Artistic License 2.0
1 stars 3 forks source link

Synopsis example should show setting font size #37

Closed tbrowder closed 3 months ago

tbrowder commented 3 months ago

The only thing missing is how the font size is set for the SYNOPSIS example.

I think it's done like this:

:$size

or is it:

:$font-size

or?

dwarring commented 3 months ago

The font-size is set when the font is used. Have amended the synopsis as below:

use PDF::Font::Loader :&load-font;
my PDF::Content::FontObj $deja = load-font: :file<t/fonts/DejaVuSans.ttf>;
my $font-size = 12;
$pdf.add-page.text: {
    .font = $deja, $font-size;
  .text-position = [10, 600];
  .say: 'Hello, world';
}
tbrowder commented 3 months ago

Thanks, David. At my age I need that reminder!

You can close this issue if I don't get to it first.