Sgss_Font_Parser

Description

Author:
Matsuda Shota
Copyright:
(c) 2007-2008 Matsuda Shota
License:
http://creativecommons.org/licenses/GPL/2.0/
Located in:
/Font/Parser.php (line 49)

Class overview

Variables

protected string $_cacheDirectory

Default font cache directory

protected string $_cacheExtension

File extension of cache file

protected string $_fontDirectory

Default font file directory

protected array $_parsers

Methods

void addParser (int|string $sfnt, Sgss_Font_Parser_Interface $parser)

Adds the specified parser into the specified sfnt of this parser

string|null getCacheDirectory ()
string getCacheExtension ()
string|null getFontDirectory ()
__construct ([Sgss_File|string|null $fontDirectory = null], [Sgss_File|string|null $cacheDirectory = null], [string $cacheExtension = '.cache'])

The constructor

Sgss_Font_Format_Interface parse (string|Sgss_File $font, [string|Sgss_File|null $cache = null])

Parses the specified file of font

void removeAllParsers ()

Removes all the parsers from this parser

void removeParser (int|string $sfnt)

Removes the parser of the specified sfnt from this parser

void setCacheDirectory (Sgss_File|string $directory)
void setCacheExtension (string $extension)
void setFontDirectory (Sgss_File|string $directory)
void setOutputLevel (int $level)
protected void _init ()

Initializes this parser

protected string _setupCacheName (string $fontFile)

Constants

OUTPUT_ALL = 15
OUTPUT_DEBUG = 8
OUTPUT_ERROR = 1
OUTPUT_NONE = 0
OUTPUT_NOTICE = 4
OUTPUT_WARNING = 2

Variable detail

$_cacheDirectory 

Default font cache directory

Signature:
protected string $_cacheDirectory = null


$_cacheExtension 

File extension of cache file

Signature:
protected string $_cacheExtension = null


$_fontDirectory 

Default font file directory

Signature:
protected string $_fontDirectory = null


$_parsers 

Signature:
protected array $_parsers = array()


Method detail

addParser

Adds the specified parser into the specified sfnt of this parser

Parameters:
Throws:
  • Sgss_Font_Parser_Exception
Signature:
public void addParser (int|string $sfnt, Sgss_Font_Parser_Interface $parser)


getCacheDirectory

Signature:
public string|null getCacheDirectory ()


getCacheExtension

Signature:
public string getCacheExtension ()


getFontDirectory

Signature:
public string|null getFontDirectory ()


__construct

The constructor

Parameters:
  • Sgss_File|string|null $fontDirectory
  • Sgss_File|string|null $cacheDirectory
  • string $cacheExtension
Signature:
public __construct ([Sgss_File|string|null $fontDirectory = null], [Sgss_File|string|null $cacheDirectory = null], [string $cacheExtension = '.cache'])


parse

Parses the specified file of font

Parameters:
Throws:
  • Sgss_Font_Parser_Exception
Signature:
public Sgss_Font_Format_Interface parse (string|Sgss_File $font, [string|Sgss_File|null $cache = null])


removeAllParsers

Removes all the parsers from this parser

Signature:
public void removeAllParsers ()


removeParser

Removes the parser of the specified sfnt from this parser

Parameters:
  • int|string $sfnt
Throws:
  • Sgss_Font_Parser_Exception
Signature:
public void removeParser (int|string $sfnt)


setCacheDirectory

Parameters:
Signature:
public void setCacheDirectory (Sgss_File|string $directory)


setCacheExtension

Parameters:
  • string $extension
Signature:
public void setCacheExtension (string $extension)


setFontDirectory

Parameters:
Signature:
public void setFontDirectory (Sgss_File|string $directory)


setOutputLevel

Parameters:
  • int $level
Signature:
public void setOutputLevel (int $level)


_init 

Initializes this parser

Signature:
protected void _init ()


_setupCacheName 

Parameters:
  • string $fontFile
Signature:
protected string _setupCacheName (string $fontFile)


Constant detail

OUTPUT_ALL

Signature:
const OUTPUT_ALL = 15


OUTPUT_DEBUG

Signature:
const OUTPUT_DEBUG = 8


OUTPUT_ERROR

Signature:
const OUTPUT_ERROR = 1


OUTPUT_NONE

Signature:
const OUTPUT_NONE = 0


OUTPUT_NOTICE

Signature:
const OUTPUT_NOTICE = 4


OUTPUT_WARNING

Signature:
const OUTPUT_WARNING = 2