2011-07-18 96 views
0

我们在网站上使用了一些非基本字体,但问题是重新加载 - 你可以看到基本的字体,然后重新加载到我们在每一页上的字体。它可能缓存它或以某种方式将其保存到客户端?重新加载每个页面都很糟糕。在网站上重新加载我的字体

网站:http://ktwebstudio.cz/

我们使用Windows主机和ASP.NET。

我发现:

<system.webServer> 
    <staticContent> 
     <clientCache cacheControlMode="UseMaxAge" /> 
    </staticContent> 
</system.webServer> 

而且一切正常。

+0

看起来像你有同样的问题,因为在这里:http://stackoverflow.com/questions/1036309/using-font-face-slows-load-time-can-i-force-the-client-to -cache-the-font – Hnatt

+0

Thx,我检查它。 – Honzik

回答

0

如果在你的网页上使用自定义字体就是你的意思,那么CSS是最好的方法。它工作得很好,我可以从个人经验告诉你。这里是你如何做到这一点:

注:

  • 您可以定义多个自定义的字体,你喜欢用下面的例子。
  • Internet Explorer使用EOT字体而不是TTF。
  • 使用您指定的字体系列在您的网页中使用字体。

    @font-face 
    { 
        font-family: name_of_font; 
        src: 
         url('url of name_of_font.ttf' */), 
         url('url of name_of_font.eot' */); 
    } 
    


例子:

<p style="font-family: name_of_font; font-size: 100%;"> Your text here with the custom font you specified... </p>

0

不,它是不可能停止的基本字体的重装嵌入CSS3字体,即使字体缓存!这是一个网页浏览器问题。一些网络浏览器会这样做(Opera),有些则不会(IE9)。