HTML and CSS Reference
In-Depth Information
no other font descriptors, the browser assumes that all other font prop-
erties (weight, variant, etc.) can be satisfied within this font.
In general, omitting a font descriptor lets the browser match any value
provided for that descriptor. By providing one or more values for a font
descriptor, you are restricting the browser to match only those values in
later font requests. Hence, you should be as specific as possible when
defining a font this way, to better ensure that the browser makes good
matches later. For example, if a font does not contain an italic version
and you fail to tell the browser, it may use an incorrect font when at-
tempting to fulfill a request for an italic style of that font.
8.4.4.3. The src descriptor
The src descriptor in the @font-face at-rule tells the browser where to
retrieve the font. For downloadable fonts, the value of this descriptor is
its document URL, expressed in CSS2 syntax with the url keyword. To
reference locally installed fontsones stored on the user's machinewith
src , use the keyword local rather than url and supply the local name of
the font.
The src descriptor's value may also be a list of locations, separated by
commas. In our previous example, we could have used:
src : url("http://www.kumquat.com/foundry/kumquat-sans"), local("Lucida Sans")
which asks the browser to download and use Kumquat Sans from
www.kumquat.com and, if that fails, to look for a locally installed copy
of Lucida Sans.
You can even provide hints to the browser. CSS2 is decidedly nonpar-
tisan when it comes to the format of the font file. Recognizing that a
number of different font formats exist, the standard lets you use any
format you want, presuming that the browser can make sense of it. To
provide a format hint, use the keyword format followed by one or more
format names, such as:
 
Search WWH ::




Custom Search