Sgss_Font_Interface 
Provides for handling font

Description

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

Direct descendants

Sgss_Font_Composite_Interface Provides for handling composite font
Sgss_Font_Format_Interface Provides for handling format font

Class overview

Methods

Sgss_Font_Composite_Interface composite (Sgss_Font_Format_Interface $font, [array|Sgss_Graphics_Transform|null $trans = null], [string|array|null $range = null])

Creates a composite font with another

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

Method detail

composite

Creates a composite font with another

Parameters:
Returns:
Sgss_Font_Composite_Interface -- Composited font
Used by:
Sgss_Graphics_Font::composite()
Signature:
public Sgss_Font_Composite_Interface composite (Sgss_Font_Format_Interface $font, [array|Sgss_Graphics_Transform|null $trans = null], [string|array|null $range = null])


getCoverage

Returns the unicode coverage of this font

Returns:
Sgss_Font_Coverage_Interface -- Unicode coverage
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
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
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
Related subject:
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
Related subject:
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
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
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
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
Signature:
public string getName ()


getProfiler

Returns the font profile of this font

Returns:
Sgss_Font_Profiler_Interface -- Font profile
Signature:
public Sgss_Font_Profiler_Interface getProfiler ()


getStretch

Returns the stretch value of this font

Returns:
int -- Stretch value of this font
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
Signature:
public string getStretchName ()


getStyle

Returns the style identifier of this font

Returns:
int -- Style identifier of this font
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
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
Signature:
public string getSubfamily ()


getWeight

Returns the weight value of this font

Returns:
int -- Weight value of this font
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
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
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
Signature:
public boolean hasGlyphs (array|string|Sgss_String $chars)