equal
deleted
inserted
replaced
13 * to license@zend.com so we can send you a copy immediately. |
13 * to license@zend.com so we can send you a copy immediately. |
14 * |
14 * |
15 * @category Zend |
15 * @category Zend |
16 * @package Zend_Pdf |
16 * @package Zend_Pdf |
17 * @subpackage Fonts |
17 * @subpackage Fonts |
18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
18 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
20 * @version $Id: CidFont.php 20096 2010-01-06 02:05:09Z bkarwin $ |
20 * @version $Id: CidFont.php 24664 2012-02-26 16:36:51Z adamlundrigan $ |
21 */ |
21 */ |
22 |
22 |
23 /** Internally used classes */ |
23 /** Internally used classes */ |
24 require_once 'Zend/Pdf/Element/Array.php'; |
24 require_once 'Zend/Pdf/Element/Array.php'; |
25 require_once 'Zend/Pdf/Element/Dictionary.php'; |
25 require_once 'Zend/Pdf/Element/Dictionary.php'; |
49 * Font objects should be normally be obtained from the factory methods |
49 * Font objects should be normally be obtained from the factory methods |
50 * {@link Zend_Pdf_Font::fontWithName} and {@link Zend_Pdf_Font::fontWithPath}. |
50 * {@link Zend_Pdf_Font::fontWithName} and {@link Zend_Pdf_Font::fontWithPath}. |
51 * |
51 * |
52 * @package Zend_Pdf |
52 * @package Zend_Pdf |
53 * @subpackage Fonts |
53 * @subpackage Fonts |
54 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
54 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
55 * @license http://framework.zend.com/license/new-bsd New BSD License |
55 * @license http://framework.zend.com/license/new-bsd New BSD License |
56 */ |
56 */ |
57 abstract class Zend_Pdf_Resource_Font_CidFont extends Zend_Pdf_Resource_Font |
57 abstract class Zend_Pdf_Resource_Font_CidFont extends Zend_Pdf_Resource_Font |
58 { |
58 { |
59 /** |
59 /** |
127 /* Constract characters widths array using font CMap and glyphs widths array */ |
127 /* Constract characters widths array using font CMap and glyphs widths array */ |
128 $glyphWidths = $fontParser->glyphWidths; |
128 $glyphWidths = $fontParser->glyphWidths; |
129 $charGlyphs = $this->_cmap->getCoveredCharactersGlyphs(); |
129 $charGlyphs = $this->_cmap->getCoveredCharactersGlyphs(); |
130 $charWidths = array(); |
130 $charWidths = array(); |
131 foreach ($charGlyphs as $charCode => $glyph) { |
131 foreach ($charGlyphs as $charCode => $glyph) { |
132 $charWidths[$charCode] = $glyphWidths[$glyph]; |
132 if(isset($glyphWidths[$glyph]) && !is_null($glyphWidths[$glyph])) { |
|
133 $charWidths[$charCode] = $glyphWidths[$glyph]; |
|
134 } |
133 } |
135 } |
134 $this->_charWidths = $charWidths; |
136 $this->_charWidths = $charWidths; |
135 $this->_missingCharWidth = $glyphWidths[0]; |
137 $this->_missingCharWidth = $glyphWidths[0]; |
136 |
138 |
137 /* Width array optimization. Step1: extract default value */ |
139 /* Width array optimization. Step1: extract default value */ |