T.Todua
T.Todua

Reputation: 56527

Does web-fonts need to have BOLD / ITALICS files together?

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
.....

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?

Upvotes: 1

Views: 1708

Answers (1)

BoltClock
BoltClock

Reputation: 724342

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.

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.

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.

Upvotes: 3

Related Questions