new
$font = PDF::Builder::Resource::Font::SynFont->new($pdf, $fontobj, %opts)
Returns a synfont object. $fontobj is a normal font object read in from a file, and $font is the
modified output.
Valid options %opts are:
encode
Changes the encoding of the font from its default. See Perl'sEncode for the supported values.
Warning: only single byte encodings are supported. Multibyte encodings such as UTF-8 are invalid.
pdfname
Changes the reference-name of the font from its default. The reference-name is normally
generated automatically and can be retrieved via $pdfname=$font->name().
Alternatename: "name" (for PDF::API2 compatibility)
condense
Character width condense/expand factor (0.1-0.9 = condense, 1 = normal/default, 1.1+ = expand).
It is the multiplier to apply to the width of each character.
Alternatenames: "hscale" and "slant" (for PDF::API2 compatibility)
The slant option is a deprecated name in both PDF::Builder and PDF::API2. Its value is the same
as condense value (1 = normal, unchanged scale). For the hscale option, the value is percentage
(%), with 100 being normal, and other values 100 times the condense value. Useonlyone(atmost)ofthesethreeoptionnames.oblique
Italic or slanted text angle (+/-) in degrees, where the character box is skewed (sheared), top
to the right. While it's unlikely that anyone will want to slant characters at +/-360 degrees,
they should be aware that these will be treated as an angle of 0 degrees (deg2rad() wraps
around). 0 degrees of italic slant (obliqueness) is the default.
Alternatename: "angle" (for PDF::API2 compatibility)
Useonlyone(atmost)ofthesetwooptionnames.bold
Embolding factor (0.1+, bold=1, heavy=2, ...). It is additional outline thickness (linewidth),
which expands the character (glyph) outwards (as well as shrinking unfilled enclosed areas such
as bowls and counters). Normally, the glyph's outline is not drawn (it is only filled); this
adds a thick outline. The units are in 1/100ths of a text unit.
If used with the "synthetic_font" alternate entry name, the unit is 1/1000th of a text unit, so
you will need a value 10 times larger than with the "synfont" entry to get the same effect.
space
Additional charspacing in thousandths of an em.
caps
Create synthetic small-caps. 0 = no, 1 = yes. These are capitals of lowercase letters, at 80%
height and 88% width. Note that this is guaranteed to cover ASCII lowercase letters only --
single byte encoded accented characters usually work, but we can make no promises on accented
characters in general, as well as ligatures!
Alternatename: "smallcaps" (for PDF::API2 compatibility)
Useonlyone(atmost)ofthesetwooptionnames.
Note that only lower case letters which appear in the "standard" font (plane 0 for core fonts and
PS fonts) will be small-capped. This may include eszett (German sharp s), which becomes SS, and
dotless i and j which become I and J respectively. There are many other accented Latin alphabet
letters which may show up in planes 1 and higher. Ligatures (e.g., ij and ffl) do not have
uppercase equivalents, nor does a long s. If you have text which includes such characters, you
may want to consider preprocessing it to replace them with Latin character expansions (e.g., i+j
and f+f+l) before small-capping.
perl v5.40.1 2025-08-10 PDF::Builder::...::Font::SynFont(3pm)