Sgss_Font_Abstract 
Abstract class representing a font

Description

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

Direct descendants

Sgss_Font_Composite Represents a composite font
Sgss_Font_Format_Abstract Abstract class representing a format font

Class overview

Variables

protected Sgss_Font_Coverage_Interface $_coverage

Unicode coverage of this font

protected Sgss_Font_Mapper_Interface $_mapper

Character code to glyph code map of this font

protected Sgss_Font_Metrics_Interface $_metrics

Font and glyph metrics aggregate of this font

protected Sgss_Font_Profiler_Interface $_profiler

Font profile of this font

Methods

Sgss_Font_Coverage_Interface getCoverage ()

Returns the unicode coverage of this font

string getFamily ()

Returns the family name of this font in default locale

Sgss_Font_Metrics_Glyph getGlyph (int|string|Sgss_String $char)

Returns the glyph metrics corresponding to the specified character

int getGlyphCode (int|string|Sgss_String $char)

Converts the specified character to the corresponding glyph code

array getGlyphCodes (array|string|Sgss_String $chars)

Converts the specified characters to the corresponding glyph codes array

array getGlyphs (array|string|Sgss_String $chars)

Returns the glyph metrices array corresponding to the specified characters

Sgss_Font_Mapper_Interface getMapper ()

Returns the character code to glyph code map of this font

Sgss_Font_Metrics_Interface getMetrics ()

Returns the font and glyph metrics aggregate of this font

string getName ()

Returns the name of this font in default locale

Sgss_Font_Profiler_Interface getProfiler ()

Returns the font profile of this font

int getStretch ()

Returns the stretch value of this font

string getStretchName ()

Returns the stretch name of this font in default locale

int getStyle ()

Returns the style identifier of this font

string getStyleName ()

Returns the style name of this font in default locale

string getSubfamily ()

Returns the subfamily name of this font in default locale

int getWeight ()

Returns the weight value of this font

string getWeightName ()

Returns the weight name of this font in default locale

boolean hasGlyph (int|string|Sgss_String $char)

Determines whether this font has the glyph corresponding to the specified character

boolean hasGlyphs (array|string|Sgss_String $chars)

Determines whether this font has all the glyphs corresponding to the specified characters

string __toString ()

Variable detail

$_coverage 

Unicode coverage of this font

Signature:
protected Sgss_Font_Coverage_Interface $_coverage


$_mapper 

Character code to glyph code map of this font

Signature:
protected Sgss_Font_Mapper_Interface $_mapper


$_metrics 

Font and glyph metrics aggregate of this font

Signature:
protected Sgss_Font_Metrics_Interface $_metrics


$_profiler 

Font profile of this font

Signature:
protected Sgss_Font_Profiler_Interface $_profiler


Method detail

getCoverage

Returns the unicode coverage of this font

Returns:
Sgss_Font_Coverage_Interface -- Unicode coverage
Specified by:
Related subject:
Sgss_Font_Interface::getCoverage()
Signature:
public Sgss_Font_Coverage_Interface getCoverage ()


getFamily

Returns the family name of this font in default locale

Returns:
string -- Family name of this font in default locale
Specified by:
Uses:
Sgss_Font_Profiler_Interface::getName()
Related subject:
Sgss_Font_Interface::getFamily()
Signature:
public string getFamily ()


getGlyph

Returns the glyph metrics corresponding to the specified character

The $char parameter can be either an unicode codepoint or character. This determines the first character if string supplied.

Parameters:
  • int|string|Sgss_String $char

    Unicode codepoint or character

Returns:
Sgss_Font_Metrics_Glyph -- Glyph metrics corresponding to the character, or an empty glyph metrics when this font does not have the glyph
Specified by:
Uses:
Sgss_Font_Metrics_Interface::getGlyph(), Sgss_Font_Mapper_Interface::charToGlyph()
Related subject:
Sgss_Font_Interface::getGlyph()
Signature:
public Sgss_Font_Metrics_Glyph getGlyph (int|string|Sgss_String $char)


getGlyphCode

Converts the specified character to the corresponding glyph code

The $char parameter can be either an unicode codepoint or character. This converts the first character if string specified.

Parameters:
  • int|string|Sgss_String $char

    Unicode codepoint or character

Returns:
int -- Glyph code corresponding to the character, or the mising glyph code when this font does not have the glyph
Specified by:
Uses:
Sgss_Font_Mapper_Interface::charToGlyph()
Related subjects:
Sgss_Font_Interface::getGlyphCode(), Sgss_Font_Mapper_Interface::GLYPH_MISSING
Signature:
public int getGlyphCode (int|string|Sgss_String $char)


getGlyphCodes

Converts the specified characters to the corresponding glyph codes array

The $chars parameter can be either an array of unicode codepoints or a string.

Parameters:
  • array|string|Sgss_String $chars

    Unicode codepoints or string

Returns:
array -- Array of glyph codes corresponding to the characters, or the mising glyph codes when this font does not have the glyphs
Specified by:
Uses:
Sgss_Font_Mapper_Interface::charsToGlyphs()
Related subjects:
Sgss_Font_Interface::getGlyphCodes(), Sgss_Font_Mapper_Interface::GLYPH_MISSING
Signature:
public array getGlyphCodes (array|string|Sgss_String $chars)


getGlyphs

Returns the glyph metrices array corresponding to the specified characters

The $chars parameter is expected to be either an array of unicode codepoints or a string.

Parameters:
  • array|string|Sgss_String $chars

    Unicode codepoints or string

Returns:
array -- Glyph metrices array corresponding to the characters, or empty glyph metrices when this font does not have the glyphs
Specified by:
Uses:
Sgss_Font_Metrics_Interface::getGlyphs(), Sgss_Font_Mapper_Interface::charsToGlyphs()
Related subject:
Sgss_Font_Interface::getGlyphs()
Signature:
public array getGlyphs (array|string|Sgss_String $chars)


getMapper

Returns the character code to glyph code map of this font

Returns:
Sgss_Font_Mapper_Interface -- Character code to glyph code map
Specified by:
Related subject:
Sgss_Font_Interface::getMapper()
Signature:
public Sgss_Font_Mapper_Interface getMapper ()


getMetrics

Returns the font and glyph metrics aggregate of this font

Returns:
Sgss_Font_Metrics_Interface -- Font and glyph metrics aggregate
Specified by:
Related subject:
Sgss_Font_Interface::getMetrics()
Signature:
public Sgss_Font_Metrics_Interface getMetrics ()


getName

Returns the name of this font in default locale

Returns:
string -- Name of this font in default locale
Specified by:
Uses:
Sgss_Font_Profiler_Interface::getName()
Related subject:
Sgss_Font_Interface::getName()
Signature:
public string getName ()


getProfiler

Returns the font profile of this font

Returns:
Sgss_Font_Profiler_Interface -- Font profile
Specified by:
Related subject:
Sgss_Font_Interface::getProfiler()
Signature:
public Sgss_Font_Profiler_Interface getProfiler ()


getStretch

Returns the stretch value of this font

Returns:
int -- Stretch value of this font
Specified by:
Uses:
Sgss_Font_Profiler_Interface::getStretch()
Related subject:
Sgss_Font_Interface::getStretch()
Signature:
public int getStretch ()


getStretchName

Returns the stretch name of this font in default locale

Returns:
string -- Stretch name of this font in default locale
Specified by:
Uses:
Sgss_Font_Profiler_Interface::getName()
Related subject:
Sgss_Font_Interface::getStretchName()
Signature:
public string getStretchName ()


getStyle

Returns the style identifier of this font

Returns:
int -- Style identifier of this font
Specified by:
Uses:
Sgss_Font_Profiler_Interface::getStyle()
Related subject:
Sgss_Font_Interface::getStyle()
Signature:
public int getStyle ()


getStyleName

Returns the style name of this font in default locale

Returns:
string -- Style name of this font in default locale
Specified by:
Uses:
Sgss_Font_Profiler_Interface::getName()
Related subject:
Sgss_Font_Interface::getStyleName()
Signature:
public string getStyleName ()


getSubfamily

Returns the subfamily name of this font in default locale

Returns:
string -- Subfamily name of this font in default locale
Specified by:
Uses:
Sgss_Font_Profiler_Interface::getName()
Related subject:
Sgss_Font_Interface::getSubfamily()
Signature:
public string getSubfamily ()


getWeight

Returns the weight value of this font

Returns:
int -- Weight value of this font
Specified by:
Uses:
Sgss_Font_Profiler_Interface::getWeight()
Related subject:
Sgss_Font_Interface::getWeight()
Signature:
public int getWeight ()


getWeightName

Returns the weight name of this font in default locale

Returns:
string -- Weight name of this font in default locale
Specified by:
Uses:
Sgss_Font_Profiler_Interface::getName()
Related subject:
Sgss_Font_Interface::getWeightName()
Signature:
public string getWeightName ()


hasGlyph

Determines whether this font has the glyph corresponding to the specified character

The $char parameter can be either an unicode codepoint or character. This determines the first character if string specified.

Parameters:
  • int|string|Sgss_String $char

    Unicode codepoint or character to determine

Returns:
boolean -- True when this font has the corresponding glyph
Specified by:
Uses:
Sgss_Font_Mapper_Interface::hasGlyph()
Related subject:
Sgss_Font_Interface::hasGlyph()
Signature:
public boolean hasGlyph (int|string|Sgss_String $char)


hasGlyphs

Determines whether this font has all the glyphs corresponding to the specified characters

The $chars parameter can to be either an array of unicode codepoints or a string.

Parameters:
  • array|string|Sgss_String $chars

    Unicode codepoints or string to determine

Returns:
boolean -- True when this font has all the corresponding glyphs
Specified by:
Uses:
Sgss_Font_Mapper_Interface::hasGlyphs()
Related subject:
Sgss_Font_Interface::hasGlyphs()
Signature:
public boolean hasGlyphs (array|string|Sgss_String $chars)


__toString

Signature:
public string __toString ()