jordan-brough / heroku-pdf

Sample Rails app for creating PDFs on Heroku using wkhtmltopdf
68 stars 11 forks source link

Problem with embedded fonts #1

Open andyw8 opened 13 years ago

andyw8 commented 13 years ago

I'm trying to use an embedded font:

@font-face {
   font-family: "Zapfino";
   src: url(http://#{request.host_with_port}/fonts/Zapfino.otf) format("opentype");
   }

.decorative {
   font-family: "Zapfino", sans-serif; font-size: 40px;
   margin-bottom: -40px;
  }

This works fine locally but on Heroku the parts styled with that font don't appear (it doesn't even fall back to sans-serif).

Any ideas why this might be?

szTheory commented 12 years ago

use Rails.public_path rather than request.host_with_port