NAME
Text::Layout::FontConfig - Pango style font description for Text::Layout
SYNOPSIS
Font descriptors are strings that identify the characteristics of the desired font. For example, Sans Italic 20
.
The PDF context deals with fysical 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 fysical 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.
METHODS
- new
-
For convenience only. Text::Layout::FontConfig is a singleton. Creating objects with new() will always return the same object.
- register_fonts( $font, $family, $style, $weight )
-
Registers a font fmaily, style and weight for the given font.
$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
, ormonospace
. It is possible to specify multiple family names, e.g.,times, serif
.$style is the slant style, one of
normal
,oblique
, oritalic
.$weight is the font weight, like
normal
, orbold
.For convenience, style combinations like "bolditalic" are allowed.
- register_aliases( $family, $aliases, ... )
-
Adds aliases for existing font families.
Multiple aliases can be specified, e.g.
$layout->register_aliases( "times", "serif, default" );
or
$layout->register_aliases( "times", "serif", "default" );
- register_corefonts
-
This is a convenience method that registers all built-in corefonts.
Aliases for families
serif
,sans
, andmonospace
are added.You do not need to call this method if you provide your own font registrations.
- from_string( $description )
-
Returns a font object using a Pango-style font description, e.g.
Sans Italic 14
.
- to_string
-
Returns a Pango-style font string,
Sans Italic 14
.
SEE ALSO
PDF::API2::Layout::Simple, PDF::API2, PDF::Builder, Font::TTF.
AUTHOR
Johan Vromans, <JV at CPAN dot org>
SUPPORT
Development of this module takes place on GitHub: https://github.com/sciurius/xxx.
You can find documentation for this module with the perldoc command.
perldoc PDF::API2::Layout::Simple
Please report any bugs or feature requests using the issue tracker on GitHub.
LICENSE
Copyright (C) 2019, Johan Vromans
This module is free software. You can redistribute it and/or modify it under the terms of the Artistic License 2.0.
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 377:
=back without =over