1PDF::Builder::Resource:U:sFeorntC:o:nStyrniFbountte(d3P)PDeFr:l:BDuoicludmeern:t:aRteisoonurce::Font::SynFont(3)
2
3
4
6 PDF::Builder::Resource::Font::SynFont - Module for creating temporary
7 synthetic Fonts.
8
10 This module permits you to create a "new" font (loaded temporarily, but
11 not permanently stored) based on an existing font, where you can modify
12 certain attributes in the original font, such as:
13
14 * slant/obliqueness
15 * extra weight/boldness (by drawing glyph outlines at various line
16 thicknesses, rather than just filling enclosed areas)
17 * condense/expand (narrower or wider characters)
18 * extra space between characters
19 * small caps (synthesized, not using any provided with a font)
20 * change the encoding
21
22 $pdf = PDF::Builder->new();
23 $cft = $pdf->font('Times-Roman'); # corefont, ttfont, etc. also works
24 $sft = $pdf->synfont($cft, 'condense' => .75); # condense by 25%
25
26 This works for corefonts, PS fonts, and TTF/OTF fonts; but does not
27 work for CJK fonts or bitmapped fonts. See also "Synthetic Fonts" in
28 PDF::Builder::Docs.
29
30 Alternate name: "synthetic_font"
31
32 This is for compatibility with recent changes to PDF::API2.
33
35 $font = PDF::Builder::Resource::Font::SynFont->new($pdf, $fontobj,
36 %opts)
37 Returns a synfont object. $fontobj is a normal font object read in
38 from a file, and $font is the modified output.
39
40 Valid options %opts are:
41
42 encode
43 Changes the encoding of the font from its default. See Perl's
44 Encode for the supported values. Warning: only single byte
45 encodings are supported. Multibyte encodings such as UTF-8 are
46 invalid.
47
48 pdfname
49 Changes the reference-name of the font from its default. The
50 reference-name is normally generated automatically and can be
51 retrieved via $pdfname=$font->name().
52
53 Alternate name: "name" (for PDF::API2 compatibility)
54
55 condense
56 Condense/expand factor (0.1-0.9 = condense, 1 = normal, 1.1+ =
57 expand). It's the multiplier for character widths vs. normal.
58
59 Alternate names: "hscale" and "slant" (for PDF::API2
60 compatibility)
61
62 The slant option is a deprecated name in both PDF::Builder and
63 PDF::API2. Its value is the same as condense value (1 =
64 normal, unchanged scale). For the hscale option, the value is
65 percentage (%), with 100 being normal, and other values 100
66 times the condense value. Use only one (at most) of these
67 three option names.
68
69 oblique
70 Italic angle (+/-) in degrees, where the character box is
71 skewed. While it's unlikely that anyone will want to slant
72 characters at +/-360 degrees, they should be aware that these
73 will be treated as an angle of 0 degrees (deg2rad() wraps
74 around). 0 degrees of italic slant (obliqueness) is the
75 default.
76
77 Alternate name: "angle" (for PDF::API2 compatibility)
78
79 Use only one (at most) of these two option names.
80
81 bold
82 Embolding factor (0.1+, bold=1, heavy=2, ...). It is additional
83 outline thickness (linewidth), which expands the character
84 (glyph) outwards (as well as shrinking unfilled enclosed areas
85 such as bowls and counters). Normally, the glyph's outline is
86 not drawn (it is only filled); this adds a thick outline. The
87 units are in 1/100ths of a text unit.
88
89 If used with the "synthetic_font" alternate entry name, the
90 unit is 1/1000th of a text unit, so you will need a value 10
91 times larger than with the "synfont" entry to get the same
92 effect
93
94 space
95 Additional charspacing in thousandths of an em.
96
97 caps
98 Create synthetic small-caps. 0 = no, 1 = yes. These are
99 capitals of lowercase letters, at 80% height and 88% width.
100 Note that this is guaranteed to cover ASCII lowercase letters
101 only -- single byte encoded accented characters usually work,
102 but we can make no promises on accented characters in general,
103 as well as ligatures!
104
105 Alternate name: "smallcaps" (for PDF::API2 compatibility)
106
107 Use only one (at most) of these two option names.
108
109
110
111perl v5.38.0 2023-P0D7F-:2:1Builder::Resource::Font::SynFont(3)