title: Base64 @font-face Font with wicked_pdf Generator
body: <p>I am trying to use a specific font in an HTML to PDF generated PDF file using wicked_pdf on a Rails 3 site. I have found other advice on here which I followed. The only thing that (mostly) worked for me was converting the fonts to base64. I found the original answer here:
  <a href="https://stackoverflow.com/questions/14734375/wicked-pdf-fontsherokurails3-2/17712586#17712586?newreg=e957c6cf61bb458f9b8fdf5ae678b1d7">Wicked PDF +fonts+heroku+rails3.2</a></p>
  
  <p>I had to put the @font-face CSS directly into the partial file that was using it instead of putting it into a style sheet in order for it to work. It works fine in my local copy now. When I deploy it to our staging server, it only half works. One of the fonts loads, but the bold version of the font does not load.</p>
  
  <p>Here is the @font-face CSS I included in the partial (<a href="http://pastebin.com/hnVGJdMc" rel="nofollow noreferrer">this pastebin</a> includes the entire Base64 code in the off-chance that it's useful):</p>
  
  <pre><code>&lt;style type="text/css"&gt;
    @font-face {
      font-family: 'MuseoSans300';
      src: url(data:font/truetype;charset=utf-8;base64,AAEAAAATAQAABAA...excess text removed);
    }
    @font-face {
      font-family:'MuseoSans700';
      src: url(data:font/truetype;charset=utf-8;base64,AAEAAAATAQAABAA...excess text removed);
    }
  &lt;/style&gt;
  </code></pre>
  
  <p>The styles from the regular style sheet (using SASS) which use these fonts look something like this:</p>
  
  <pre><code>#profile_pdf {
    font-family: 'MuseoSans300';
    h1 {
      font-size: 30px;
      font-family: 'MuseoSans700';
    }
    h2 {
      font-size: 20px;
      font-family: 'MuseoSans300';
    }
  }
  </code></pre>
  
  <p>I've tried changing this a variety of ways. I used the same formatting as this advice:
  <a href="http://blog.shahariaazam.com/use-google-web-fonts-for-wkhtmltopdf-tools/#.UtwZUmQo5hE" rel="nofollow noreferrer">http://blog.shahariaazam.com/use-google-web-fonts-for-wkhtmltopdf-tools/#.UtwZUmQo5hE</a></p>
  
  <p>That made it just stop working entirely.</p>
  
  <p>With the formatting I showed above, it does work on my locally run copy. On the staging server only one of the fonts works; it loads everything in just the 300 version and the 700 version doesn't load. Has anyone else run into this problem?</p>