madskristensen / WebEssentials2015

A Visual Studio extension for web developers
Other
300 stars 92 forks source link

WOFF2 fonts embeded as base64 as text/plain #183

Closed brgrz closed 8 years ago

brgrz commented 8 years ago

When you say embed as base64 data URI in CSS and pick a WOFF2 font (for instance, the Fontello service gives us WOFF2 now), WE 2015 will embed it as text/plain mime type.

This results in warnings and errors in browsers, for instance in Chrome you will get

OTS parsing error: Failed to convert WOFF 2.0 font to SFNT

and

Failed to decode downloaded font: data:text/plain;base64,d09GMgABAAAAAAocAA8AAAAAFVQAAAnDAAEAAAAAAAAAAAAAAAAA…NwpxA+iWbSfTXSzP/ehs2ynd70uKsbX+bonUNM2Gx8f9HKpOX6zoeokmjTPxnHXH6fYhIAAAA=

The correct mime type is font/woff2. If I manually replace text/plain with font/woff2 all works fine.