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 post classes #89

Closed d8y closed 3 years ago

d8y commented 3 years ago

Error depending on font used when using Laravel dom pdf The issue that has been raised is #63

57 is up as a solution to a similar problem.

I want to avoid the error by checking the existence of the same.

bsweeney commented 3 years ago

The referenced PR may have resolved a similar PHP error, but the solution implemented there is not appropriate here. You're falling back to "0" in the case where the index doesn't exist, but the value being determined is not numeric. The value should be the name of the related glyph.

Based on how this value is used I believe it would be more appropriate to only set a value in the $names array if a glyph name is present (ref1) (ref2).

I went ahead and implemented this change in #90. Please review and comment there.