dompdf / php-font-lib

A library to read, parse, export and make subsets of different types of font files.
GNU Lesser General Public License v2.1
1.73k stars 256 forks source link

'Undefined offset:' notices in loca and htmx classes #57

Closed mondrake closed 6 years ago

mondrake commented 7 years ago

In the test suite of a Drupal module that uses this library (https://www.drupal.org/pift-ci-job/610235), I am getting a lot of PHP notices for undefined offset like

exception: [Notice] Line 46 of vendor/phenx/php-font-lib/src/FontLib/Table/Type/loca.php:
Undefined offset: 2144
....
exception: [Notice] Line 30 of vendor/phenx/php-font-lib/src/FontLib/Table/Type/hmtx.php:
Undefined offset: 5332

exception: [Notice] Line 31 of vendor/phenx/php-font-lib/src/FontLib/Table/Type/hmtx.php:
Undefined offset: 5333

I am not sure how to fix this, but checking the existence of the array element seems to me a right thing to do anyway