FontPaths

Shared font paths rooted at the library base directory.

Namespace: Com\Tecnick\Pdf\Font

class FontPaths

Source: src/FontPaths.php:36

Shared font paths rooted at the library base directory.

Methods

buildAllowedPaths()

Build trusted roots for local font file access.

public static buildAllowedPaths(): string[]

Returns: string[]

Source: src/FontPaths.php:236

findFontFile()

Returns the full path of a font file, or an empty string when it is not found.

public static findFontFile(string $fontdir, string $file): string

Parameters:

  • $fontdir (string): Original font directory.
  • $file (string): Font file name.

Returns: string

Source: src/FontPaths.php:100

getConfigPath()

Returns the K_PATH_FONTS value, or an empty string when it is undefined or empty.

An existing directory is returned as its canonical realpath, without a trailing separator. Any other value is returned unchanged.

public static getConfigPath(): string

Returns: string

Source: src/FontPaths.php:69

getInputPath()

Returns the default input font directory.

public static getInputPath(): string

Returns: string

Source: src/FontPaths.php:218

getLibraryRoot()

Returns the library root directory.

public static getLibraryRoot(): string

Returns: string

Source: src/FontPaths.php:41

getOutputPath()

Returns the default output font directory.

public static getOutputPath(): string

Returns: string

Source: src/FontPaths.php:226

getPackagePaths()

Returns the canonical package font directories: the input directory (getInputPath()) and the generated font set (getOutputPath()).

Directories that do not exist or resolve to a filesystem root are left out.

public static getPackagePaths(): string[]

Returns: string[]: Directory paths without a trailing separator.

Source: src/FontPaths.php:137

isPackageFile()

Returns true when the file is inside a package font directory.

The check is made by a file helper whose allowlist is getPackagePaths().

public static isPackageFile(string $file): bool

Parameters:

  • $file (string): File path.

Returns: bool

Source: src/FontPaths.php:159