title: How to embed fonts with PDKFit and asset pipeline in Rails
body: <p>Until I started using PDFKit to create PDFs from HTML in Rails, I was successfully embedding Google Fonts like this:</p>
  
  <pre><code>= stylesheet_link_tag 'http://fonts.googleapis.com/css?family=Rokkitt:400,700'
  </code></pre>
  
  <p>However, PDFKit was not embedding fonts in my PDFs. It generated the PDFs and formatted the using my print stylesheet, but using regular fonts, not my embedded ones.</p>
  
  <p>So, I put EOT, WOFF, TTF and SVG versions of each font in <code>/app/assets/fonts</code> and switched to this format in a new font stylesheet called by my screen and print stylesheets:</p>
  
  <pre><code>@font-face {
      font-family: 'rokkittregular';
      src: font-url('rokkitt-regular-webfont.eot');
      src: local('rokkittregular')
           font-url('rokkitt-regular-webfont.eot?#iefix') format('embedded-opentype'),
           font-url('rokkitt-regular-webfont.woff') format('woff'),
           font-url('rokkitt-regular-webfont.ttf') format('truetype'),
           font-url('rokkitt-regular-webfont.svg#rokkittregular') format('svg');
      font-weight: normal;
      font-style: normal;}
  </code></pre>
  
  <p>Again, this worked just fine for my regular HTML pages. Again, PDFKit didn't embed the fonts in my PDFs.</p>
  
  <p>Assuming this probably has something to do with PDFKit not being able to find the fonts, I created a separate print-fonts stylesheet to be embedded in my print stylesheet. In it, I switched to this notation:</p>
  
  <pre><code>@font-face {
      font-family: "rokkittregular";
      src: url("/assets/rokkitt-regular-webfont.eot");
      src: url("/assets/rokkitt-regular-webfont.eot?#iefix") format("embedded-opentype"),
           url("/assets/rokkitt-regular-webfont.woff") format("woff"),
           url("/assets/rokkitt-regular-webfont.ttf") format("truetype"),
           url("/assets/rokkitt-regular-webfont.svg#rokkittregular") format("svg");
      font-weight: normal;
      font-style: normal;}
  </code></pre>
  
  <p>And later to this notation:</p>
  
  <pre><code>@font-face {
      font-family: "rokkittregular";
      src: url("#{Rails.root}/assets/rokkitt-regular-webfont.eot");
      src: url("#{Rails.root}/assets/rokkitt-regular-webfont.eot?#iefix") format("embedded-opentype"),
           url("#{Rails.root}/assets/rokkitt-regular-webfont.woff") format("woff"),
           url("#{Rails.root}/assets/rokkitt-regular-webfont.ttf") format("truetype"),
           url("#{Rails.root}/assets/rokkitt-regular-webfont.svg#rokkittregular") format("svg");
      font-weight: normal;
      font-style: normal;}
  </code></pre>
  
  <p>Still it didn't work.</p>
  
  <p>The strange thing is if you point your browser at <code>http://localhost:5000/assets/rokkitt-regular-webfont.eot</code>, it takes you to the font file.</p>
  
  <p>How can I get these fonts working in PDFKit?</p>