简体   繁体   English

字体轻巧/易于使用,可实现缓慢的Internet连接CSS

[英]Light/Easy weight font for slow internet connection CSS

Could you advise me which font I should use in CSS file if we guess that user would have a slow internet connection to my site ? 如果我们认为用户与我的网站的互联网连接速度较慢,您能否建议我在CSS文件中使用哪种字体?

I've connected local file of font: 我已经连接了字体的本地文件:

@font-face {
    font-family: 'Open Sans 2';
    src: url('fonts/OpenSans-Light.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

Opera shows me that this font would be downloaded for 2 secs ! Opera告诉我该字体将被下载2秒钟!

歌剧

As a result, site will be opened only per 5 secs. 结果,站点将仅每5秒打开一次。 This is unnormal ... 这是不正常的...

Q: How to include only part of font file or could you give me some kind of lightweight font ? 问:如何只包含部分字体文件,或者您能给我一些轻巧的字体吗?

Thank you for view : ) ! 感谢您的意见:)!

If your main goal is to have no downtime with your font then you should use native cross-browser fonts and not use CDN or Local ones : http://www.w3schools.com/cssref/css_websafe_fonts.asp You'll be good with that. 如果您的主要目标是不让字体停机,那么您应该使用本机跨浏览器字体,而不要使用CDN或本地字体: http : //www.w3schools.com/cssref/css_websafe_fonts.asp那。

If you really want to use other fonts GoogleFonts is a solid option or maybe a local one + cache. 如果您真的想使用其他字体,则GoogleFonts是一个不错的选择,或者是本地的一个+缓存。 Also you can use a JS font loader like explain here https://www.lockedowndesign.com/load-google-fonts-asynchronously-for-page-speed But you'll have a blinking effect when the font is loaded I think. 您也可以使用JS字体加载器,例如在此处进行说明https://www.lockedowndesign.com/load-google-fonts-asynchronously-for-page-speed但我认为加载字体时会产生闪烁效果。

You have to think of your audiences and what is the most important for you. 您必须考虑自己的受众,最重要的是什么。 If you know they will all have slow connections, then go with using only native/safe fonts. 如果您知道它们的连接速度都较慢,则仅使用本机/安全字体。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM