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

Custom Font #816

Closed
espositodaniele opened this issue Sep 24, 2021 · 2 comments
Closed

Custom Font #816

espositodaniele opened this issue Sep 24, 2021 · 2 comments
Labels

Comments

@espositodaniele
Copy link

This is just a Dompdf wrapper!
I understand that this package is just a Laravel wrapper for https://github.com/dompdf/dompdf
Any issues with PDF rendering, CSS that is not applied correctly, aligning/fonts/characters etc that are not directly related to this package, should be reported there. When having doubts, please try to reproduce the issue with just dompdf. If it's also present there, do not open an issue here please.

Describe the bug
I've tried all the replies on the issue tracking to find a solution without success. I'm trying to add a custom font on my pdf that is generated from an action but I'm not able to get it working.

I've created a folder under the storage path as suggested.
Download the font in that folder.
Added the css on my pdf view in a million of way by following the replies on the issue tracking, but all of them are not working.

To Reproduce

@font-face {
font-family: 'rockwell';
    src: url('fonts/RockwellBold.ttf') format('truetype');
    font-weight: bold;
    font-style: bold;
}

h2 {
   font-family: 'rockwell', sans-serif;
}

Please, just give an explanation of how we can add custom fonts using this package.

@happyDemon
Copy link

I had the best results converting the original font file to a format dompdf understands without needing to defined the font family as a font face myself.

I created a PR #820 that adds an artisan command to do this for you.

@stale
Copy link

stale bot commented Jan 8, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Any issues with PDF rendering itself that are not directly related to this package, should be reported on https://github.com/dompdf/dompdf instead. When having doubts, please try to reproduce the issue with just dompdf.
If you believe this is an actual issue with the latest version of laravel-dompdf, please reply to this issue so we can investigate further.
Thank you for your contribution! Apologies for any delayed response on our side.

@stale stale bot added the stale label Jan 8, 2022
@stale stale bot closed this as completed Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants