How to host google web fonts on my own server?

Please keep in mind that my answer has aged a lot. There are other more technically sophisticated answers below, e.g.: neverpanic/google-font-download google-webfont-helper localfont so don’t let the fact that this is the currently accepted answer give you the impression that this is still the best one. You can also now also download google’s entire font … Read more

Proper MIME type for .woff2 fonts

In IIS you can declare the mime type for WOFF2 font files by adding the following to your project’s web.config: <system.webServer> <staticContent> <remove fileExtension=”.woff2″ /> <mimeMap fileExtension=”.woff2″ mimeType=”font/woff2″ /> </staticContent> </system.webServer> Update: The mime type may be changing according to the latest W3C Editor’s Draft WOFF2 spec. See Appendix A: Internet Media Type Registration section … Read more

How to embed .ttf fonts in JavaFx 2.2?

Solution Approach I updated the sample from Javafx How to display custom font in webview? to demonstrate using a custom true-type font in JavaFX controls styled using CSS. Key points are: Place the font in the same location as your application class and ensure your build system places it in your binary build package (e.g. … Read more

Proper MIME type for OTF fonts

There are a number of font formats that one can set MIME types for, on both Apache and IIS servers. I’ve traditionally had luck with the following: svg as “image/svg+xml” (W3C: August 2011) ttf as “application/x-font-ttf” (IANA: March 2013) or “application/x-font-truetype” otf as “application/x-font-opentype” (IANA: March 2013) woff as “application/font-woff” (IANA: January 2013) woff2 as … Read more