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

Embed Google or Typekit fonts? #24

Closed
befreestudios opened this Issue Mar 18, 2016 · 5 comments

Comments

Projects
None yet
2 participants
@befreestudios

befreestudios commented Mar 18, 2016

Anyone know of a way to embed google web fonts, or typekit fonts for use in a PDF ? I'm assuming you might be able to do this by way of the runnings file, but I'm at a loss. Anyone tried this before, or have any suggestions?

Thanks in advance...

@dustin-H

This comment has been minimized.

Show comment
Hide comment
@dustin-H

dustin-H Mar 19, 2016

Member

Have you tried to just add the font link to your HTML file like this?:

<link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>

And use it in CSS:

font-family: 'Open Sans', sans-serif;
Member

dustin-H commented Mar 19, 2016

Have you tried to just add the font link to your HTML file like this?:

<link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>

And use it in CSS:

font-family: 'Open Sans', sans-serif;

@dustin-H dustin-H added the question label Mar 19, 2016

@befreestudios

This comment has been minimized.

Show comment
Hide comment
@befreestudios

befreestudios Mar 21, 2016

@dustin-H Thanks, but that doesn't work. Actually when I do that it generates a blank pdf

befreestudios commented Mar 21, 2016

@dustin-H Thanks, but that doesn't work. Actually when I do that it generates a blank pdf

@befreestudios

This comment has been minimized.

Show comment
Hide comment
@befreestudios

befreestudios Mar 22, 2016

FYI... for anyone interested, came across this article. We are going to try to implement this on our node server and see how it works out...

https://medium.com/@stockholmux/besting-phantomjs-font-problems-ee22795f5c0b#.rpx1cf2zi

befreestudios commented Mar 22, 2016

FYI... for anyone interested, came across this article. We are going to try to implement this on our node server and see how it works out...

https://medium.com/@stockholmux/besting-phantomjs-font-problems-ee22795f5c0b#.rpx1cf2zi

@befreestudios

This comment has been minimized.

Show comment
Hide comment
@befreestudios

befreestudios Jun 15, 2016

@dustin-H

In case anyone is interested (and it may be worth documenting), the above solution I posted worked. Essentially we needed to have the font we wanted rendered in the pdf on the production node server server that was running the pdf-generation (the link explains in detail)...

TLDR;

Custom fonts on PhantomJS step-by-step for Ubuntu

  • Get a Type1 version of the font you need. I needed to do a conversion from TrueType— there are lots of tools to do this with.
  • Upload your Type1 font to your ‘/usr/share/fonts/type1' directory.
  • Run ‘fc-cache -fv’
  • Enjoy having PhantomJS with your new font.

befreestudios commented Jun 15, 2016

@dustin-H

In case anyone is interested (and it may be worth documenting), the above solution I posted worked. Essentially we needed to have the font we wanted rendered in the pdf on the production node server server that was running the pdf-generation (the link explains in detail)...

TLDR;

Custom fonts on PhantomJS step-by-step for Ubuntu

  • Get a Type1 version of the font you need. I needed to do a conversion from TrueType— there are lots of tools to do this with.
  • Upload your Type1 font to your ‘/usr/share/fonts/type1' directory.
  • Run ‘fc-cache -fv’
  • Enjoy having PhantomJS with your new font.
@dustin-H

This comment has been minimized.

Show comment
Hide comment
@dustin-H

dustin-H Jun 16, 2016

Member

Hi @befreestudios ,

thanks a lot for that information. I will add them to the docs soon!

Member

dustin-H commented Jun 16, 2016

Hi @befreestudios ,

thanks a lot for that information. I will add them to the docs soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment