WeasyPrint icon indicating copy to clipboard operation
WeasyPrint copied to clipboard

Weasyprint does not support multiple language like chinese, korean, thai while deploy into Heroku.

Open hema-ramasamy-softsquare opened this issue 2 months ago • 4 comments

Hey guys, you have done a fantastic job. While deploy into Heroku, fonts are not applied for chinese, korean and thai. I have included fonts using @font-face in my external css. Ex: @font-face { font-family: "Source Han Sans SC"; src: local("Source Han Sans SC"), url("static/fonts/SourceHanSansSC-Regular.otf");

}

But if i included the same @font-face inside my style tag. The fonts are applied well. Ex:

Initially, I thought it was a path issue. However, even after multiple attempts to resolve it, the fonts are still not applied. I now believe it is not a path issue.

This is my project folder structure: project/ ├─ app.py ├─ static/ │ ├─ css/report.css │ └─ fonts/SourceHanSansSC-Regular.otf

Hi!

The URLs are relative to your CSS file, so you have to use ../fonts instead of static/fonts.

liZe avatar Nov 17 '25 16:11 liZe

Hi!

The URLs are relative to your CSS file, so you have to use ../fonts instead of static/fonts.

I tried that as well, but it’s still not working. That’s why I opened the issue log.

I tried that as well, but it’s still not working. That’s why I opened the issue log.

Could you please explain how you launch WeasyPrint and how you link your CSS to your HTML file?

liZe avatar Nov 18 '25 08:11 liZe

@hema-ramasamy-softsquare Is there anything more we can do for you?

liZe avatar Dec 08 '25 10:12 liZe