📄 fonts.html
字号:
the term 'sans-serif' to apply to a font for any script, althoughother names may be more familiar for particular scripts, such asGothic (Japanese), Kai (Chinese), or Pathang (Korean). Any font thatis so described may be used to represent the generic 'sans-serif'family.<p>Examples of fonts that fit this description include:</p><table><tr><td>Latin fonts <td>MS Trebuchet, ITC Avant Garde Gothic, MS Arial, MS Verdana, Univers,Futura, ITC Stone Sans, Gill Sans, Akzidenz Grotesk, Helvetica<tr><td>Greek fonts <td>Attika, Typiko New Era, MS Tahoma, Monotype Gill Sans 571, Helvetica Greek<tr><td>Cyrillic fonts <td>Helvetica Cyrillic, ER Univers, Lucida Sans Unicode, Bastion<tr><td>Hebrew fonts <td>Arial Hebrew, MS Tahoma<tr><td>Japanese fonts <td>Shin Go, Heisei Kaku Gothic W5<tr><td>Arabic fonts <td>MS Tahoma</table><h4> <span class="index-def" title="cursive, definition of"><a name="cursive-def"><dfn>cursive</dfn></a></span></h4><p>Glyphs in cursive fonts, as the term is used in CSS, generally haveeither joining strokes or other cursive characteristics beyond thoseof italic typefaces. The glyphs are partially or completelyconnected, and the result looks more like handwritten pen or brushwriting than printed letterwork. Fonts for some scripts, such asArabic, are almost always cursive. CSS uses the term 'cursive' toapply to a font for any script, although other names such as Chancery,Brush, Swing and Script are also used in font names.<p>Examples of fonts that fit this description include:</p><table><tr><td>Latin fonts <td>Caflisch Script, Adobe Poetica, Sanvito, Ex Ponto, Snell Roundhand,Zapf-Chancery<tr><td>Cyrillic fonts <td>ER Architekt<tr><td>Hebrew fonts <td>Corsiva<tr><td>Arabic fonts <td>DecoType Naskh, Monotype Urdu 507</table><h4> <span class="index-def" title="fantasy, definition of"><a name="fantasy-def"><dfn>fantasy</dfn></a></span></h4><p>Fantasy fonts, as used in CSS, are primarily decorative whilestill containing representations of characters (as opposed to Pi orPicture fonts, which do not represent characters). Examples include:</p><table><tr><td>Latin fonts <td>Alpha Geometrique, Critter, Cottonwood, FB Reactor, Studz</table><h4> <span class="index-def" title="monospace, definition of"><a name="monospace-def"><dfn>monospace</dfn></a></span></h4><p>The sole criterion of a monospace font is that all glyphs have the same fixed width. (This can make some scripts,such as Arabic, look most peculiar.) The effect is similar to a manualtypewriter, and is often used to set samples of computer code.<p>Examples of fonts which fit this description include:<table><tr><td>Latin fonts <td>Courier, MS Courier New, Prestige, Everson Mono<tr><td>Greek Fonts <td>MS Courier New, Everson Mono<tr><td>Cyrillic fonts <td>ER Kurier, Everson Mono<tr><td>Japanese fonts <td>Osaka Monospaced<tr><td>Cherokee fonts <td>Everson Mono</table><H2>15.3 <a name="font-selection">Font selection</a></h2><P>The second phase of the CSS2 font mechanism concerns the useragent's selection of a font based on author-specified font properties,available fonts, etc. The details of the <a href="#algorithm">fontmatching algorithm</a> are provided below.<P>There are four possible font selection actions:name matching, intelligent matching, synthesis, and download.</p><dl><dt><a name="x33"><span class="index-def" title="name matching"><dfn><strong>font namematching</strong></dfn></span></a><dd> In this case, the user agent uses anexisting, accessible font that has the same family name as therequested font. (Note that the appearance and the metrics might notnecessarily match, if the font that the document author used and thefont on the client system are from different foundries). The matchinginformation is restricted to the CSS font properties, including thefamily name. This is the only method used by CSS1.<dt><a name="x34"><span class="index-def" title="intelligent font matching"><dfn><strong>intelligent fontmatching</strong></dfn></span></a><dd>In this case, the user agent uses an existing, accessible font that isthe closest match in appearance to the requested font. (Note that themetrics might not match exactly). The matching information includesinformation about the kind of font (text or symbol), nature of serifs,weight, cap height, x height, ascent, descent, slant, etc.<dt><a name="x35"><span class="index-def" title="font synthesis"><dfn><strong>font synthesis</strong></dfn></span></a><dd> In this case, the user agent creates a font that is notonly a close match in appearance, but also matches the metrics of therequested font. The synthesizing information includes the matchinginformation and typically requires more accurate values for theparameters than are used for some matching schemes. In particular,synthesis requires accurate width metrics and character to glyphsubstitution and position information if all the layout characteristics ofthe specified font are to be preserved.<dt><a name="x36"><span class="index-def" title="font download"><dfn><strong>font download</strong></dfn></span></a><dd>Finally, the user agent may retrieve a fontover the Web. This is similar to the process of fetching images,sounds, or applets over the Web for display in the current document,and likewise can cause some delay before the page can be displayed.</DL><p><a name="x37"><span class="index-def" title="progressive rendering"><dfn>Progressiverendering</dfn></span></a> is a combination of download and one of theother methods; it provides a temporary substitute font (using namematching, intelligent matching, or synthesis) to allow content to beread while the requested font downloads. Once the real font has beensuccessfully downloaded, it replaces thetemporary font, hopefully without the need to reflow.<div class="note"><P><em><strong>Note.</strong>Progressive rendering requires metric information about the font inorder to avoid re-layout of the content when the actual font has beenloaded and rendered. This metric information is sufficiently verbosethat it should only be specified at most once per font in a document.</em></div><h3>15.3.1 <span class="index-inst" title="font description"> <aname="font-descriptions">Font Descriptions</a></span> and@font-face</h3><P>The font description provides the bridge between an author's fontspecification and the <a name="x39"><span class="index-def" title="fontdata"><dfn>font data</dfn></span></a>, which is the data needed to formattext and to render the abstract glyphs to which the charactersmap - the actual scalable outlines or bitmaps. Fonts are<em>referenced</em> by style sheet properties.<P>The font description is added to the font database and then used to select the relevant font data. Thefont description contains descriptors such as the location of thefont data on the Web, and characterizations of that font data. The fontdescriptors are also needed to match the style sheet font propertiesto particular font data. The level of detail of a font description canvary from just the name of the font up to a list of glyphwidths. <P>Font descriptors may be classified into three types:</p><ol><li>those that provide the link between the CSS usage of the font andthe font description (these have the same names as the correspondingCSS font properties),<li>the URI for the location of the font data,<li>those that further characterize the font, to provide a link between the font description and the font data.</ol><p>All font descriptions are specified via a <a name="x40"><span class="index-def"title="@font-face"><em>@font-face</em></span></a><a name="x41"><span class="index-inst" title="at-rules">at-rule</span></a>. The general form is:<P><tt>@font-face { <a href="fonts.html#value-def-font-description" class="noxref"><span class="value-inst-font-description"><font-description></span></a> }</tt><p>where the <span class="index-def" title="<font-description>::definition of"><a name="value-def-font-description"><font-description></a></span> has the form:<pre>descriptor: value;descriptor: value;[...]descriptor: value;</pre><p>Each <a name="x43"><span class="index-inst" title="@font-face"> @font-face</span></a>rule specifies a value for every font descriptor, either implicitly orexplicitly. Those not given explicit values in the rule take theinitial value listed with each descriptor in this specification. Thesedescriptors apply solely within the context of the @font-face rule inwhich they are defined, and do not apply to document languageelements. Thus, there is no notion of which elements the descriptorsapply to, or whether the values are inherited by child elements.<P>The available font descriptors are described in later sections ofthis specification.<div class="html-example"><p>For example, here the font 'Robson Celtic' is defined andreferenced in a style sheet contained in an HTML document.<PRE><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"><HTML> <HEAD> <TITLE>Font test</TITLE> <STYLE TYPE="text/css" MEDIA="screen, print"> @font-face { font-family: "Robson Celtic"; src: url("http://site/fonts/rob-celt") } H1 { font-family: "Robson Celtic", serif } </STYLE> </HEAD> <BODY> <H1> This heading is displayed using Robson Celtic</H1> </BODY></HTML></PRE><p>The style sheet (in the STYLE element) contains a CSS rule thatsets all H1 elements to use the 'Robson Celtic' font family.<P>A CSS1 implementation will search the client for a font whosefamily name and other properties match 'Robson Celtic' and, if i
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -