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

New test #117

Closed
williamdes opened this issue Jan 29, 2023 · 10 comments · Fixed by #130
Closed

New test #117

williamdes opened this issue Jan 29, 2023 · 10 comments · Fixed by #130
Milestone

Comments

@williamdes
Copy link
Contributor

I wrote a new test at Debian, feel free to copy it https://salsa.debian.org/php-team/pear/php-font-lib/-/commit/8eaf263e4e46e058c10092bb2fc8f57d166353d7#c7b64e342fbabe70eb0b971e27dbfec490fccf92_0_54

Or to close this issue :)

Yeah I had to remove the font files because of the missing licences for them in sample-fonts

@bsweeney bsweeney added this to the 0.5.5 milestone Jan 29, 2023
@bsweeney
Copy link
Member

I'll need to look at the fonts to see if there's an applicable license. Otherwise, I'll look for something that's compatible with the library license.

@williamdes
Copy link
Contributor Author

Thank you so much, it helps with packaging
The same problem applies for the dompdf library, there is ttf files and afm files without a license for them

@bsweeney
Copy link
Member

The AFM files included with Dompdf are for the PDF core fonts. The license for those is in the mustRead.html.

I will look at what we need to do for the DejaVu fonts. The UFM files were generated by the Dompdf team and not provided by the DejaVu team.

@williamdes
Copy link
Contributor Author

The AFM files included with Dompdf are for the PDF core fonts. The license for those is in the mustRead.html.

I probably missed them, a license file would be great and more explicit

I will look at what we need to do for the DejaVu fonts. The UFM files were generated by the Dompdf team and not provided by the DejaVu team.

Can you provide a way to re-build them?
We "can not" accept non human readable built files, we need to re build them from source at Debian

@bsweeney
Copy link
Member

The UFM files are human readable. They're just a delimited text file with a format similar to the AFM format. The files were built using php-font-lib so re-building them is straightforward:

$font = FontLib\Font::load("/path/to/file.ttf");
if ($font instanceof FontLib\TrueType\Collection) {
    $font = $font->getFont(0);
}
$font->parse();
$font->saveAdobeFontMetrics(__DIR__ . '/output/' . basename($test_file) . '.ufm');

@williamdes
Copy link
Contributor Author

Thank you, you can close this issue now or when you cherry-picked my test if you want to

@bsweeney
Copy link
Member

I'll keep this open so I don't forget to review that test.

@bsweeney
Copy link
Member

Suggestions on how to handle this in php-font-lib?

Intel Clear is licensed under Apache 2.0
https://github.com/intel/clear-sans

Noto fonts are licensed under OFL
https://fonts.google.com/noto/specimen/Noto+Sans+Shavian/about

@williamdes
Copy link
Contributor Author

A folder for fonts in tests with a license file in each subfolder?
And if possible a txt with where each font was downloaded?

bsweeney added a commit that referenced this issue Jan 1, 2024
- move fonts to tests resources directory
- remove Intel Clear-Light
- add W3C unit test font Ahem
- add new font info test

fixes #117
@bsweeney bsweeney linked a pull request Jan 1, 2024 that will close this issue
@bsweeney
Copy link
Member

bsweeney commented Jan 1, 2024

PR #130 adds that new test and modifies the font structure. I also switched from Intel Clear-Light to the W3C font Ahem, which was developed more for layout unit testing but which I thought it may prove useful in future test development since it uses glyph metrics designed for ease of testing.

Let me know if you have any feedback.

bsweeney added a commit that referenced this issue Jan 6, 2024
- move fonts to tests resources directory
- remove Intel Clear-Light
- add W3C unit test font Ahem
- add new font info test

fixes #117
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

Successfully merging a pull request may close this issue.

2 participants