Bug serving @font-face to IE in Vae Local EVN
  • Hi Kevin,

    I run into a bug when using the recommended @font-face syntax in my css.

    http://www.fontspring.com/blog/the-new-bulletproof-font-face-syntax

    @font
    -face {
    font-family: 'MyFontFamily';
    src: url('myfont-webfont.eot?#iefix') format('embedded-opentype'),
    url('myfont-webfont.woff') format('woff'),
    url('myfont-webfont.ttf') format('truetype'),
    url('myfont-webfont.svg#svgFontName') format('svg');
    }

    If you look at the 3rd line with the url of "myfont-webfont.eot?#iefix"

    In vae_site_servlet.rb (line 131) there is a statement that checks if the file is local or not. Well that '?' is in the path thats checked so it fails.

    I just dropped this in right above that line.

    local_path.sub!(/eot\??$/, 'eot')

    It just checks that the file path ends in eot and if there is a trailing '?' it strips it out in place.

    Hope that helps you out.

    I was also thinking since the source is already accessible maybe you could think about putting it up on Github so patches could be submitted easier.

    Also please let me know if there better way to submit kind of stuff.

    Thanks

    Arron

  • 4 Answers sorted by
  • Hey Arron,

    I'd be willing to entertain possibly throwing it up on GitHub in the future. For now, I made a slightly different change for this problem. Can you try making the change this way in vae_site_servlet.rb and see if this still works for you:


    def serve(req, res)
    res.status = 200
    local_path = ($site.root+req.params["REQUEST_URI"] || "/").split("?").first
    if File.exists?(local_path) and !File.directory?(local_path) and !server_parsed?(local_path)


    That should be the new lines 128-131.

    I think this is a more robust change.

  • Much better. Thanks!

  • Ok, this will go out with the next local update which updates Sass, assuming that all goes well in the next week or so.

  • This update to vae_local went out a 0.4.2. Sass update *not* included.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

In this Discussion