1PDF::API2::Resource::FoUnste:r:SCyonnFtornitb(u3t)ed PerPlDFD:o:cAuPmIe2n:t:aRteisoonurce::Font::SynFont(3)
2
3
4
6 PDF::API2::Resource::Font::SynFont - Module for creating synthetic
7 Fonts.
8
10 my $pdf = PDF::API2->new();
11 my $base_font = $pdf->font('Helvetica');
12
13 # Create a condensed synthetic font
14 my $condensed = $pdf->synthetic_font($base_font, hscale => 80);
15
16 # Compare the two fonts
17 my $text = $pdf->page->text();
18
19 $text->font($base_font, 18);
20 $text->distance(72, 720);
21 $text->text('Hello World!');
22
23 $text->font($condensed, 18);
24 $text->distance(0, -36);
25 $text->text('Hello World!');
26
27 $pdf->save('sample.pdf');
28
30 This module allows you to create a custom font based on an existing
31 font, adjusting the scale, stroke thickness, angle, and other
32 properties of each glyph.
33
35 hscale
36 A percentage to condense (less than 100) or expand (greater than 100)
37 the glyphs horizontally.
38
39 angle
40 A number of degrees to lean the glyphs to the left (negative angle) or
41 to the right (positive angle).
42
43 bold
44 A stroke width, in thousandths of a text unit, to add to the glyph's
45 outline, creating a bold effect.
46
47 smallcaps
48 Set to true to replace lower-case characters with small versions of
49 their upper-case glyphs.
50
51 space
52 Additional space, in thousandths of a text unit, to add between glyphs.
53
54
55
56perl v5.36.0 2022-07-P2D2F::API2::Resource::Font::SynFont(3)