Table of contents
Namespace: Com\Tecnick\Pdf\Font
Extends: Load
File: Font.php line 37
Tags
- since: 2011-05-23
- category: Library
- author: Nicola Asuni info@tecnick.com
- copyright: 2011-2026 Nicola Asuni - Tecnick.com LTD
- license: https://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE)
- link: https://github.com/tecnickcom/tc-lib-pdf-font
- phpstan-import-type: TFontData from Load
Constants
DEFAULT_DATA
File: Load.php line 208
public TFontData DEFAULT_DATA = ['Ascender' => 0, 'Ascent' => 0, 'AvgWidth' => 0.0, 'CapHeight' => 0, 'CharacterSet' => '', 'Descender' => 0, 'Descent' => 0, 'EncodingScheme' => '', 'FamilyName' => '', 'Flags' => 0, 'FontBBox' => [], 'FontName' => '', 'FullName' => '', 'IsFixedPitch' => false, 'ItalicAngle' => 0, 'Leading' => 0, 'MaxWidth' => 0, 'MissingWidth' => 0, 'StdHW' => 0, 'StdVW' => 0, 'StemH' => 0, 'StemV' => 0, 'UnderlinePosition' => 0, 'UnderlineThickness' => 0, 'Version' => '', 'Weight' => '', 'XHeight' => 0, 'bbox' => '', 'cbbox' => [], 'cbboxu' => [], 'cidinfo' => ['Ordering' => '', 'Registry' => '', 'Supplement' => 0, 'uni2cid' => []], 'compress' => false, 'ctg' => '', 'ctgdata' => [], 'ctgu' => [], 'cw' => [], 'cwu' => [], 'datafile' => '', 'desc' => ['Ascent' => 0, 'AvgWidth' => 0, 'CapHeight' => 0, 'Descent' => 0, 'Flags' => 0, 'FontBBox' => '', 'ItalicAngle' => 0, 'Leading' => 0, 'MaxWidth' => 0, 'MissingWidth' => 0, 'StemH' => 0, 'StemV' => 0, 'XHeight' => 0], 'diff' => '', 'diff_n' => 0, 'dir' => '', 'dw' => 0, 'enc' => '', 'enc_map' => [], 'encodingTables' => [], 'encoding_id' => 0, 'encrypted' => '', 'fakestyle' => false, 'family' => '', 'file' => '', 'file_n' => 0, 'file_name' => '', 'gidenc' => false, 'i' => 0, 'ifile' => '', 'indexToLoc' => [], 'input_file' => '', 'isUnicode' => false, 'italicAngle' => 0, 'key' => '', 'lenIV' => 0, 'length1' => 0, 'length2' => 0, 'linked' => false, 'mode' => ['bold' => false, 'italic' => false, 'linethrough' => false, 'overline' => false, 'underline' => false], 'n' => 0, 'name' => '', 'numGlyphs' => 0, 'numHMetrics' => 0, 'originalsize' => 0, 'pdfa' => false, 'platform_id' => 0, 'settype' => '', 'short_offset' => false, 'size1' => 0, 'size2' => 0, 'style' => '', 'subset' => false, 'subsetchars' => [], 'table' => [], 'tot_num_glyphs' => 0, 'type' => '', 'underlinePosition' => 0, 'underlineThickness' => 0, 'unicode' => false, 'unitsPerEm' => 0, 'up' => 0, 'urk' => 0.0, 'usedgid' => [], 'ut' => 0, 'weight' => '']
Shared with Import and Subset, which start from the same state.
Methods
__construct()
File: Font.php line 67
public __construct(string $font[, string $style = '' ][, string $ifile = '' ][, bool $subset = false ][, bool $unicode = true ][, bool $pdfa = false ][, bool $compress = true ][, File|null $fileHelper = null ]) : mixed
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.
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 = false: If true, embed only the characters used by the document. Valid only for TrueTypeUnicode fonts. Subsetting is computational and memory intensive.
- $unicode : bool = true: True in Unicode mode, False otherwise.
- $pdfa : bool = false: True in PDF/A mode, False otherwise.
- $compress : bool = true: Set to false to disable stream compression.
- $fileHelper : File|null = null: Optional file helper for font loading.
Tags
- throws: Exception in case of error
getFontData()
File: Font.php line 113
public getFontData() : TFontData
Return values
TFontData
getFontkey()
File: Font.php line 103
public getFontkey() : string
Return values
string
load()
File: Load.php line 349
public load() : void
Tags
- throws: Exception in case of error
setFileData()
File: Load.php line 568
public setFileData() : void