pdf-raku / PDF-Font-Loader-raku

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

Example is confusing for understanding the difference between finding and loading a font #26

Open tbrowder opened 1 year ago

tbrowder commented 1 year ago

To me it is clearer to separate the two actions, if I understand correctly:

use PDF::Font::Loader :load-font, :find-font;
my $font-file = find-font: :family<DejaVu>, :slant<italic>, :lang<en>;
my $font      = load-font: $font-file;

# use the font in PDF-Lite
# ...
$pdf.add-page.text: {
    .font = $font;
    .text-position = [10, 600];
    .say: 'Hello, world';
}
# ...
tbrowder commented 9 months ago

In the example the font size entry is missing. I think it should be something like:

.font = $font, $font-size; # in PS points