classes-Com-Tecnick-Pdf-Font-Import

It appears that you are using AdBlocking software. The cost of running this website is covered by advertisements. If you like it please feel free to a small amount of money to secure the future of this website.

Com\Tecnick\Pdf\Font\Import

Tags
since
2011-05-23
category

Library

author

Nicola Asuni info@tecnick.com

copyright

2011-2015 Nicola Asuni - Tecnick.com LTD

license

http://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT)

link
https://github.com/tecnickcom/tc-lib-pdf-font

Table of Contents

$fbyte  : Byte
Object used to read font bytes
$fdt  : array<string|int, mixed>
Extracted font metrics
$font  : string
Content of the input font file
__construct()  : mixed
Import the specified font and create output files.
getFontMetrics()  : string
Get all the extracted font metrics
getFontName()  : string
Get the output font name
findOutputPath()  : string
Find the path where to store the processed font.
getEncodingDiff()  : string
If required, get differences between the reference encoding (cp1252) and the current encoding
getEncodingTable()  : mixed
Get the encoding table
getFontType()  : string
Get the font type
initFlags()  : mixed
Initialize font flags from font name
makeFontName()  : string
Make the output font name
saveFontData()  : mixed
Save the eported metadata font file
updateCIDtoGIDmap()  : string
Update the CIDToGIDMap string with a new value

Properties

$fbyte

Object used to read font bytes

protected Byte $fbyte

$fdt

Extracted font metrics

protected array<string|int, mixed> $fdt = array()

$font

Content of the input font file

protected string $font = ''

Methods

__construct()

Import the specified font and create output files.

public __construct(string $file[, string $output_path = null ][, string $type = null ][, string $encoding = '' ][, int $flags = 32 ][, int $platform_id = 3 ][, int $encoding_id = 1 ][, bool $linked = false ]) : mixed
Parameters
$file : string

Font file to process

$output_path : string = null

Output path for generated font files (must be writeable by the web server). Leave null for default font folder.

$type : string = null

Font type. Leave empty for autodetect mode. Valid values are: Core (AFM - Adobe Font Metrics) TrueTypeUnicode TrueType Type1 CID0JP (CID-0 Japanese) CID0KR (CID-0 Korean) CID0CS (CID-0 Chinese Simplified) CID0CT (CID-0 Chinese Traditional)

$encoding : 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.

$flags : int = 32

Unsigned 32-bit integer containing flags specifying various characteristics of the font as described in "PDF32000:2008 - 9.8.2 Font Descriptor Flags": +1 for fixed width font +4 for symbol or +32 for non-symbol +64 for italic Note: Fixed and Italic mode are generally autodetected, so you have to set it to 32 = non-symbolic font (default) or 4 = symbolic font.

$platform_id : int = 3

Platform ID for CMAP table to extract. For a Unicode font for Windows this value should be 3, for Macintosh should be 1.

$encoding_id : int = 1

Encoding ID for CMAP table to extract. For 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.

$linked : bool = false

If true, links the font file to system font instead of copying the font data (not transportable). Note: this option do not work with Type1 fonts.

Tags
throws
Exception

in case of error

Return values
mixed

getFontMetrics()

Get all the extracted font metrics

public getFontMetrics() : string
Return values
string

getFontName()

Get the output font name

public getFontName() : string
Return values
string

findOutputPath()

Find the path where to store the processed font.

protected findOutputPath([string $output_path = null ]) : string
Parameters
$output_path : string = null

Output path for generated font files (must be writeable by the web server). Leave null for default font folder (K_PATH_FONTS).

Return values
string

getEncodingDiff()

If required, get differences between the reference encoding (cp1252) and the current encoding

protected getEncodingDiff() : string
Return values
string

getEncodingTable()

Get the encoding table

protected getEncodingTable(string|null $encoding) : mixed
Parameters
$encoding : string|null

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.

Return values
mixed

getFontType()

Get the font type

protected getFontType(string $font_type) : string
Parameters
$font_type : string

Font type. Leave empty for autodetect mode.

Return values
string

initFlags()

Initialize font flags from font name

protected initFlags() : mixed
Return values
mixed

makeFontName()

Make the output font name

protected makeFontName(string $font_file) : string
Parameters
$font_file : string

Input font file

Return values
string

saveFontData()

Save the eported metadata font file

protected saveFontData() : mixed
Return values
mixed

updateCIDtoGIDmap()

Update the CIDToGIDMap string with a new value

protected updateCIDtoGIDmap(string $map, int $cid, int $gid) : string
Parameters
$map : string

CIDToGIDMap.

$cid : int

CID value.

$gid : int

GID value.

Return values
string
 

© 2004-2023 – Nicola Asuni - Tecnick.com - All rights reserved.
about - disclaimer - privacy