Closed oxygen closed 8 years ago
I have generated a subset font for each font with only the letters from the font's file name. I was going to use these subset TTF files for a preview of the font.
Using these fonts: https://github.com/google/fonts All 1736 fonts fails with one of these errors:
(index):1 OTS parsing error: incorrect entrySelector for table directory (index):1 OTS parsing error: hhea: misaligned table
This is the code I am using to generate the subset files:
` $tmp=tempnam(sys_get_temp_dir(), $strFontFamily); $fontFile=\FontLib\Font::load($arrFont["path"]); $fontFile->parse();
$fontFile->setSubset($strFontFamily); $fontFile->reduce();
$fontFile->open($tmp, FontLib\BinaryStream::modeWrite); $fontFile->encode(array("OS/2")); $fontFile->close(); `
Double post. Original: https://github.com/PhenX/php-font-lib/issues/41
I have generated a subset font for each font with only the letters from the font's file name. I was going to use these subset TTF files for a preview of the font.
Using these fonts: https://github.com/google/fonts All 1736 fonts fails with one of these errors:
(index):1 OTS parsing error: incorrect entrySelector for table directory (index):1 OTS parsing error: hhea: misaligned table
This is the code I am using to generate the subset files:
` $tmp=tempnam(sys_get_temp_dir(), $strFontFamily); $fontFile=\FontLib\Font::load($arrFont["path"]); $fontFile->parse();
$fontFile->setSubset($strFontFamily); $fontFile->reduce();
$fontFile->open($tmp, FontLib\BinaryStream::modeWrite); $fontFile->encode(array("OS/2")); $fontFile->close(); `