ZF-11943: Zend_Pdf_Resource_Font_CidFont emits warning when attempting to count width of nonexistent glyph

Issue Type: Patch Created: 2011-12-16T11:21:05.000+0000 Last Updated: 2012-02-26T18:46:53.000+0000 Status: Resolved Fix version(s): - 1.11.12 (22/Jun/12)

Reporter: David (general03) Assignee: Adam Lundrigan (adamlundrigan) Tags: - Zend_Pdf

Related issues: Attachments:


When I set font with path, there are an issue on line 131 of CidFont.php because the array contain a null variable. The error display is "Warning: array_count_values() [function.array-count-values]: Can only count STRING and INTEGER values!" I resolved the problem with this code :

<pre class="highlight">
foreach ($charGlyphs as $charCode => $glyph) { 
    // Begin Addition
    if( null == $glyphWidths[$glyph] ) continue;
    // End Addition
    $charWidths[$charCode] = $glyphWidths[$glyph];

This call is $page->setFont(Zend_Pdf_Font::fontWithPath('../BOBTAG.TTF', Zend_Pdf_Font::EMBED_SUPPRESS_EMBED_EXCEPTION), 36);


Posted by Adam Lundrigan (adamlundrigan) on 2012-02-26T18:46:53.000+0000

Fixed in trunk r24664 Merged to release-1.11 in r24665

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.