| Sgss_Font_Manager | The default class for managing fonts using database |
|
$_cacheDirectory
Default font cache directory |
|
$_coverages
Coverage table |
|
$_db
Database handle |
|
$_dbAdapter
Database adapter name |
|
$_dbConfig
Database configurations |
|
$_fontDirectory
Default font file directory |
|
$_fonts
Font table |
|
$_fontsDerived
Fonts already created |
|
$_formats
Format font table |
|
$_profiles
Profile table |
boolean |
addFont (Sgss_Font_Interface $font)
Adds the specified font to this manager |
string|null |
getCacheDirectory ()
Returns the default font cache directory of this manager |
Zend_Db_Adapter_Abstract|null |
getConnection ()
Returns the database handle used by this manager |
Sgss_Font_Interface|null |
getFont (string $family, [string|null $subfamily = null], [int|string|null $style = null], [int|string|null $weight = null], [int|string|null $stretch = null])
Returns the font that matches the specified parameters |
string|null |
getFontDirectory ()
Returns the default font file directory of this manager |
boolean |
hasFont (Sgss_Font_Interface|string $family, [string|null $subfamily = null], [int|string|null $style = null], [int|string|null $weight = null], [int|string|null $stretch = null])
Determines this manager contains the font that matches the specified parameters |
array |
listFont ([string|null $locale = null])
Returns the list of all fonts in this manager |
boolean |
removeFont (Sgss_Font_Interface|string $family, [string|null $subfamily = null], [int|string|null $style = null], [int|string|null $weight = null], [int|string|null $stretch = null])
Removes the font that matches the specified parameters |
void |
setCacheDirectory (Sgss_File|string $directory)
Sets the default font cache directory to the specified value |
void |
setFontDirectory (Sgss_File|string $directory)
Sets the default font file directory to the specified value |
|
_addFormat (Sgss_Font_Format_Interface $font)
Inserts the specified format font to this manager |
|
_ensureStretch (int|string $stretch)
Converts the specified stretch expressions the corresponding stretch value |
|
_ensureStyle (int|string $style)
Converts the specified style expression to the corresponding style identifier |
|
_ensureWeight (int|string $weight)
Converts the specified weight expressions the corresponding weight value |
|
_findFont (string $family, string $subfamily, int|string $style, int|string $weight, int|string $stretch)
Returns an array containing the font identifier and type that matches the specified parameters |
|
_getFormat (int $fontId)
Returns the format font corresponding to the specified identifier |
|
_init ()
Initializes this manager |
|
_removeFormat (Sgss_Font_Format_Interface $font)
Removes the specified format font from this manager |
|
_resolvePath (string $file, string|null $defaultDirectory)
Converts the specified file path to a relative one based on the default directory |
|
_searchFile (string $file, string|null $defaultDirectory)
Searches file with the specified path and default directory |
TYPE_FORMAT = 'format' |
Font type identifier |
Default font cache directory
protected string $_cacheDirectory = null
Coverage table
protected Sgss_Font_Manager_Table_Coverage $_coverages
Database handle
protected Zend_Db_Adapter_Abstract $_db
Database adapter name
Database adapter name
protected string $_dbAdapter = null
Database configurations
Database configurations
protected array|Zend_Config $_dbConfig = null
Default font file directory
protected string $_fontDirectory = null
Font table
protected Sgss_Font_Manager_Table_Font $_fonts
Fonts already created
protected array $_fontsDerived = array()
Format font table
protected Sgss_Font_Manager_Table_Format $_formats
Profile table
protected Sgss_Font_Manager_Table_Profile $_profiles
Adds the specified font to this manager
Sgss_Font_Interface $font
Font to be added to this manager
Adds a font to this manager
public boolean addFont (Sgss_Font_Interface $font)
Returns the default font cache directory of this manager
public string|null getCacheDirectory ()
Returns the database handle used by this manager
public Zend_Db_Adapter_Abstract|null getConnection ()
Returns the font that matches the specified parameters
string $family
Family name
string|null $subfamily
Subfamily name
int|string|null $style
Style identifier or name
int|string|null $weight
Weight value or name
int|string|null $stretch
Stretch value or name
When unexpected error occurred
Returns the font that matches the specified parameters
public Sgss_Font_Interface|null getFont (string $family, [string|null $subfamily = null], [int|string|null $style = null], [int|string|null $weight = null], [int|string|null $stretch = null])
Returns the default font file directory of this manager
public string|null getFontDirectory ()
Determines this manager contains the font that matches the specified parameters
Sgss_Font_Interface|string $family
Font instance or family name
string|null $subfamily
Subfamily name
int|string|null $style
Style identifier or name
int|string|null $weight
Weight value or name
int|string|null $stretch
Stretch value or name
Determines this manager has the font that matches the specified parameters
public boolean hasFont (Sgss_Font_Interface|string $family, [string|null $subfamily = null], [int|string|null $style = null], [int|string|null $weight = null], [int|string|null $stretch = null])
Returns the list of all fonts in this manager
string|null $locale
Locale of profile to be listed
Returns the list of all fonts in this manager
public array listFont ([string|null $locale = null])
Removes the font that matches the specified parameters
Sgss_Font_Interface|string $family
Font instance or family name
string|null $subfamily
Subfamily name
int|string|null $style
Style identifier or name
int|string|null $weight
Weight value or name
int|string|null $stretch
Stretch value or name
Removes the font that matches the specified parameters
public boolean removeFont (Sgss_Font_Interface|string $family, [string|null $subfamily = null], [int|string|null $style = null], [int|string|null $weight = null], [int|string|null $stretch = null])
Sets the default font cache directory to the specified value
Sgss_File|string $directory
Path to the cache directory
public void setCacheDirectory (Sgss_File|string $directory)
Sets the default font file directory to the specified value
Sgss_File|string $directory
Path to the font directory
public void setFontDirectory (Sgss_File|string $directory)
Inserts the specified format font to this manager
Sgss_Font_Format_Interface $font
Format font to be added
When unexpected error occurred
protected boolean _addFormat (Sgss_Font_Format_Interface $font)
Converts the specified stretch expressions the corresponding stretch value
int|string $stretch
Stretch expression or value
protected mixed _ensureStretch (int|string $stretch)
Converts the specified style expression to the corresponding style identifier
int|string $style
Style expression or identifier
protected mixed _ensureStyle (int|string $style)
Converts the specified weight expressions the corresponding weight value
int|string $weight
Weight expression or value
protected mixed _ensureWeight (int|string $weight)
Returns an array containing the font identifier and type that matches the specified parameters
string $family
Family name
string $subfamily
Subfamily name
int|string $style
Style identifier or name
int|string $weight
Weight value or name
int|string $stretch
Stretch value or name
protected array|null _findFont (string $family, string $subfamily, int|string $style, int|string $weight, int|string $stretch)
Returns the format font corresponding to the specified identifier
int $fontId
Font identifier of the font
When unexpected error occurred
protected Sgss_Font_Format_Interface _getFormat (int $fontId)
Initializes this manager
When unable to create database handle or connect to the database
protected void _init ()
Removes the specified format font from this manager
Sgss_Font_Format_Interface $font
Format font to be removed
When unexpected error occurred
protected boolean _removeFormat (Sgss_Font_Format_Interface $font)
Converts the specified file path to a relative one based on the default directory
string $file
File path to be converted
string|null $defaultDirectory
Default directory
protected string|boolean _resolvePath (string $file, string|null $defaultDirectory)
Searches file with the specified path and default directory
string $file
Path of the file to search
string|null $defaultDirectory
Default directory
protected string|boolean|null _searchFile (string $file, string|null $defaultDirectory)
Font type identifier
const TYPE_FORMAT = 'format'