PDF::Builder::Resource::Font::SynFont(3pm) | User Contributed Perl Documentation | PDF::Builder::Resource::Font::SynFont(3pm) |
PDF::Builder::Resource::Font::SynFont - Module for creating temporary synthetic Fonts.
This module permits you to create a "new" font (loaded temporarily, but not permanently stored) based on an existing font, where you can modify certain attributes in the original font, such as:
* slant/obliqueness * extra weight/boldness (by drawing glyph outlines at various line thicknesses, rather than just filling enclosed areas) * condense/expand (narrower or wider characters) * extra space between characters * small caps (synthesized, not using any provided with a font) * change the encoding $pdf = PDF::Builder->new(); $cft = $pdf->font('Times-Roman'); # corefont, ttfont, etc. also works $sft = $pdf->synfont($cft, 'condense' => .75); # condense by 25%
This works for corefonts, PS fonts, and TTF/OTF fonts; but does not work for CJK fonts or bitmapped fonts. See also "Synthetic Fonts" in PDF::Builder::Docs.
Alternate name: "synthetic_font"
This is for compatibility with recent changes to PDF::API2.
Valid options %opts are:
Alternate name: "name" (for PDF::API2 compatibility)
Alternate names: "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. Use only one (at most) of these three option names.
Alternate name: "angle" (for PDF::API2 compatibility)
Use only one (at most) of these two option names.
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
Alternate name: "smallcaps" (for PDF::API2 compatibility)
Use only one (at most) of these two option names.
2023-01-24 | perl v5.36.0 |