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

Font location on Ubuntu servers are not correct #2809

Closed
8 tasks
jasverix opened this issue May 6, 2022 · 1 comment · Fixed by #3830
Closed
8 tasks

Font location on Ubuntu servers are not correct #2809

jasverix opened this issue May 6, 2022 · 1 comment · Fixed by #3830

Comments

@jasverix
Copy link
Contributor

jasverix commented May 6, 2022

This is:

- [ x ] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)

What is the expected behavior?

When using Excel file with i.e. Calibri, it should find the installed font, when it is installed on /usr/share/fonts/truetype/vista/calibri.ttf. All truetype fonts installed on our server at least, are installed grouped by directories.

What is the current behavior?

It cannot find the font. And the reason is pretty obvious. $fontFile = self::$trueTypeFontPath . $fontFile;. It makes no effort to look in sub-directories.

What are the steps to reproduce?

Set true-type font directory to /usr/share/fonts/truetype/ as the documentation states, and try to use it.

What features do you think are causing the issue

  • Reader
  • Writer
  • Styles
  • Data Validations
  • Formula Calulations
  • Charts
  • AutoFilter
  • Form Elements
  • [ x ] Fonts
@jasverix
Copy link
Contributor Author

jasverix commented May 6, 2022

I may submit a pull request on this later, but I just wanted to register the issue for now.

oleibman added a commit to oleibman/PhpSpreadsheet that referenced this issue Dec 16, 2023
Fix PHPOffice#2809. User felt font files should be searched recursively. The problem could be overcome merely by specifying a more precise font location. However, user has a point - the file layout on user's system is pretty common, and can be integrated into PhpSpreadsheet code easily. As a bonus, the DocBlock for setTrueTypeFontPath, which the user felt was misleading, doesn't even have to change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant