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

Unable to find a suitable font #284

Closed
luoyu-123 opened this issue Apr 24, 2021 · 5 comments
Closed

Unable to find a suitable font #284

luoyu-123 opened this issue Apr 24, 2021 · 5 comments

Comments

@luoyu-123
Copy link

How to solve the problem of reporting an error while reading the svg and creating a drawing object

屏幕截图_6
code:
from svglib.svglib import svg2rlg

from reportlab.graphics import renderPDF

drawing = svg2rlg("test.svg")
print(drawing)

renderPDF.drawToFile(dr

awing, "22.pdf")

file:
test.zip

@dcarbone
Copy link

Looks to me like you're missing a font pack.

https://docs.microsoft.com/en-us/typography/font-list/fangsong

Try installing that font pack, see if it works.

@victorbnl
Copy link
Contributor

I think this issue should be renamed "Unable to find a suitable font"

@claudep claudep changed the title svg image to pdf is an error Unable to find a suitable font Aug 26, 2021
@claudep
Copy link
Collaborator

claudep commented Aug 26, 2021

I guess this is more of a usage issue, not really actionable.

@claudep claudep closed this as completed Aug 26, 2021
@rocketinventor
Copy link

Is there a way to suppress these errors?

@deeplook
Copy link
Owner

This should do it on the command-line:

python -W ignore::SomeWarningCategory script.py
python -W ignore::Warning script.py              # supress all warnings

and in code:

import warnings

with warnings.catch_warnings():
    warnings.filterwarnings("ignore", category=SomeWarningCategory)
    # Code that generates the warning

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

6 participants