Typography - Getting The Hang Of Typography

(lu) #1

Unicode Range And Language


Unicode Range


The unicode-range property lets you define the range of Unicode


characters supported by a given font, rather than providing the complete
range. This can be useful to restrict support for a wide variety of languages
or mathematical symbols, and thus reduce bandwidth usage.


Imagine that you want to include some Japanese characters on your page.


Using the font-face rule, you can have multiple declarations for the


same font-family, each providing a different font file to download and a
different Unicode range (or even overlapping ranges). The browser should
only download the ranges needed to render that specific page. To see


examples of how unicode-range could work, head over to the spec՚s


draft page.


Language


Use the :lang pseudo-class to create language-sensitive typography.


So, you could have one background color for text set in French (fr) and


another for text set in German (de):


1 div:lang(fr) {

(^2) background-color: blue;
3 }
4
5 div:lang(de) {
(^6) background-color: yellow;
7 }

Free download pdf