TCPDF_FONTS::addTTFfont( $fontfile, $fonttype = '', $enc = '', $flags = 32, $outpath = '', $platid = 3, $encid = 1, $addcbbox = false, $link = false )
Convert and add the selected TrueType or Type1 font to the fonts folder (that must be writeable).
Description Description
Parameters Parameters
- $fontfile
-
(Required) (string) Font file (full path).
- $fonttype
-
(Optional) (string) Font type. Leave empty for autodetect mode. Valid values are: TrueTypeUnicode, TrueType, Type1, CID0JP = CID-0 Japanese, CID0KR = CID-0 Korean, CID0CS = CID-0 Chinese Simplified, CID0CT = CID-0 Chinese Traditional.
Default value: ''
- $enc
-
(Optional) (string) Name of the encoding table to use. Leave empty for default mode. Omit this parameter for TrueType Unicode and symbolic fonts like Symbol or ZapfDingBats.
Default value: ''
- $flags
-
(Optional) (int) Unsigned 32-bit integer containing flags specifying various characteristics of the font (PDF32000:2008 - 9.8.2 Font Descriptor Flags): +1 for fixed font; +4 for symbol or +32 for non-symbol; +64 for italic. Fixed and Italic mode are generally autodetected so you have to set it to 32 = non-symbolic font (default) or 4 = symbolic font.
Default value: 32
- $outpath
-
(Optional) (string) Output path for generated font files (must be writeable by the web server). Leave empty for default font folder.
Default value: ''
- $platid
-
(Optional) (int) Platform ID for CMAP table to extract (when building a Unicode font for Windows this value should be 3, for Macintosh should be 1).
Default value: 3
- $encid
-
(Optional) (int) Encoding ID for CMAP table to extract (when building a Unicode font for Windows this value should be 1, for Macintosh should be 0). When Platform ID is 3, legal values for Encoding ID are: 0=Symbol, 1=Unicode, 2=ShiftJIS, 3=PRC, 4=Big5, 5=Wansung, 6=Johab, 7=Reserved, 8=Reserved, 9=Reserved, 10=UCS-4.
Default value: 1
- $addcbbox
-
(Optional) (boolean) If true includes the character bounding box information on the php font file.
Default value: false
- $link
-
(Optional) (boolean) If true link to system font instead of copying the font data (not transportable) - Note: do not work with Type1 fonts.
Default value: false
Return Return
((string)) TCPDF font name or boolean false in case of error.
Source Source
File: includes/lib/tcpdf/include/tcpdf_fonts.php
Changelog Changelog
Version | Description |
---|---|
5.9.123 | Introduced. |