munee icon indicating copy to clipboard operation
munee copied to clipboard

Font encoding

Open Crecket opened this issue 9 years ago • 6 comments

I had a quick look but I didn't see anyone else mention it. Are there any plans to support ttf and other font files in the future?

For example font-awesome will load fine, but the console will fill up with a bunch of errors similar to: Failed to decode downloaded font: http://example.com/munee.php?files=/\/assets/css/fonts/font-awesome/fontawesome-webfont.ttf&v=4.4.0

I've fixed it by putting font-awesome outside off the main file chain but it would great if this was possible.

Crecket avatar Jan 13 '16 14:01 Crecket

I have embedded fonts "src: url(data:font/woff;charset=utf-8;base64,......)" and that is worse. I have done the same thing Crecket has done (made a separate fonts.css) How can I disable the CSS parser from auto-rewriting url()s ?

thinkdj avatar Jan 22 '16 11:01 thinkdj

Okay, modified https://github.com/meenie/munee/blob/e6896ab7067b920821e310cf637caea5a6e09af9/src/Munee/Asset/Type/Css.php#L224 to exclude "data:font" too. Thanks for the pointer @meenie

thinkdj avatar Jan 24 '16 06:01 thinkdj

Fonts should definitley not be run through Munee. Is the issue you are having that you are not using the .htaccess url rewrite and Munee is rewriting the font URLs in your CSS to http://example.com/munee.php?files=...? That's a bug if that's the case.

meenie avatar Jan 24 '16 06:01 meenie

@Crecket: It looks like this is related to #88 which I have yet to fix. Sorry about that ><

meenie avatar Jan 24 '16 06:01 meenie

@meenie no worries, Munee is still incredibly useful and the site will work just fine with 2 external files instead of 1 :p

Ill have a look if I can fix it myself this week. I had a quick look at how it is setup, would it be viable to just add a new file type which only returns the file?

Crecket avatar Jan 24 '16 16:01 Crecket

I'm pretty sure I've solved it right now. The only issue right now is that I'm not sure if the headers are correct for the font files (http://stackoverflow.com/questions/2871655/proper-mime-type-for-fonts)

Crecket avatar Jan 24 '16 17:01 Crecket