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

UserWarning: FontConfig: No fonts configured. #1038

Closed
izanf opened this issue Jan 22, 2020 · 5 comments
Closed

UserWarning: FontConfig: No fonts configured. #1038

izanf opened this issue Jan 22, 2020 · 5 comments

Comments

@izanf
Copy link

izanf commented Jan 22, 2020

I'm having this error when I try to use the weasyprint

/usr/local/lib/python3.6/site-packages/weasyprint/fonts.py:230: UserWarning: FontConfig: No fonts configured. Expect ugly output.
  'FontConfig: No fonts configured. '
/usr/local/lib/python3.6/site-packages/weasyprint/document.py:36: UserWarning: There are known rendering problems and missing features with cairo < 1.15.4. WeasyPrint may work with older versions, but please read the note about the needed cairo version on the "Install" page of the documentation before reporting bugs. http://weasyprint.readthedocs.io/en/latest/install.html

and the rendering:
Screen Shot 2020-01-22 at 20 30 16

@izanf izanf closed this as completed Jan 23, 2020
@izanf
Copy link
Author

izanf commented Jan 23, 2020

I resolve installing font-config on Alpine Linux

@EricLewe
Copy link

EricLewe commented Jul 3, 2020

I got squares (and the warning) despite having fontconfig installed. This was due to me not having any fonts installed. Hence it was resolved once I added fonts to my OS. (This came in handy for me https://stackoverflow.com/questions/56937689/alpine-linux-fonts)

@yashvarshney003
Copy link

Any idea how to resolve for macos?

@fungss
Copy link

fungss commented Mar 31, 2022

I resolve installing font-config on Alpine Linux

For those who don't know how to install font-config in a docker container, I managed to solve the problem by adding the followings in the Dockerfile.

RUN apk --update --upgrade --no-cache add fontconfig ttf-freefont font-noto terminus-font \ 
   && fc-cache -f \ 
   && fc-list | sort 

reference: orzih/mkdocs-with-pdf#50

@realFranco
Copy link

realFranco commented Jun 3, 2024

Based on the @fungss answer.

For alpine:3.20.0 this was solve installing the next "fonts".

# Docker syntax.
RUN apk update --no-cache && \
    apk add --no-cache
        # weasyprint=62.1-r0 \
        # Add fonts.
        fontconfig=2.15.0-r1 \
        # ttf-freefont \
        font-noto=23.7.1-r0
        # terminus-font

For my purposes, I have to use aarch64 architecture, maybe the comented font packages are available but not the previous defined architecture.

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

No branches or pull requests

5 participants