网络字体是否需要一起包含BOLD/ITALICS文件? [英] Does web-fonts need to have BOLD / ITALICS files together?

查看:79
本文介绍了网络字体是否需要一起包含BOLD/ITALICS文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在桌面软件(例如MS WORD)中,为了对Unicode字体使用BOLD或ITALICS样式,我们必须安装单独的文件:

In Desktop software (like MS WORD) in order to use BOLD or ITALICS styles for an unicode font, we had to install separate files:

MyFont.ttf
MyFont-Bold.ttf
MyFont-Italics.ttf
.....

但是在CSS中,我们只需要只有.ttf文件,浏览器就可以自己执行BOLD/ITALICS.因此,我的问题是-浏览器如何在不提供专门用于BOLD和ITALICS的文件的情况下创建"这些样式?或就此问题而言,桌面应用程序和浏览器之间有什么区别?还是为什么...bold.ttf...italics.ttf文件曾经存在,却根本没有集成到主ttf文件中?

But in CSS, we only need to have only .ttf file, and browser can do BOLD/ITALICS itself. So, my question is - how do browsers "create" those styles without providing the files specifically for BOLD and ITALICS? Or what's the difference between Desktop apps and Browsers, with regard to this question? or why ...bold.ttf and ...italics.ttf files existed ever, and not integrated within the main ttf file at all?

推荐答案

浏览器具有自己的伪粗体和斜体算法,用于在字体不带有其自身的粗体和斜体字体时模拟粗体和斜体.而且,它们并不是唯一带有人造粗体和斜体的应用程序-一些诸如Photoshop之类的图像编辑应用程序也具有它们.

Browsers have their own faux bold and italics algorithms for simulating bold and italics when a typeface doesn't come with its own bold and italics fonts. And they're not the only applications that come with faux bold and italics — some image editing applications like Photoshop have them too.

字体使用其自己的粗体和斜体字体的原因是,变体字形通常对于每种字体都是唯一的,并且无法由浏览器精确模拟.例如,伪斜体算法只是以斜角样式倾斜字形,而不是实际将其斜体化.出于这个原因,即使CSS也将italicoblique都定义为font-style属性的值,尽管实际上

The reason typefaces come with their own bold and italics fonts is because the variant glyphs are often unique to each typeface and cannot be accurately simulated by a browser. For example, faux italics algorithms just skews the glyphs in an oblique style rather than actually italicizing them. Even CSS defines both italic and oblique as values of the font-style property for this reason, though in practice almost no typefaces actually provide both variants anyway.

字体的粗体和斜体变体存储在单独的字体文件中的原因是,这就是一开始设计文件格式的方式. TrueType 确实提供了一种.ttc文件格式,代表TrueType集合,该格式将多种字体组合到一个文件中.但是,由于@font-face规则设计为一次只能使用一种字体,因此.ttc文件不能与它一起使用.

The reason bold and italics variants of a typeface are stored in separate font files is because that's just how the file formats were designed in the beginning. TrueType does provide a .ttc file format, which stands for TrueType Collection, that combines multiple fonts into a single file. But since the @font-face rule was designed for use with one font at a time, .ttc files can't be used with it.

这篇关于网络字体是否需要一起包含BOLD/ITALICS文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆