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

Material theme admonition icons do not render correctly #17

Closed
raqbit opened this issue Sep 26, 2018 · 7 comments
Closed

Material theme admonition icons do not render correctly #17

raqbit opened this issue Sep 26, 2018 · 7 comments
Labels
investigate needs investigation

Comments

@raqbit
Copy link

raqbit commented Sep 26, 2018

When generating PDFs from material-theme style docs with admonition blocks, the material icons do not get rendered correctly. It seems like something goes wrong when adding the font to the pdf.

Example:

image

Looks like

image

Log output:

ERROR: Failed to load font at "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.eot#iefix&v=4.7.0"
ERROR: Failed to load font at "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.woff2?v=4.7.0"
ERROR: Failed to load font at "file:///tmp/tmpw6mo9adz/assets/fonts/specimen/MaterialIcons-Regular.woff2"
ERROR: Failed to load font at "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.eot#iefix&v=4.7.0"
ERROR: Failed to load font at "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.woff2?v=4.7.0"
ERROR: Failed to load font at "file:///tmp/tmpw6mo9adz/assets/fonts/specimen/MaterialIcons-Regular.woff2"
ERROR: Failed to load font at "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.eot#iefix&v=4.7.0"
ERROR: Failed to load font at "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.woff2?v=4.7.0"
ERROR: Failed to load font at "file:///tmp/tmpw6mo9adz/assets/fonts/specimen/MaterialIcons-Regular.woff2"
ERROR: Failed to load font at "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.eot#iefix&v=4.7.0"
ERROR: Failed to load font at "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.woff2?v=4.7.0"
ERROR: Failed to load font at "file:///tmp/tmpw6mo9adz/assets/fonts/specimen/MaterialIcons-Regular.woff2"
ERROR: Failed to load font at "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.eot#iefix&v=4.7.0"
ERROR: Failed to load font at "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.woff2?v=4.7.0"
ERROR: Failed to load font at "file:///tmp/tmpw6mo9adz/assets/fonts/specimen/MaterialIcons-Regular.woff2"
ERROR: Failed to load font at "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.eot#iefix&v=4.7.0"
ERROR: Failed to load font at "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.woff2?v=4.7.0"
ERROR: Failed to load font at "file:///tmp/tmpw6mo9adz/assets/fonts/specimen/MaterialIcons-Regular.woff2"
ERROR: Failed to load font at "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.eot#iefix&v=4.7.0"
ERROR: Failed to load font at "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.woff2?v=4.7.0"
...
@raqbit
Copy link
Author

raqbit commented Sep 26, 2018

Okay, seems like the reason the icons didn't load is because the recommended stylesheet does not include the Material Icons font-family. After adding it, the icons loaded correctly.

@shauser
Copy link
Collaborator

shauser commented Oct 13, 2018

Can you please post what exactly you added where (or even better: provide a pull request)? Since I don't have the problem, I can't really fix this otherwise.

@andrewpriddis
Copy link

@raqbit I have the same problem and am not sure where to add the font family. Can you describe your solution more?

@zhaoterryy zhaoterryy added the awaiting reply waiting for reply label Jan 15, 2019
@raqbit
Copy link
Author

raqbit commented Jan 16, 2019

@siddirp What I did is I added Material Icons as a fallback font to the css:

@page {
    font-family: "Roboto", "Material Icons", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

While this did fix it when generating on my local machine, I did not get this to work when running using CI.

Edit: It seems like this (^) was never the fix, but for me it will generate icons fine when running locally but will fail when running in a CI environment. Maybe this has to do with some fonts or graphical libraries being available on the system?

@zhaoterryy zhaoterryy added investigate needs investigation and removed awaiting reply waiting for reply labels Jan 16, 2019
@raqbit
Copy link
Author

raqbit commented Jan 31, 2019

To get the same environment: I am using the docker image python:3.7.0-stretch in the CI setup.

@raqbit
Copy link
Author

raqbit commented Feb 3, 2019

After updating to a docker image based on Debian buster, the issue solved itself. It seems to be related to the version of a dependency in Debian stretch.

@zhaoterryy
Copy link
Owner

Interesting.. I'm going to close this for now. Feel free to open another issue.

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

No branches or pull requests

4 participants