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

Issues with fonts when trying to convert html to image using imgkit and wkhtmltoimage #94

Open
ankush86 opened this issue May 20, 2016 · 4 comments

Comments

@ankush86
Copy link

Trying to convert the HTML content into image using ImgKit and wkhtmltoimage. Image is converted successfully but facing the issues with fonts (Font Awesome).

The image is not look as it as HTML content.

Attaching 2 images one which have HTML content (HTML-CONTENT.png) and other one is converted to image (HTML-Converted-To-IMAGE.png). You can see the difference in fonts between the 2 images.

html-content

html-converted-to-image

Could you please anyone suggest me on this, how can I achieve exact html conversion into image.

Thanks for the help in advance.

@csquared
Copy link
Owner

csquared commented Jun 8, 2016

You're definitely right that wkhtmltoimage doesn't seem to be picking up your fonts. To troubleshoot I'd recommend you try using wkhtmtoimage outside of IMGKit with a small html file that just imports your fonts.

Here's a stack overflow article on getting fonts working with wkhtmltopdf: http://stackoverflow.com/questions/10611828/use-custom-fonts-with-wkhtmltopdf

@Magesh-B
Copy link

Magesh-B commented May 4, 2020

You can download the required ttf file and use it in your css, This will work, Anyway sorry for the late support! :-)

@riddhibacancy
Copy link

riddhibacancy commented Jul 21, 2020

@Magesh-B If you have any example can you please share it.
I have html file in which I had included custom fonts from assets, while I am trying to convert html file to image I am facing issue for fonts.

@nikhil-bacancy
Copy link

@csquared , Hey there, Your lib is absolutely fantastic made my work so easy except one stage. I am not able to get the set font family in the final image result. If you could help me out it would be really great help to me.

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