3

Is there a way to embed a font in the html / javascript code? (everything in 1 html file)

Sam
  • 65
  • 4
  • Related: http://stackoverflow.com/questions/220236/how-to-embed-fonts-in-html – Daniel Vassallo Jun 19 '10 at 22:14
  • i want everything in the same file – Sam Jun 19 '10 at 22:15
  • Is there a particular reason it has to be in one file? This sounds quite artificial, and I wouldn't be surprised if there's some way of using e.g. sIFR that fits in with your situation. If you post the *full* constraints people will be able to give you fuller answers. – Andrzej Doyle Jun 19 '10 at 22:47

1 Answers1

1

I think Cufón may be your best bet. Its font converter turns OTF, TTF, PFB, and PostScript fonts into JavaScript. You can also limit the converted fonts to certain glyph subsets to reduce file size. Read more here:

https://github.com/sorccu/cufon/wiki/about

Usually you'd want to include the resultant JavaScript files externally (to aid cacheing and ease development and maintenance), but for your purposes, you can just include it all within <script> elements in the HTML document.

RamC
  • 1,277
  • 1
  • 10
  • 15
Bungle
  • 17,944
  • 23
  • 75
  • 101