| Text::Layout::FontConfig(3pm) | User Contributed Perl Documentation | Text::Layout::FontConfig(3pm) |
Text::Layout::FontConfig - Pango style font description for Text::Layout
Font descriptors are strings that identify the characteristics of the desired font. For example, "Sans Italic 20".
The PDF context deals with physical fonts, e.g. built-in fonts like "Times-Bold" and fonts loaded from font files like "/usr/share/fonts/dejavu/DejaVuSans.ttf".
To map font descriptions to physical fonts, these fonts must be registered. This defines a font family, style, and weight for the font.
Note that Text::Layout::FontConfig is a singleton. Creating objects with new() will always return the same object.
Attributes:
$font can be the name of a built-in font, or the name of a TrueType or OpenType font file.
$family is a font family name such as "normal", "sans", "serif", or "monospace". It is possible to specify multiple family names, e.g., "times, serif".
$style is the slant style, one of "normal", "oblique", or "italic".
$weight is the font weight, like "normal", or "bold".
For convenience, style combinations like "bolditalic" are allowed.
A final hash reference can be passed to specify additional properties for this font. Recognized properties are:
Text shaping requires module HarfBuzz::Shaper.
"descender" - If set overrides the font descender. This may be necessary to improve results for some fonts. The value is expressed in 1/1000th of an em.
Note that strikeline thickness will default to underline thickness, if set.
This may improve results for some fonts.
Note that overline thickness will default to underline thickness, if set.
Multiple aliases can be specified, e.g.
$layout->register_aliases( "times", "serif, default" );
or
$layout->register_aliases( "times", "serif", "default" );
Aliases for families "serif", "sans", and "monospace" are added unless $noaliases is specified.
You do not need to call this method if you provide your own font registrations.
On Linux, fallback using fontconfig.
On Linux, fallback using fontconfig.
Unspecified items are returned as empty strings or, in the case of "size", zero.
Text::Layout, Text::Layout::FontDescriptor.
Johan Vromans, "<JV at CPAN dot org>"
This module is part of <Text::Layout>.
Development takes place on GitHub: <https://github.com/sciurius/perl-Text-Layout>.
You can find documentation for this module with the perldoc command.
perldoc Text::Layout::FontConfig
Please report any bugs or feature requests using the issue tracker for Text::Layout on GitHub.
See Text::Layout, Text::Layout::FontDescriptor, HarfBuzz::Shaper.
| 2024-02-23 | perl v5.38.2 |