![](http://habrastorage.org/getpro/habr/avatars/cc3/97d/54c/cc397d54c2161005908a3034c5fabbea.png)
New typography for the web. Microsoft demonstrates the capabilities of OpenType
Microsoft has published a demo page of advanced typography for the OpenType format. These are alternative glyphs, ligatures, kerning, fractions, small uppercase and minuscule digits . Effects are visible if you hover over the text with the mouse. The demo works well only in browsers with OpenType support, Microsoft itself recommends IE10 + and Firefox 8+. In other browsers, not all effects may appear, it still depends on the operating system. Alternative glyphs and small uppercase We
can agree with Microsoft - OpenType really takes web typography to a new level, close to typographic. The capabilities of this format are clearly superior to @ font-face.
A code snippet is provided for each effect, as implemented in OpenType.
![](https://habrastorage.org/storage2/6b8/b4b/8fe/6b8b4b8fe951a4698ec45ee56f4f9106.png)
![](https://habrastorage.org/storage2/ffb/f4f/d80/ffbf4fd8077a7fd37e053513af1013f4.png)
The code
![](https://habrastorage.org/storage2/8d1/170/ede/8d1170ede346e44da5a982229ef0910b.png)
The code
![](https://habrastorage.org/storage2/8f6/bf5/b5f/8f6bf5b5f29e015e2b93e403fc88c189.png)
The code
The code
![](https://habrastorage.org/storage2/e5d/d4a/77e/e5dd4a77ec5ecf8ae53d3fce72b96375.png)
The code
![](https://habrastorage.org/storage2/115/57f/2c3/11557f2c33971c418d3c675f4a8f1ebc.png)
The code
Microsoft considers OpenType a revolutionary format and expects its widespread support by all browsers. It should be added that OpenType, a format developed by Microsoft and Adobe, is an improved version of the TrueType format, and the validity period of patents for TrueType has recently expired .
![](https://habrastorage.org/storage2/6b8/b4b/8fe/6b8b4b8fe951a4698ec45ee56f4f9106.png)
Small caps
Uppercase text immediately attracts attention, but it looks very poorly surrounded by plain text. In this case, you can use small caps.![](https://habrastorage.org/storage2/ffb/f4f/d80/ffbf4fd8077a7fd37e053513af1013f4.png)
The code
/* use small-caps */
.smallcaps {
-moz-font-feature-settings: "smcp=1";
-ms-font-feature-settings: "smcp" 1;
}
/* both upper and lowercase to small caps */
.allsmallcaps {
-moz-font-feature-settings: "c2sc=1, smcp=1";
-ms-font-feature-settings: "c2sc" 1,"smcp" 1;
}
Ligatures
Ligature - a combination of two or more letters. In typography, they can be used to improve the readability and / or structure of the text, eliminate unnecessary gaps, save space.![](https://habrastorage.org/storage2/8d1/170/ede/8d1170ede346e44da5a982229ef0910b.png)
The code
/* use ligatures automatically */
.ligatures {
text-rendering: optimizeLegibility;
-moz-font-feature-settings: "liga=1";
-ms-font-feature-settings: "liga" 1;
}
Figures
Ordinary mayuskulnye numbers are better suited for tabular typesetting, but minuscules can be used in the text for aesthetic purposes.![](https://habrastorage.org/storage2/8f6/bf5/b5f/8f6bf5b5f29e015e2b93e403fc88c189.png)
The code
/* enable proportional figures and ordinals */
.figures {
-moz-font-feature-settings: "pnum=1,onum=1";
-ms-font-feature-settings: "pnum" 1,"onum" 1;
}
Kerning
Selectively changing the spacing between letters depending on their shape creates a more readable, balanced text.The code
/* enable kerning data */
.kerning {
text-rendering: optimizeLegibility;
-moz-font-feature-settings: "kern=1";
-ms-font-feature-settings: "kern" 1;
}
Fraction
If you enable this option in the code, then all combinations of the "2/3" type will be automatically converted to the correct fraction.![](https://habrastorage.org/storage2/e5d/d4a/77e/e5dd4a77ec5ecf8ae53d3fce72b96375.png)
The code
/* enable OpenType fractions */
.fractions {
-moz-font-feature-settings: "frac=1";
-ms-font-feature-settings: "frac" 1;
}
Alternative glyphs
Additional glyphs can be used in the text in some situations for visual effect.![](https://habrastorage.org/storage2/115/57f/2c3/11557f2c33971c418d3c675f4a8f1ebc.png)
The code
/* enable style set five */
.alternates {
-moz-font-feature-settings: "ss05=1";
-ms-font-feature-settings: "ss05" 1;
}
/* enable contextual and stylistic swashes */
.swashes {
-moz-font-feature-settings: "swsh=1,cswh=1";
-ms-font-feature-settings: "swsh" 1,"cswh" 1;
}
Microsoft considers OpenType a revolutionary format and expects its widespread support by all browsers. It should be added that OpenType, a format developed by Microsoft and Adobe, is an improved version of the TrueType format, and the validity period of patents for TrueType has recently expired .