Table of contents
Namespace: Com\Tecnick\Pdf\Font
class Font extends Load
Extends: Load
Source: src/Font.php:37
Methods
__construct()
Load an imported font
The definition file (and the font file itself when embedding) must be present either in the current directory or in the one indicated by K_PATH_FONTS if the constant is defined.
public __construct(
string $font,
string $style = '',
string $ifile = '',
bool $subset = false,
bool $unicode = true,
bool $pdfa = false,
bool $compress = true,
File|null $fileHelper = null
)
Parameters:
$font(string): Font family. If it is a standard family name, it will override the corresponding font.$style(string): Font style. Possible values are (case-insensitive): regular (default) B: bold I: italic U: underline D: strikeout (linethrough) O: overline$ifile(string): The font definition file (or empty for autodetect). By default, the name is built from the family and style, in lower case with no spaces.$subset(bool): If true, embed only the characters used by the document. Valid only for TrueTypeUnicode fonts. Subsetting is computational and memory intensive.$unicode(bool): True in Unicode mode, False otherwise.$pdfa(bool): True in PDF/A mode, False otherwise.$compress(bool): Set to false to disable stream compression.$fileHelper(File|null): Optional file helper for font loading.
Throws:
- Exception: in case of error
Source: src/Font.php:67
getFontData()
Get the font data
public getFontData(): TFontData
Returns: TFontData
Source: src/Font.php:113
getFontkey()
Get the font key
public getFontkey(): string
Returns: string
Source: src/Font.php:103
Inherited members
From Load
- DEFAULT_DATA: Default value of every font data entry.
- __construct()
- load(): Load the font data
- setFileData(): Set the embedded font file lengths