• Resolved eumene

    (@eumene)


    Hi staff

    I found a strange behavior with @font-face in my site

    Using Autoptimize (I love it – THANKS!) my font-face declaration

    @font-face {
    font-family: ‘Material Icons’;
    font-style: normal;
    font-weight: 400;
    src: url(MaterialIcons-Regular.eot); /* For IE6-8 */
    src: local(‘Material Icons’),
    local(‘MaterialIcons-Regular’),
    url(MaterialIcons-Regular.woff2) format(‘woff2’),
    url(MaterialIcons-Regular.woff) format(‘woff’),
    url(MaterialIcons-Regular.ttf) format(‘truetype’);
    }

    becomes

    @font-face{font-family:’Material Icons’;font-style:normal;font-weight:400;src:url(/.infocube.it/lpg/plugins/revslider/admin/assets/icons/MaterialIcons-Regular.eot);….

    This is true far many @font-face with relative path in source.
    I don’t like to escape many css (custom or 3rd party).

    Can you help me?
    Thanks!

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    so the subdomain gets lost in translation, right? bizarre!

    what you can do is use below code snippet;

    
    add_filter( 'autoptimize_css_after_minify', 'fix_subdomain' );
    function fix_subdomain( $css_in ) {
        return str_replace( 'url(/.infocube.it', 'url(/lpg.infocube.it', $css_in )
    }

    hope this helps,
    frank

    Thread Starter eumene

    (@eumene)

    Hi Frank.

    Just a little change to your code and it works

    add_filter( 'autoptimize_css_after_minify', 'fix_subdomain' );
    function fix_subdomain( $css_in ) {
        return str_replace( 'url(/.infocube.it', 'url(//lpg.infocube.it', $css_in )
    }

    I test other subdomain for other site, but this strange behavior doesn’t happen…
    Really strange.

    But thanks to give me the possibility to study little more your plugin.

    Bye ??

    Thread Starter eumene

    (@eumene)

    RESOLVED

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    you’re welcome Eumene, feel free to leave a review of the plugin and support here! ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘@font-face – wrong font url’ is closed to new replies.