Pomax / PHP-Font-Parser

This is a PHP code library for parsing TTF/OTF fonts from file.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fatal error in glyph.php

carlmcdade opened this issue · comments

I downloaded and tried to test a font but encountered errors in the font test. The first was an easy fix. There is a missing parenthesis on line 34. But it was followed up by this:
font header data:
header:
{version: OTTO, number of tables: 14, search range: 128, entry selector: 3, range shift: 96}
tables:
{tag: BASE, checkSum: 1063407546, offset: 4284, length: 52}
{tag: CFF , checkSum: 838456334, offset: 4336, length: 15280}
{tag: DSIG, checkSum: 2007147259, offset: 22056, length: 5744}
{tag: GPOS, checkSum: 28576472, offset: 19616, length: 1554}
{tag: GSUB, checkSum: 1843949587, offset: 21172, length: 812}
{tag: LINO, checkSum: -253362844, offset: 21984, length: 72}
{tag: OS/2, checkSum: 2041581385, offset: 336, length: 96}
{tag: cmap, checkSum: 2129153568, offset: 2308, length: 932}
{tag: head, checkSum: -603480306, offset: 236, length: 54}
{tag: hhea, checkSum: 117441355, offset: 292, length: 36}
{tag: hmtx, checkSum: 105393449, offset: 3240, length: 1012}
{tag: maxp, checkSum: 16601088, offset: 328, length: 6}
{tag: name, checkSum: 1654205279, offset: 432, length: 1874}
{tag: post, checkSum: -4718542, offset: 4252, length: 32}


Fatal error: Call to a member function computeBounds() on a non-object in D:\websites\vitt.easypic.se\fonttest\Font parser\OTF data\Glyph classes\glyph.php on line 31

This is on Windows IIS 7.5 using PHP 5.3+

I don't know which font you used, so I can't 100% tell whether I fixed what was wrong, but I did fix a number of issues related to your report, and do not see any errors for TrueType OpenType fonts (.ttf) or CFF OpenType fonts that use CID character lookups (.otf) when pointing to them in the fonttest.php file.

CFF OpenType fonts that use SID character lookup are not (yet) supported, but there was no error for this. Now there is. I'll try to add SID parsing in over the next few days if I have time.

a6c54da adds support for non-CID CFF OpenType fonts, so all errors should be gone now.

Tested and working now.