Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined index: glyf - phenx/php-font-lib/src/FontLib/TrueType/File.php, line 329 #65

Closed
consolibyte opened this issue Oct 31, 2017 · 6 comments

Comments

@consolibyte
Copy link

PHP 7.0.6

The line in question is this:

  /**
   * @param $name
   *
   * @return Table
   */
  public function getTableObject($name) {
    return $this->data[$name];
  }
@consolibyte
Copy link
Author

consolibyte commented Oct 31, 2017

This seems to be somehow related to these styles -- if I remove these styles from my DomPDF document, the error goes away:

@font-face {
				font-family: 'Basis Grotesque';
				font-style: normal;
				font-weight: 400;
				src: url('/chargeover/fonts/basis-grotesque-regular-pro.otf');
			}

			@font-face {
				font-family: 'Basis Grotesque';
				font-style: bold;
				font-weight: 700;
				src: url('/chargeover/fonts/basis_grotesque_bold.otf');
			}

			* {
				font-family: "Basis Grotesque", sans-serif;
			}

			div, td {
				font-family: "Basis Grotesque", sans-serif;
				color: black;
				vertical-align: top;
			}

@bsweeney
Copy link
Member

Dompdf doesn't support OTF fonts at present. Do you have TTF versions?

@keith-chargeover
Copy link

keith-chargeover commented Nov 19, 2017

That's interesting... since the OTF versions were working fine up until I upgraded to DomPDF 8.0.1.

I do have the TTF versions, but they result in the same error message. However, the TTF versions I have were converted from the OTF versions. I have attached both versions.

Archive.zip

@bsweeney
Copy link
Member

I'd be curious to see a sample HTML document and the resulting render from before. But you might open an issue in the Dompdf project since that's a concern not directly related to this error. With Dompdf 0.8.0 we added more checks in the font management portion of Dompdf to prevent processing of non-TTF files. Still, in earlier version I wouldn't expect Dompdf to process the font correctly.

@onassar
Copy link

onassar commented Jun 5, 2018

I'm also getting this with specific fonts.

@bsweeney
Copy link
Member

Not that this error occurs when attempting to subset a font that does not include a glyf table. A number of OpenType fonts use the CFF table instead. For full support ensure any font you're attempting to parse includes a glyf table.

Watch #10 for updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants