Class: I2CE FontMetricAFM: Difference between revisions

From IHRIS Wiki
(Created page with 'This article desrcibes the class '''I2CE_FontMetricAFM'''which extends the class I2CE_FontMetricMultiDirection It is contained in the m…')
 
No edit summary
Line 78: Line 78:
* [http://www.php.net/manual/en/language.types.string.php string] $afmfile
* [http://www.php.net/manual/en/language.types.string.php string] $afmfile
==Inherited Variables==
==Inherited Variables==
===$$font_metrics===
===$font_metrics===
Theis protected variable is inherited from [[Class: I2CE_FontMetricMultiDirection#$$font_metrics | I2CE_FontMetricMultiDirection->$$font_metrics]]
Theis protected variable is inherited from [[Class: I2CE_FontMetricMultiDirection#$font_metrics | I2CE_FontMetricMultiDirection->$font_metrics]]
===$$direction===
===$direction===
Theis protected variable is inherited from [[Class: I2CE_FontMetricMultiDirection#$$direction | I2CE_FontMetricMultiDirection->$$direction]]
Theis protected variable is inherited from [[Class: I2CE_FontMetricMultiDirection#$direction | I2CE_FontMetricMultiDirection->$direction]]
===$$directions===
===$directions===
Theis protected variable is inherited from [[Class: I2CE_FontMetricMultiDirection#$$directions | I2CE_FontMetricMultiDirection->$$directions]]
Theis protected variable is inherited from [[Class: I2CE_FontMetricMultiDirection#$directions | I2CE_FontMetricMultiDirection->$directions]]
===$$character_widths===
===$character_widths===
Theis public variable is inherited from [[Class: I2CE_FontMetric#$$character_widths | I2CE_FontMetric->$$character_widths]]
Theis public variable is inherited from [[Class: I2CE_FontMetric#$character_widths | I2CE_FontMetric->$character_widths]]
===$$character_heights===
===$character_heights===
Theis public variable is inherited from [[Class: I2CE_FontMetric#$$character_heights | I2CE_FontMetric->$$character_heights]]
Theis public variable is inherited from [[Class: I2CE_FontMetric#$character_heights | I2CE_FontMetric->$character_heights]]
===$$character_info===
===$character_info===
Theis public variable is inherited from [[Class: I2CE_FontMetric#$$character_info | I2CE_FontMetric->$$character_info]]
Theis public variable is inherited from [[Class: I2CE_FontMetric#$character_info | I2CE_FontMetric->$character_info]]
===$$bbox===
===$bbox===
Theis protected variable is inherited from [[Class: I2CE_FontMetric#$$bbox | I2CE_FontMetric->$$bbox]]
Theis protected variable is inherited from [[Class: I2CE_FontMetric#$bbox | I2CE_FontMetric->$bbox]]
===$$ascender===
===$ascender===
Theis protected variable is inherited from [[Class: I2CE_FontMetric#$$ascender | I2CE_FontMetric->$$ascender]]
Theis protected variable is inherited from [[Class: I2CE_FontMetric#$ascender | I2CE_FontMetric->$ascender]]
===$$descender===
===$descender===
Theis protected variable is inherited from [[Class: I2CE_FontMetric#$$descender | I2CE_FontMetric->$$descender]]
Theis protected variable is inherited from [[Class: I2CE_FontMetric#$descender | I2CE_FontMetric->$descender]]
===$$linegap===
===$linegap===
Theis protected variable is inherited from [[Class: I2CE_FontMetric#$$linegap | I2CE_FontMetric->$$linegap]]
Theis protected variable is inherited from [[Class: I2CE_FontMetric#$linegap | I2CE_FontMetric->$linegap]]
===$$is_fixed_width===
===$is_fixed_width===
Theis protected variable is inherited from [[Class: I2CE_FontMetric#$$is_fixed_width | I2CE_FontMetric->$$is_fixed_width]]
Theis protected variable is inherited from [[Class: I2CE_FontMetric#$is_fixed_width | I2CE_FontMetric->$is_fixed_width]]
===$$fixed_character_width===
===$fixed_character_width===
Theis protected variable is inherited from [[Class: I2CE_FontMetric#$$fixed_character_width | I2CE_FontMetric->$$fixed_character_width]]
Theis protected variable is inherited from [[Class: I2CE_FontMetric#$fixed_character_width | I2CE_FontMetric->$fixed_character_width]]
===$$fixed_character_height===
===$fixed_character_height===
Theis protected variable is inherited from [[Class: I2CE_FontMetric#$$fixed_character_height | I2CE_FontMetric->$$fixed_character_height]]
Theis protected variable is inherited from [[Class: I2CE_FontMetric#$fixed_character_height | I2CE_FontMetric->$fixed_character_height]]
===$$size===
===$size===
Theis protected variable is inherited from [[Class: I2CE_FontMetric#$$size | I2CE_FontMetric->$$size]]
Theis protected variable is inherited from [[Class: I2CE_FontMetric#$size | I2CE_FontMetric->$size]]
===$$encoding===
===$encoding===
Theis protected variable is inherited from [[Class: I2CE_FontMetric#$$encoding | I2CE_FontMetric->$$encoding]]
Theis protected variable is inherited from [[Class: I2CE_FontMetric#$encoding | I2CE_FontMetric->$encoding]]
===$$kerning_table_pairs===
===$kerning_table_pairs===
Theis protected variable is inherited from [[Class: I2CE_FontMetric#$$kerning_table_pairs | I2CE_FontMetric->$$kerning_table_pairs]]
Theis protected variable is inherited from [[Class: I2CE_FontMetric#$kerning_table_pairs | I2CE_FontMetric->$kerning_table_pairs]]
===$$kerning_table_groups===
===$kerning_table_groups===
Theis protected variable is inherited from [[Class: I2CE_FontMetric#$$kerning_table_groups | I2CE_FontMetric->$$kerning_table_groups]]
Theis protected variable is inherited from [[Class: I2CE_FontMetric#$kerning_table_groups | I2CE_FontMetric->$kerning_table_groups]]
===$$kerning_groups===
===$kerning_groups===
Theis protected variable is inherited from [[Class: I2CE_FontMetric#$$kerning_groups | I2CE_FontMetric->$$kerning_groups]]
Theis protected variable is inherited from [[Class: I2CE_FontMetric#$kerning_groups | I2CE_FontMetric->$kerning_groups]]
===$$font_info===
===$font_info===
Theis protected variable is inherited from [[Class: I2CE_FontMetric#$$font_info | I2CE_FontMetric->$$font_info]]
Theis protected variable is inherited from [[Class: I2CE_FontMetric#$font_info | I2CE_FontMetric->$font_info]]




[[Category:Class Documentation]]
[[Category:Class Documentation]]

Revision as of 15:18, 16 October 2009

This article desrcibes the class I2CE_FontMetricAFMwhich extends the class I2CE_FontMetricMultiDirection It is contained in the module textlayout in the package TextLayout Tools The class is defined in the file: lib/I2CE_FontMetricAFM.php Class to contain information about font metrics. Modeled after the data contained in the Adobe Font Metrics File Format Specification http://www.adobe.com/devnet/font/pdfs/5004.AFM_Spec.pdf

@package I2CE @subpackage TextLayout @author Carl Leitner <litlfred@ibiblio.org>

@version 0.1 @access public



Note 1 the function getCharacterInfo @returns mixed @param key are the character information (besides the width) in section 8 of Adobe Font Metrics File Format Specification


Note 2 the function getFontCharacteristic @returns mixed @param string $key are the keys in section 4.2 of Adobe Font Metrics File Format Specification values and keys are FontName string FullName string FamilyName string Weight string FontBBox number number number number Version string Notice string EncodingScheme string MappingScheme integer EscChar integer CharacterSet string Characters integer IsBaseFont boolean VVector number number IsFixedV boolean CapHeight number XHeight number Ascender number Descender number

We also include section 4,3 of Adobe Font Metrics File Format Specification for the following possible keys which are direction dependent StartDirection integer EndDirection UnderlinePosition number UnderlineThickness number ItalicAngle number CharWidth number number IsFixedPitch boolean

Variables

$gn2cc

. Array are glpyh names values are character codes.

  • Type: protected y $gn2cc

Methods

__construct()

@param I2CE_Encoding $encoding -- the encoding used for the internal storage of strings/characters needs to be one that is a valid encoding for PHP multibyte strings.

  • Signature: public function __construct($internal_encoding,$file_encoding,$afmfile)

Parameters:

  • &$internal_encoding
  • I2CE_Encoding $file_encoding
    the character encoding used in the file afm file
  • string $afmfile
    the afm file to load.

loadFontMetricFromAFM()

Load the font metrics from an afm file (Some of this code was stolen from makefont.php) Caution: Units for these files are 1/1000 of a point where a point is 1/72 of an inch

  • Signature: protected function loadFontMetricFromAFM($encoding,$afmfile)

Parameters:

Inherited Variables

$font_metrics

Theis protected variable is inherited from I2CE_FontMetricMultiDirection->$font_metrics

$direction

Theis protected variable is inherited from I2CE_FontMetricMultiDirection->$direction

$directions

Theis protected variable is inherited from I2CE_FontMetricMultiDirection->$directions

$character_widths

Theis public variable is inherited from I2CE_FontMetric->$character_widths

$character_heights

Theis public variable is inherited from I2CE_FontMetric->$character_heights

$character_info

Theis public variable is inherited from I2CE_FontMetric->$character_info

$bbox

Theis protected variable is inherited from I2CE_FontMetric->$bbox

$ascender

Theis protected variable is inherited from I2CE_FontMetric->$ascender

$descender

Theis protected variable is inherited from I2CE_FontMetric->$descender

$linegap

Theis protected variable is inherited from I2CE_FontMetric->$linegap

$is_fixed_width

Theis protected variable is inherited from I2CE_FontMetric->$is_fixed_width

$fixed_character_width

Theis protected variable is inherited from I2CE_FontMetric->$fixed_character_width

$fixed_character_height

Theis protected variable is inherited from I2CE_FontMetric->$fixed_character_height

$size

Theis protected variable is inherited from I2CE_FontMetric->$size

$encoding

Theis protected variable is inherited from I2CE_FontMetric->$encoding

$kerning_table_pairs

Theis protected variable is inherited from I2CE_FontMetric->$kerning_table_pairs

$kerning_table_groups

Theis protected variable is inherited from I2CE_FontMetric->$kerning_table_groups

$kerning_groups

Theis protected variable is inherited from I2CE_FontMetric->$kerning_groups

$font_info

Theis protected variable is inherited from I2CE_FontMetric->$font_info