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

CSS font url inlining #8

Closed
lucas-gaitzsch opened this issue Nov 14, 2023 · 3 comments
Closed

CSS font url inlining #8

lucas-gaitzsch opened this issue Nov 14, 2023 · 3 comments

Comments

@lucas-gaitzsch
Copy link
Owner

lucas-gaitzsch commented Nov 14, 2023

Hi 👋

I've found this tool incredibly helpful in getting PDF templates up and running with minimal set up, thanks so much.

One small feature request, I'm not able to render the footer with a custom font. I can use this in the body very easily, by including the font file in the assets, and then using the following css inside the header.

@font-face {
	font-family: "gill";
	src: url("assets/gill-regular.TTF") format("truetype");
	font-weight: normal;
	font-style: normal;
}

* {
	font-family: "gill", sans-serif;
}

Unfortunately, this font is just not found when rendering the footer. I've tried in both the hosted playground (https://pdfturtle.gaitzsch.dev/) and running in a docker container on my local machine.

Originally posted by @whytekiwi in #2 (comment)

@lucas-gaitzsch
Copy link
Owner Author

lucas-gaitzsch commented Nov 14, 2023

@whytekiwi

I have tried to reproduce your issue. I hope the commit ca1b115 will fix this.
Could you test the font rendering with your example? (see release "v2023.11.14.2211")

@whytekiwi
Copy link

Hi again, and thanks so much for taking the time to investigate this.

I have pulled the latest docker image, and am sad to say that the problem still exists.

I have attached an anonymized bundle file to help with any investigation. Hopefully this helps.

pdf-turtle-bundle.zip

lucas-gaitzsch added a commit that referenced this issue Dec 1, 2023
@lucas-gaitzsch
Copy link
Owner Author

The new change fixes the font inlining (as base64) for your example.
Unfortunately your example still does not work. This is probably not supported by the Chromium rendering engine. I would recommend that you deliver the desired font directly with the pdf-turtle container (see existing Dockerfile). This eliminates the need to include the font as an asset.

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

2 participants