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

Failure to load woff2 fonts on Linux #14

Closed
bretif opened this issue Sep 25, 2018 · 5 comments
Closed

Failure to load woff2 fonts on Linux #14

bretif opened this issue Sep 25, 2018 · 5 comments
Labels
wontfix This will not be worked on

Comments

@bretif
Copy link

bretif commented Sep 25, 2018

Hello,

I am using mkdocs with material theme.
I follow documentation and I think install everything as needed.
python -m weasyprint http://weasyprint.org weasyprint.pdf is working properly

$ mkdocs --version
mkdocs, version 1.0.4 from /home/bretif/dev/mkdocs/skinfra-mkdocs/py3/lib/python3.5/site-packages/mkdocs (Python 3.5)

If I try to build my site but I get this error

ERROR: Failed to load font at "file:///home/bretif/dev/mkdocs/skinfra-mkdocs/site/assets/fonts/specimen/MaterialIcons-Regular.woff2"
ERROR: Failed to load font at "file:///home/bretif/dev/mkdocs/skinfra-mkdocs/site/assets/fonts/specimen/FontAwesome.woff2"

However these files exist:

$ ls -l /home/bretif/dev/mkdocs/skinfra-mkdocs/site/assets/fonts/specimen/MaterialIcons-Regular.woff2
-rw-r--r-- 1 bretif psi 44300 sept. 25 11:37 /home/bretif/dev/mkdocs/skinfra-mkdocs/site/assets/fonts/specimen/MaterialIcons-Regular.woff2

$ ls -l /home/bretif/dev/mkdocs/skinfra-mkdocs/site/assets/fonts/specimen/FontAwesome.woff2                                      
-rw-r--r-- 1 bretif psi 77160 sept. 25 11:37 /home/bretif/dev/mkdocs/skinfra-mkdocs/site/assets/fonts/specimen/FontAwesome.woff2

Do you have any clue of what is wrong with my setup.

Regards
Bertrand

@bretif bretif changed the title ERROR: Failed to load font at "file:///home/bretif/dev/mkdocs/skinfra-mkdocs/site/assets/fonts/specimen/MaterialIcons-Regular.woff2" Failed to load fonts Sep 25, 2018
@shauser
Copy link
Collaborator

shauser commented Sep 25, 2018

Can you run it with the verbose option and check whether you get anything else that could help?

@bretif
Copy link
Author

bretif commented Sep 25, 2018

I attached full log of run in debug version for only a page. mkdocs-pdf-export-issue14.txt

I get the same error for all pages.
No pdf are generated.

Here is extract of the step with the error

INFO: Step 2 - Fetching and parsing CSS - https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono
WARNING: Failed to load local font "Roboto Light"
WARNING: Failed to load local font "Roboto-Light"
WARNING: Failed to load local font "Roboto"
WARNING: Failed to load local font "Roboto Mono"
WARNING: Failed to load local font "RobotoMono-Regular"
INFO: Step 2 - Fetching and parsing CSS - CSS string
INFO: Step 2 - Fetching and parsing CSS - file:///home/bretif/dev/mkdocs/skinfra-mkdocs/site/assets/fonts/material-icons.css
WARNING: Failed to load local font "Material Icons"
WARNING: Failed to load local font "MaterialIcons-Regular"
ERROR: Failed to load font at "file:///home/bretif/dev/mkdocs/skinfra-mkdocs/site/assets/fonts/specimen/MaterialIcons-Regular.woff2"
INFO: Step 2 - Fetching and parsing CSS - CSS string
INFO: Step 2 - Fetching and parsing CSS - file:///home/bretif/dev/mkdocs/skinfra-mkdocs/site/assets/fonts/font-awesome.css
ERROR: Failed to load font at "file:///home/bretif/dev/mkdocs/skinfra-mkdocs/site/assets/fonts/specimen/F
[mkdocs-pdf-export-issue14.txt](https://github.com/shauser/mkdocs-pdf-export-plugin/files/2414749/mkdocs-pdf-export-issue14.txt)
ontAwesome.woff2"

@shauser
Copy link
Collaborator

shauser commented Sep 25, 2018

While the error message is certainly not very good, this is a missing feature of weasyprint running on Linux:

https://weasyprint.readthedocs.io/en/stable/features.html#fonts

Maybe referencing another font format will solve it?

@shauser shauser changed the title Failed to load fonts Failure to load woff2 fonts on Linux Sep 25, 2018
@bretif
Copy link
Author

bretif commented Sep 26, 2018

Thanks for your reply.
I understand that under Linux weasyprint can not load woff2 fonts.

The only solution I found is to manually edit

  • material/assets/fonts/material-icons.css
  • material/assets/fonts/font-awesome.css

and set ttf font first in the list of format font.

If you have any idea to fix the issue....

@zhaoterryy zhaoterryy added the wontfix This will not be worked on label Jan 15, 2019
@zhaoterryy
Copy link
Owner

Won't fix - Weasyprint does not support woff2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants