精图规范1.0----20 字体 Fonts

previous  next   contents   elements   attributes   properties   index  


04 September 2001

20 字体 Fonts



内容 Contents


 

20.1 引言 Introduction

字体的可靠传递是精图的一种需要. 设计者需要使用各种字体创建精图内容并且知道当这些内容由所有最终用户观看时具有相同的图形效果, 即使最终用户的计算机上没有安装这些需要的字体. 这同样适用于打印世界, 当设计者创作一件用于打印的绘画时使用了一种给定的字体, 那么图形内容的打印版与在设计者的创作系统中的呈现完全相同.  Reliable delivery of fonts is a requirement for SVG. Designers need to createSVG content with arbitrary fonts and know that the same graphical result willappear when the content is viewed by all end users, even when end users do nothave the necessary fonts installed on their computers. This parallels the printworld, where the designer uses a given font when authoring a drawing for print,and the graphical content appears exactly the same in the printed version as itappeared on the designer's authoring system.

精图利用在"层叠样式表 (CSS)  2级" 规范 [CSS2] 定义的万维网字体机制 作为将字体数据向最终用户进行可靠传递的一种关键的机制. 在通常的情形下, 精图创作工具会为给定精图文档片段中的所有文本元素生成一个紧缩的子集 万维网字体. 典型地, 此万维网字体存放在相对于引用此字体的文档的地方.  SVGutilizes the WebFontsfacility defined in the "Cascading Style Sheets (CSS) level 2"specification [CSS2] as a keymechanism for reliable delivery of font data to end users. In a commonscenario, SVG authoring applications generate compressed, subsetted WebFonts for all textelements used by a given SVG document fragment. Typically, the WebFonts are saved in alocation relative to the referencing document.

到目前为止万维网字体机制的一个缺点是象 [CSS2]这样的规范并不要求支持特定的字体格式. 其结果是不同的实现支持不同的万维网字体格式, 这就使得网址的构建者为所有用户代理传送一个使用万维网字体的单一的网址变得困难.    One disadvantage to the WebFont facility to dateis that specifications such as [CSS2]do not require support of particular font formats. The result is that differentimplementations support different Web font formats, thereby making it difficultfor Web site creators to post a single Web site using WebFonts that work acrossall user agents.

为了提供一种为所有兼容精图浏览器保证支持的精图的公用字体格式, 精图提供了一种机制定义精图中的字体. 这种字体便被称为 精图字体.  To provide acommon font format for SVG that is guaranteed to be supported by all conformingSVG viewers, SVG provides a facility to define fonts in SVG. This facilityis called SVG fonts.

精图字体可以改进在图形中表示文本的语义丰富性. 例如, 很多公司的标识由公司的名字通过艺术绘制而成. 在某些情况下, 通过将这些标志表示为在一种精图字体下的一系列图元然后作为引用这一字体的'text'文本元素来渲染此标识,可访问性得到增强.  SVG fonts can improve the semantic richness of graphics that represent text.For example, many company logos consist of the company name drawn artistically.In some cases, accessibilitymay be enhanced by expressing the logo as a series of glyphs in an SVG font andthen rendering the logo as a 'text' element which references this font.

20.2 精图字体概观 Overview of SVG fonts

一种 精图字体 是一种通过精图的 'font' 字体元素来定义的字体. An SVG font is a font defined usingSVG's 'font' element.

精图字体的目的是允许在只显示环境中对图元轮廓的传递.伴随网页的精图字体仅在浏览和查看场合必须被支持. 图形编辑应用或文件转换工具不必试图将精图字体转换成系统字体. 目的在于在两个内容创建者之间可以交换精图文件, 而不是交换可以伴随这些精图文件的精图字体. 取而代之, 每个内容创建者将需要在有能力成功编辑此精图文件之前获取给定字体的许可. font-face-name 元素表示将用于编辑的许可字体的名字.     The purpose of SVG fonts is to allow fordelivery of glyph outlines in display-only environments. SVG fonts thataccompany Web pages must be supported only in browsing and viewing situations.Graphics editing applications or file translation tools must not attempt toconvert SVG fonts into system fonts. The intent is that SVG files beinterchangeable between two content creators, but not the SVG fonts that mightaccompany these SVG files. Instead, each content creator will need to licensethe given font before being able to successfully edit the SVG file. The font-face-name element indicates the name oflicensed font to use for editing.

精图字体包含无提示的字体轮廓.因为这, 在很多实现有在小字体尺寸下对文本质量和可辨认性进行考虑的限制. 为了增加在小字体尺寸下质量和可辨认性, 内容创建者也许要使用一种替换字体技术, 象操作系统具有的字体或者一个替换万维网字体格式.   SVG fonts containunhinted font outlines. Because of this, on many implementations there will be limitationsregarding the quality and legibility of text in small font sizes. For increasedquality and legibility in small font sizes, content creators may want to use analternate font technology, such as fonts that ship with operating systems or analternate WebFontformat.

因为精图字体使用精图元素和属性来表示, 在某些情况下精图字体将比在一种不同的万维网字体格式下表示的字体(它们被特别设计用来紧密地表示字体数据)占据更多的空间. 为了网页能够最快地进行传送, 内容创建者也许要使用一种替换字体技术.  Because SVG fonts are expressed using SVG elements and attributes, in somecases the SVG font will take up more space than if the font were expressed in adifferent WebFontformat which was especially designed for compact expression of font data. Forthe fastest delivery of Web pages, content creators may want to use analternate font technology.

精图字体的关键价值在于保证在精图用户代理下的可用性. 在某些情况下, 对于某些文本的渲染将精图字体作为第一选择是合适的. 而在另一些情况下, 精图字体也许是一种替换的备份的字体当首先选择的字体(也许为一种提示的系统字体)对给定的用户不可用时.   A key valueof SVG fonts is guaranteed availability in SVG user agents. In some situations,it might be appropriate for an SVG font to be the first choice for renderingsome text. In other situations, the SVG font might be an alternate, back-upfont in case the first choice font (perhaps a hinted system font) is notavailable to a given user.

精图字体的特征和性质与在"层叠样式表 (CSS)  2级" 规范 [CSS2] 的章节"字体"中描述的字体特征和参数具有相近的对应关系. 在这一模型里, 各种字体度量, 如增量值和基线位置, 以及图元轮廓本身, 都是基于一种单位来表示的此种单位相对于一个抽象的正方形此正方形的高度为在相同类型尺寸的直线间的预期的距离. 这一正方形称之为 em 正方形并且它是用于定义图元轮廓的设计网格. 在 'font' 元素上的units-per-em 属性的值指定此 em 正方形被划分为多少个单位. 对于其它字体类型的公共值是, 例如, 250 (Intellifont), 1000 (Type 1)和 2048(TrueType, TrueType GX 和 Open-Type). 不像精图中的标准图形, 这里初始坐标系的y-轴朝下(参见初始坐标系),精图字体的设计网格, 沿着图元的初始坐标系, 为了与很多流行的为工业实践接受的字体格式的相兼容其y-轴朝上.    Thecharacteristics and attributes of SVG fonts correspond closely to the fontcharacteristics and parameters described in the "Fonts" chapterof the "Cascading Style Sheets (CSS) level 2" specification [CSS2]. In this model, various fontmetrics, such as advance values and baseline locations, and the glyph outlinesthemselves, are expressed in units that are relative to an abstract squarewhose height is the intended distance between lines of type in the same typesize. This square is called the em square and it isthe design grid on which the glyph outlines are defined. The value of the units-per-em attribute on the 'font' element specifies how many units the emsquare is divided into. Common values for other font types are, for example,250 (Intellifont), 1000 (Type 1) and 2048 (TrueType, TrueType GX andOpen-Type). Unlike standard graphics in SVG, where the initial coordinatesystem has the y-axis pointing downward (see Theinitial coordinate system), the design grid for SVG fonts, along with theinitial coordinate system for the glyphs, has the y-axis pointing upward forconsistency with accepted industry practice for many popular font formats.

精图字体和与之相关的图元并不指定边框信息. 因为图元轮廓是作为精图图形元素来表示的, 实现者有渲染图元的两种选择要么使用标准的图形调用要么使用特殊目的的字体渲染技术, 在任何需要最大边框和悬垂的情况下可以根据对包含在图元轮廓中的图形元素的分析进行计算.    SVG fonts and their associated glyphs do notspecify bounding box information. Because the glyph outlines are expressed asSVG graphics elements, the implementation has the option to render the glyphseither using standard graphics calls or by using special-purpose font renderingtechnology, in which case any necessary maximum bounding box and overhang calculationscan be performed from analysis of the graphics elements contained within theglyph outlines.

一种精图字体既可以嵌入使用此字体的同一文档中也可以作为一种外部资源的一部分来存储.  An SVG font can be either embedded within the same documentthat uses the font or saved as part of an external resource.

此处是一个告诉你如何在精图文档内嵌入一种精图字体的例子. Here is an example of how you might embed an SVG font inside of anSVG document.

 
<?xml version="1.0" standalone="yes"?>
<svg width="400px" height="300px"
  xmlns = 'http://www.w3.org/2000/svg'>
  <defs>
    <font id="Font1" horiz-adv-x="1000">
      <font-face font-family="Super Sans" font-weight="bold" font-style="normal"
          units-per-em="1000" cap-height="600" x-height="400"
          ascent="700" descent="300"
          alphabetic="0" mathematical="350" ideographic="400" hanging="500">
        <font-face-src>
          <font-face-name name="Super Sans Bold"/>
        </font-face-src>
      </font-face>
      <missing-glyph><path d="M0,0h200v200h-200z"/></missing-glyph>
      <glyph unicode="!" horiz-adv-x="300"><!-- Outline of exclam. pt. glyph --></glyph>
      <glyph unicode="@"><!-- Outline of @ glyph --></glyph>
      <!-- more glyphs -->
    </font>
  </defs>
  <text x="100" y="100" 
           style="font-family: 'Super Sans', Helvetica, sans-serif;
                  font-weight: bold; font-style: normal">Text 
    using embedded font</text>
</svg>

这里是一个教你如何使用CSS @font-face功能来引用一个存储在外部文件中的精图字体的例子 . 首先是被引用的精图字体文件: Here is an example of how you might use the CSS @font-facefacility to reference an SVG font which is saved in an external file. Firstreferenced SVG font file:

 
<?xml version="1.0" standalone="yes"?>
<svg width="100%" height="100%"
 xmlns = 'http://www.w3.org/2000/svg'>
  <defs>
    <font id="Font2" horiz-adv-x="1000">
      <font-face font-family="Super Sans" font-weight="normal" font-style="italic"
          units-per-em="1000" cap-height="600" x-height="400"
          ascent="700" descent="300"
          alphabetic="0" mathematical="350" ideographic="400" hanging="500">
        <font-face-src>
          <font-face-name name="Super Sans Italic"/>
        </font-face-src>
      </font-face>
      <missing-glyph><path d="M0,0h200v200h-200z"/></missing-glyph>
      <glyph unicode="!" horiz-adv-x="300"><!-- Outline of exclam. pt. glyph --></glyph>
      <glyph unicode="@"><!-- Outline of @ glyph --></glyph>
      <!-- more glyphs -->
    </font>
  </defs>
</svg>

下面为使用/引用上述精图字体的精图文件  The SVG filewhich uses/references the above SVG font

 
<?xml version="1.0" standalone="yes"?>
<svg width="400px" height="300px"
 xmlns = 'http://www.w3.org/2000/svg'>  <defs>
    <style type="text/css">
      <![CDATA[
        @font-face {
          font-family: 'Super Sans'; 
          font-weight: normal;
          font-style: italic;
          src: url("myfont.svg#Font2") format(svg)
        }
      ]]>
   </style>
  </defs>
  <text x="100" y="100"
           style="font-family: 'Super Sans'; font-weight:normal;
                  font-style: italic">Text using embedded font</text>
</svg>

20.3 'font' 字体元素 The 'font' element

  'font' 字体元素定义一种精图字体.  The 'font' element defines an SVG font.

 
<!ENTITY % fontExt "" >
<!ELEMENT font (%descTitleMetadata;,font-face,
                   missing-glyph,(glyph|hkern|vkern %fontExt;)*) >
<!ATTLIST font
  %stdAttrs;
  externalResourcesRequired %Boolean; #IMPLIED
  class %ClassList; #IMPLIED
  style %StyleSheet; #IMPLIED
  %PresentationAttributes-All;
  horiz-origin-x %Number; #IMPLIED
  horiz-origin-y %Number; #IMPLIED
  horiz-adv-x %Number; #REQUIRED
  vert-origin-x %Number; #IMPLIED
  vert-origin-y %Number; #IMPLIED
  vert-adv-y %Number; #IMPLIED >

属性定义:Attributedefinitions:

horiz-origin-x = "<number>"

当沿着文本水平绘制方向所使用图元的原点在字体坐标系中的 X-坐标. (注意此原点用于字体中的所有图元.)  TheX-coordinate in the font coordinate system of the origin of a glyph to be usedwhen drawing horizontally oriented text. (Note that the origin applies to allglyphs in the font.)
如果不指定此属性, 其效果相当于指定其值为"0".   If the attribute is not specified, the effectis as if a value of "0" were specified.
Animatable:no.

horiz-origin-y = "<number>"

当沿着文本水平绘制方向所使用图元的原点在字体坐标系中的 Y -坐标. (注意此原点用于字体中的所有图元.)  TheY-coordinate in the font coordinate system of the origin of a glyph to be usedwhen drawing horizontally oriented text. (Note that the origin applies to allglyphs in the font.)
如果不指定此属性, 其效果相当于指定其值为"0".   If the attribute is not specified, the effectis as if a value of "0" were specified.
Animatable:no.

horiz-adv-x = "<number>"

在水平方向渲染一个图元后缺省的水平增量. 要求图元宽度是非负的, 即使图元的渲染方向是从右到左, 象在希伯来语和阿拉伯的文本中那样.   Thedefault horizontal advance after rendering a glyph in horizontal orientation.Glyph widths are required to be non-negative, even if the glyph is typicallyrendered right-to-left, as in Hebrew and Arabic scripts.
Animatable:no.

vert-origin-x = "<number>"

当沿着文本垂直绘制方向所使用图元的原点在字体坐标系中的 X-坐标.  Thedefault X-coordinate in the font coordinate system of the origin of a glyph tobe used when drawing vertically oriented text.
如果不指定此属性, 其效果相当于指定此属性的值为性质 horiz-adv-x的有效值的一半.If the attribute is not specified, the effect is as if theattribute were set to half of the effective value of attribute.
Animatable:no.

vert-origin-y = "<number>"

当沿着文本垂直绘制方向所使用图元的原点在字体坐标系中的 Y-坐标. Thedefault Y-coordinate in the font coordinate system of the origin of a glyph tobe used when drawing vertically oriented text.
如果不指定此属性, 其效果相当于指定此属性的值为此字体的 ascent 性质所指定的位置.  If the attribute is not specified, the effect is as if theattribute were set to the position specified by the font's ascent attribute.
Animatable:no.

vert-adv-y = "<number>"

在垂直方向渲染一个图元后缺省的垂直增量. The default vertical advance after rendering a glyph in verticalorientation.
如果不指定此属性, 其效果相当于指定此属性的值为一个 em(参见 units-per-em). If the attribute is not specified,the effect is as if a value equivalent of one em were specified (see units-per-em).
Animatable:no.

 

在别处定义的属性:Attributesdefined elsewhere:

%stdAttrs;,externalResourcesRequired,class, style, %PresentationAttributes-All;.

每个 'font' 字体元素必须有一个描述此字体的各种特征的'font-face' 子元素. Each 'font' element must have a 'font-face' child element which describes variouscharacteristics of the font.

20.4 'glyph'  图元元素  The 'glyph' element

'glyph'  图元元素定义一给定图元的图形. 图元的坐标系由 'font' 字体元素的各种性质来定义.   The 'glyph' element definesthe graphics for a given glyph. The coordinate system for the glyph is definedby the various attributes in the 'font' element.

构成 'glyph' 的图形可以为在 d 性质内的单一 路径数据规定或任何精图作为'glyph'内的内容. 这两种二者择一的方式按不同的方式进行处理 (参见下列说明). The graphics that make up the 'glyph' can beeither a single pathdata specification within the d attribute or arbitrary SVG as content within the 'glyph'. These two alternatives are processeddifferently (see below).

 
<!ENTITY % glyphExt "" >
<!ELEMENT glyph (desc|title|metadata|defs|
                   path|text|rect|circle|ellipse|line|polyline|polygon|
                   use|image|svg|g|view|switch|a|altGlyphDef|
                   script|style|symbol|marker|clipPath|mask|
                   linearGradient|radialGradient|pattern|filter|cursor|font|
                   animate|set|animateMotion|animateColor|animateTransform|
                   color-profile|font-face
                   %glyphExt;)* >
<!ATTLIST glyph
  %stdAttrs;
  class %ClassList; #IMPLIED
  style %StyleSheet; #IMPLIED
  %PresentationAttributes-All;
  unicode CDATA #IMPLIED
  glyph-name CDATA #IMPLIED
  d %PathData; #IMPLIED
  orientation CDATA #IMPLIED
  arabic-form CDATA #IMPLIED
  lang %LanguageCodes; #IMPLIED
  horiz-adv-x %Number; #IMPLIED
  vert-origin-x %Number; #IMPLIED
  vert-origin-y %Number; #IMPLIED
  vert-adv-y %Number; #IMPLIED >

属性定义:Attributedefinitions:

unicode = "<string>"

一个或多个统一的字符编码标准 的字符表示对应于这一图元的统一的字符编码标准的字符序列. 如果提供一个字符, 则此图元对应给定的统一的字符编码标准 的字符. 如果提供多个字符, 则此图元对应给定统一的字符编码标准 的字符序列. 字符序列的一种用法是连字. 例如, 如果unicode="ffl", 那么给定的图元将用来渲染字符序列 "f", "f", 和 "l".    One or more Unicode charactersindicating the sequence of Unicode characters which corresponds to this glyph.If a character is provided, then this glyph corresponds to the given Unicodecharacter. If multiple characters are provided, then this glyph corresponds tothe given sequence of Unicode characters. One use of a sequence of charactersis ligatures. For example, if unicode="ffl",then the given glyph will be used to render the sequence of characters"f", "f", and "l".

使用XML字符引用以十六进制记号或十进制记号表示常常是有用的. 例如, unicode="ffl"可以使用 XML字符引用以十六进制记号表示成 unicode="&#x66;&#x66;&#x6c;" 或以 十进制记号表示成unicode="&#102;&#102;&#108;".  It is often useful to refer to characters using XMLcharacter references expressed in hexadecimal notation or decimal notation. Forexample, unicode="ffl" could beexpressed as XML character references in hexadecimal notation as unicode="&#x66;&#x66;&#x6c;" orin decimal notation as unicode="&#102;&#102;&#108;".

unicode 性质专用于对何种图元用于表示何种字符(字符序列)的处理过程. 参见 图元选择规则.如果不为一给定的 'glyph'图元提供unicode 性质, 那么使用这一图元的唯一方法是经由一个 'altGlyph' 引用.    The unicodeattribute contributes to the process for deciding which glyph(s) are used torepresent which character(s). See glyphselection rules. If the unicode attribute is not provided for a given 'glyph', then the only way to use this glyph isvia an 'altGlyph' reference.
Animatable:no.

glyph-name = "<name> [, <name> ]*"

图元的名字. 建议在一种字体中图元名是唯一的. 图元名可以用于当Unicode字符不能提供存取正确的图元的足够信息场合, 比如当每个Unicode字符具有多个图元与之对应时. 图元名能在kerning 定义中引用 .    A name forthe glyph. It is recommended that glyph names be unique within a font. Theglyph names can be used in situations where Unicode character numbers do notprovide sufficient information to access the correct glyph, such as when thereare multiple glyphs per Unicode character. The glyph names can be referenced inkerningdefinitions.
Animatable:no.

d = "path data"

图元的轮廓的定义,  d 性质 与 一个 'path' 路径元素使用相同的语法. 参见 路径数据.The definition ofthe outline of a glyph, using the same syntax as for the d attribute on a 'path' element. See Path data.
参见下述关于这一性质的讨论. See below for a discussion of this attribute.
Animatable:no.

orientation = "h | v"

表示此图元只用于一个特定的内部书写方向 (即, 水平或垂直). 如果不指定此性质, 那么给定的图元可以用在所有方向上 (即, 既可用于水平也可用于垂直内部书写方向).   Indicates that the given glyph is only to be used fora particular inline-progression-direction (i.e., horizontal or vertical). Ifthe attribute is not specified, then the glyph can be used in all cases (i.e.,both horizontal and vertical inline-progression-direction).
Animatable:no.

arabic-form = "initial | medial | terminal |isolated"

对于阿拉伯图元, 表示此图元四种可能形式的哪一种.  For Arabic glyphs, indicates which of the four possibleforms this glyph represents.
Animatable:no.

lang = "%LanguageCodes;"

性质值是一个逗号分隔在 [RFC3066]中定义的语言名称的列表. 如果 xml:lang 性质与在此参数中给定的语言之一完全匹配, 或者如果 xml:lang性质与在此参数中给定的语言之一的前缀完全一致使得跟在此前缀的第一个标记字符为"-"则可使用此图元 .   The attribute value is a comma-separated list oflanguage names as defined in [RFC3066].The glyph can be used if the xml:lang attribute exactly matches one of thelanguages given in the value of this parameter, or if the xml:lang attribute exactly equals a prefix of one ofthe languages given in the value of this parameter such that the first tagcharacter following the prefix is "-".
Animatable:no.

horiz-adv-x = "<number>"

在水平方向渲染一个图元后缺省的水平增量.. 如果不指定此属性, 其效果相当于指定此属性的值为字体的 horiz-adv-x 性质的值.The horizontal advance after rendering the glyph in horizontalorientation. If the attribute is not specified, the effect is as if theattribute were set to the value of the font's horiz-adv-x attribute.
要求图元宽度是非负的, 即使图元的渲染方向是从右到左, 象在希伯来语和阿拉伯的文本中那样.  Glyphwidths are required to be non-negative, even if the glyph is typically renderedright-to-left, as in Hebrew and Arabic scripts.
Animatable:no.

vert-origin-x = "<number>"

当沿着文本垂直绘制方向所使用图元的原点在字体坐标系中的 X-坐标.  TheX-coordinate in the font coordinate system of the origin of the glyph to beused when drawing vertically oriented text.
如果不指定此属性, 其效果相当于指定此属性的值为字体的 vert-origin-x 性质的值.If the attribute is not specified, the effect is as if theattribute were set to the value of the font's vert-origin-x attribute.
Animatable:no.

vert-origin-y = "<number>"

当沿着文本垂直绘制方向所使用图元的原点在字体坐标系中的 Y-坐标. TheY-coordinate in the font coordinate system of the origin of a glyph to be usedwhen drawing vertically oriented text.
如果不指定此属性, 其效果相当于指定此属性的值为字体的vert-origin-y 性质的值.If the attribute is not specified, the effect is as if theattribute were set to the value of the font's vert-origin-y attribute.
Animatable:no.

vert-adv-y = "<number>"

在垂直方向渲染一个图元后缺省的垂直增量. The vertical advance after rendering a glyph in verticalorientation.
如果不指定此属性, 其效果相当于指定此属性的值为字体的  vert-adv-y  性质的值.If the attribute is not specified, the effect is as if theattribute were set to the value of the font's vert-adv-y attribute.
Animatable:no.

 

在别处定义的属性:Attributesdefined elsewhere:

%stdAttrs;,style, class, %PresentationAttributes-All;.

'glyph' 的图形可以要么由d 性质或 'glyph'内的任意精图作为其内容来指定.   Thegraphics for the 'glyph' can be specified usingeither the d attribute or arbitrary SVG as content within the 'glyph'.

如果指定 d 性质, 那么在此性质的路径数据按如下方式进行处理:   If the d attribute is specified, then the path data withinthis attribute is processed as follows:

  • 任何在路径数据中指定的相对坐标将被转换成等价的绝对坐标  Any relative coordinates within the path data specification are converted into equivalent absolute coordinates
  • 这些绝对坐标从字体坐标系转换成'text' 元素的当前坐标系使得字体坐标系的原点被适当地安放和旋转到当前文本位置与和图元的方向排成一行, 并且缩放使得达到正确的 'font-size' .   Each of these absolute coordinates is transformed from the font coordinate system into the 'text' element's current coordinate system such that the origin of the font coordinate system is properly positioned and rotated to align with the current text position and orientation for the glyph, and scaled so that the correct 'font-size' is achieved.
  • 其结果, 被转换的路径说明被渲染好像它是一个'path'元素, 使用应用于对应于此给定图元的字符的样式属性, 并忽略在 'font' 元素或'glyph' 元素中指定的任何样式属性.     The resulting, transformed path specification is rendered as if it were a 'path' element, using the styling properties that apply to the characters which correspond to the given glyph, and ignoring any styling properties specified on the 'font' element or the 'glyph' element.

如果'glyph' 有子元素, 那么那些子元素按照'use' 元素渲染一个引用符号的类似方式进行渲染. 其渲染效果好像引用的 'glyph' 元素的内容被深深复制到一个分开的隐式DOM树. 因为复制的DOM树是隐式的, 故精图DOM 不显示此复制的实例.   If the 'glyph' has child elements, then those child elementsare rendered in a manner similar to how the 'use' element renders a referenced symbol. Therendering effect is as if the contents of the referenced 'glyph' element were deeply cloned into a separatenon-exposed DOM tree. Because the cloned DOM tree is non-exposed, the SVG DOMdoes not show the cloned instance.

对于支持使用CSS进行格式化 的用户代理 , 引用'glyph' 元素的概念上深度复制到一个隐式的 DOM 树也复制任何属性值来自在引用的 'glyph' 和它的内容上的CSS 层叠  [CSS2-CASCADE] , 并且也应用于在 'font' 元素上的任何属性值. CSS2 选择子可以用于原来的 (即, 被引用的)元素因为它们是正式文档结构的一部分. CSS2 选择子不能用于(概念上来说)复制的DOM树因为它的内容不是正式文档结构的一部分.   For user agents that support Styling withCSS, the conceptual deep cloning of the referenced 'glyph' element into a non-exposed DOM tree alsocopies any property values resulting from the CSS cascade [CSS2-CASCADE] on thereferenced 'glyph' and its contents, and also appliesany property values on the 'font' element. CSS2 selectors can be applied tothe original (i.e., referenced) elements because they are part of the formaldocument structure. CSS2 selectors cannot be applied to the (conceptually)cloned DOM tree because its contents are not part of the formal documentstructure.

属性继承, 无论如何, 起作用好像被引用的'glyph'以文本的方式作为深度复制的子元素被包含在文档树中. 被引用的'glyph'从包含对应于此 'glyph'的字符或字符序列的元素中继承属性. 此 'glyph' 不从 'font' 元素的原来上级上继承属性.  Property inheritance, however, works as if the referenced 'glyph' had been textually included as a deeplycloned child within the document tree. The referenced 'glyph'inherits properties from the element that contains the characters thatcorrespond to the 'glyph'. The 'glyph' does not inherit properties from the 'font' element's original parents.

在生成的内容中, 对于给定的 'glyph'的每一实例, 一个 'g' 元素被创建它携带了来自在此被引用'glyph'的 'font' 元素上的 CSS 层叠 [CSS2-CASCADE]的属性值. 在此'g' 元素内部是另一个'g' 元素它携带了来自在此'glyph' 元素上的 CSS 层叠 [CSS2-CASCADE]的属性值. 此'glyph' 元素的原先的内容被深度复制到较里面的'g' 元素中.    In the generated content, for each instance of agiven 'glyph', a 'g' is created which carries with it all propertyvalues resulting from the CSS cascade [CSS2-CASCADE] on the 'font' element for the referenced 'glyph'. Within this 'g' is another 'g' which carries with it all property valuesresulting from the CSS cascade [CSS2-CASCADE] on the 'glyph' element. The original contents of the 'glyph' element are deep-cloned within the inner 'g' element.

如果此 'glyph' 既有 d 性质又有子元素, 则先渲染 d 性质, 然后渲染子元素.  If the 'glyph' has both a d attribute and child elements, the d attribute is rendered first, and then the childelements.

一般来说, 此 d 性质按照系统字体相同的方式进行渲染. 例如, 一个破折号的样子通常看起来是相同的不管使用系统字体还是用 d 性质来定义其图元的精图字体. 很多实现可以较快地渲染由 d性质定义的图元并且可以通过字体缓存得到性能的进一步提升.    In general, the d attribute renders in the same manner as systemfonts. For example, a dashed pattern will usually look the same if applied to asystem font or to an SVG font which defines its glyphs using the d attribute. Many implementations will be able torender glyphs defined with the d attribute quickly and will be able to use a fontcache for further performance gains.

通过在'glyph' 内包含子元素来定义一个图元会得到较大的灵活性然而却更复杂. 不同的填充和描边技术可以用于图元的不同部分. 例如, 一个 "i" 的下部可以为红色, 而点可以为蓝色. 这种方法有一种固有的单位复杂性. 在一个文本元素中指定的任何表示长度的属性, 如 'stroke-width' 属性, 可以产生意想不到的效果这是因为长度值将在图元的坐标系中进行处理.   Defining a glyph by including child elements withinthe 'glyph' gives greater flexibility but morecomplexity. Different fill and stroke techniques can be used on different partsof the glyphs. For example, the base of an "i" could be red, and thedot could be blue. This approach has an inherent complexity with units. Anyproperties specified on a text elements which represents a length, such as the 'stroke-width' property, might produce surprisingresults since the length value will be processed in the coordinate system ofthe glyph.

20.5'missing-glyph' 元素  The 'missing-glyph' element

'missing-glyph' 元素定义用于这种场合的图形当从给定的字体中企图绘制一个未被定义的图元就用此图元绘制之. 在 'missing-glyph' 元素上的性质与 'glyph' 元素上对应的性质具有相同的意义.    The 'missing-glyph'element defines the graphics to use if there is an attempt to draw a glyph froma given font and the given glyph has not been defined. The attributes on the 'missing-glyph' element have the same meaning as thecorresponding attributes on the 'glyph' element.

 
<!ENTITY % missing-glyphExt "" >
<!ELEMENT missing-glyph (desc|title|metadata|defs|
                   path|text|rect|circle|ellipse|line|polyline|polygon|
                   use|image|svg|g|view|switch|a|altGlyphDef|
                   script|style|symbol|marker|clipPath|mask|
                   linearGradient|radialGradient|pattern|filter|cursor|font|
                   animate|set|animateMotion|animateColor|animateTransform|
                   color-profile|font-face
                   %missing-glyphExt;)* >
<!ATTLIST missing-glyph
  %stdAttrs;
  class %ClassList; #IMPLIED
  style %StyleSheet; #IMPLIED
  %PresentationAttributes-All;
  d %PathData; #IMPLIED
  horiz-adv-x %Number; #IMPLIED
  vert-origin-x %Number; #IMPLIED
  vert-origin-y %Number; #IMPLIED
  vert-adv-y %Number; #IMPLIED >

在别处定义的属性:Attributesdefined elsewhere:

%stdAttrs;,class, style, %PresentationAttributes-All;,d,horiz-adv-x,vert-origin-x,vert-origin-y,vert-adv-y.

20.6图元选择规则 Glyphselection rules

当确定用于绘制给定字符序列的图元时,  从'font' 元素的第一个'glyph' 元素到最后一个按照逻辑次序进行查找看准备用于渲染Unicode字符的预定序列是否与给定的'glyph'元素的unicode性质所指定的Unicode字符序列匹配. 第一个成功匹配的被使用. 于是, 连字 "ffl" 需要在字体中在 "f" 图元之前被定义; 否则, "ffl" 将决不被选中.   When determining the glyph(s) to draw a given character sequence, the 'font' element is searched from its first 'glyph' element to its last in logical order tosee if the upcoming sequence of Unicode characters to be rendered matches thesequence of Unicode characters specified in the unicode attribute for the given 'glyph' element. The first successful match isused. Thus, the "ffl" ligature needs to be defined in the font beforethe "f" glyph; otherwise, the "ffl" will never be selected.

注意'altGlyph' 的任何出现优先于在一个精图字体内的图元选择规则.   Note that any occurrences of 'altGlyph' take precedence over the above glyphselection rules within an SVG font.

20.7 The 'hkern' and 'vkern'elements

'hkern' 和 'vkern' 元素分别定义图元对的水平方向的字间距调整量和垂直方向的字间距调整量.   The 'hkern' and 'vkern'elements define kerning pairs for horizontally-oriented and vertically-orientedpairs of glyphs, respectively.

紧排偶与当图元偶几乎相互被渲染时其图元间距被调整的在单一字体内的图元偶一致.另外要求图元偶来自同一字体,只有当两个图元对应字符的属性 'font-family', 'font-size', 'font-style', 'font-weight', 'font-variant', 'font-stretch', 'font-size-adjust''font'具有相同的值时精图字体紧排才会发生.   Kern pairs identify pairs of glyphs within a singlefont whose inter-glyph spacing is adjusted when the pair of glyphs are renderednext to each other. In addition to the requirement that the pair of glyphs arefrom the same font, SVG font kerning happens only when the two glyphscorrespond to characters which have the same values for properties 'font-family', 'font-size', 'font-style', 'font-weight', 'font-variant', 'font-stretch', 'font-size-adjust' and 'font'.

紧排偶的一个例子是字母"Va", 这里如果字母"V"和"a"按照稍微靠近一点进行渲染所得到的排字效果看起来会更好.  Anexample of a kerning pair are the letters "Va", where the typographicresult might look better if the letters "V" and the "a"were rendered slightly closer together.

精图中的从右到左和双向文本分成两步进行处理, 这在与双向性的关系中描述. 如果使用精图字体, 在进行紧排之前, 字符被重新调整顺序变成从左到右 (或者从上到下, 对于垂直文本而言) 视觉渲染顺序. 精图字体的紧排然后用于被一起渲染的图元偶. 紧排偶的第一个图元就视觉渲染顺序而言为左边的(或者为上边的) 图元. 在紧排偶的第二个图元是此对偶的右边的(或者下边的)图元.   Right-to-left andbidirectional text in SVG is laid out in a two-step process, which is describedin Relationshipwith bidirectionality. If SVG fonts are used, before kerning is applied,characters are re-ordered into left-to-right (or top-to-bottom, for verticaltext) visual rendering order. Kerning from SVG fonts is then applied on pairsof glyphs which are rendered contiguously. The first glyph in the kerning pairis the left (or top) glyph in visual rendering order. The second glyph in thekerning pair is the right (or bottom) glyph in the pair.

为了方便字体设计者和减少文件的尺寸, 一个单一的 'hkern' 和 'vkern' 能够定义一个在一套图元 (例如, 某个范围的 Unicode 字符)和另一套图元(例如, 另一个范围的 Unicode 字符)之间单一的紧排调整值. For convenience to font designers and to minimize file sizes, a single 'hkern' and 'vkern'can define a single kerning adjustment value between one set of glyphs (e.g., arange of Unicode characters) and another set of glyphs (e.g., another range ofUnicode characters).

'hkern' 元素定义紧排偶和在水平前进方向上的调整值当绘制一对图元而它们是连续的并且都进行水平方向的渲染 (即, 并排). 字符之间的间隙按照紧排调整来减少. (负的紧排调整增加字符间的间隙.)   The 'hkern' element defineskerning pairs and adjustment values in the horizontal advance value whendrawing pairs of glyphs which the two glyphs are contiguous and are bothrendered horizontally (i.e., side-by-side). The spacing between characters isreduced by the kerning adjustment. (Negative kerning adjustments increase thespacing between characters.)

 
<!ELEMENT hkern EMPTY >
<!ATTLIST hkern
  %stdAttrs;
  u1 CDATA #IMPLIED
  g1 CDATA #IMPLIED
  u2 CDATA #IMPLIED
  g2 CDATA #IMPLIED
  k %Number; #REQUIRED >

属性定义:Attributedefinitions:

u1 = "[<character> | <urange> ] [, [<character> |<urange>] ]* "

Unicode字符(逗号分隔的)序列 (参见refer to the description of the unicode attribute to the 'glyph' element for a description of how toexpress individual Unicode characters) and/or ranges of Unicode characters (seedescription of ranges of Unicode characters in [CSS2]) which identify a set ofpossible first glyphs in the kerning pair. If a given Unicode character withinthe set has multiple corresponding 'glyph' elements (i.e., there are multiple 'glyph' elements with the same unicode attribute value, but different glyphName values), then all such glyphs are includedin the set. Comma is the separator character; thus, to kern a comma, specifythe comma as part of a range of Unicode characters or as a glyph name using theg1 attribute. The total set of possible first glyphsin the kerning pair is the union of glyphs specified by the u1 g1 性质.    A sequence (comma-separated) of Unicodecharacters (refer to the description of the unicode attribute to the 'glyph' element for a description of how toexpress individual Unicode characters) and/or ranges of Unicode characters (seedescription of ranges of Unicode characters in [CSS2]) which identify a set ofpossible first glyphs in the kerning pair. If a given Unicode character withinthe set has multiple corresponding 'glyph' elements (i.e., there are multiple 'glyph' elements with the same unicode attribute value, but different glyphName values), then all such glyphs are includedin the set. Comma is the separator character; thus, to kern a comma, specifythe comma as part of a range of Unicode characters or as a glyph name using theg1 attribute. The total set of possible first glyphsin the kerning pair is the union of glyphs specified by the u1 and g1 attributes.
Animatable:no.

g1 = "<name> [, <name> ]* "

图元名的(逗号分隔的)序列 (即, 其值与 'glyph' 元素上的glyphName 性质相匹配) 它指定一套在紧排偶中的可能的第一图元. 具有给定图元名的所有图元被包含在这一套图元中. 在紧排偶中的可能的第一图元的全部集合是由 u1g1性质指定图元的并.   A sequence (comma-separated) of glyph names (i.e.,values that match glyphName attributes on 'glyph' elements) which identify a set ofpossible first glyphs in the kerning pair. All glyphs with the given glyph nameare included in the set. The total set of possible first glyphs in the kerningpair is the union of glyphs specified by the u1 and g1 attributes.
Animatable:no.

u2 = "[<number> | <urange>] [, [<number> |<urange>] ]* "

u1 性质相同, 除了 u2 指定在紧排偶中可能的第二个图元.   Same as the u1 attribute, except that u2 specifies possible second glyphs in the kerningpair.
Animatable:no.

g2 = "<name> [, <name> ]* "

g1  性质相同, 除了 g2 指定在紧排偶中可能的第二个图元.   Same as the g1 attribute, except that g2 specifies possible second glyphs in the kerningpair.
Animatable:no.

k = "<number>"

在紧排偶中的两个图元间减少间距的数量. 其值按字体坐标系计算.  The amount to decrease the spacing between the two glyphs in the kerning pair.The value is in the font coordinate system.
如果不指定此性质, 其效果相当于指定其值为 "0".   If the attribute is not specified, the effect is as if a value of"0" were specified.
Animatable:no.

 

在别处定义的属性:Attributesdefined elsewhere:

%stdAttrs;.

必须提供 u1 或g1 中至少一个以及 u2 或 g2 中至少一个.   At least one each of u1 or g1 and at least oneof u2 or g2 must beprovided.

'vkern'  元素定义紧排偶和在垂直前进方向上的调整值当绘制一对图元而它们是连续的并且都进行垂直方向的渲染. 字符之间的间隙按照紧排调整来减少.  The 'vkern' element defineskerning pairs and adjustment values in the vertical advance value when drawingpairs of glyphs together when stacked vertically. The spacing betweencharacters is reduced by the kerning adjustment.

 
<!ELEMENT vkern EMPTY >
<!ATTLIST vkern
  %stdAttrs;
  u1 CDATA #IMPLIED
  g1 CDATA #IMPLIED
  u2 CDATA #IMPLIED
  g2 CDATA #IMPLIED
  k %Number; #REQUIRED >

在别处定义的属性:Attributesdefined elsewhere:

%stdAttrs;,u1,g1,u2,g2,k.



20.8 描写一个字体 Describing a font



20.8.1 字体描写概述 Overview of font descriptions

一种字体描写提供一个作者的字体说明和字体数据之间的桥梁, 这些数据用于格式化文本并且将抽象图元渲染成字符映射表中规定的 - 实际的可缩放轮廓或者位图. 字体由属性所引用, 比如 'font-family' 属性.   A font description provides the bridge between anauthor's font specification and the font data, which is the data needed toformat text and to render the abstract glyphs to which the characters map - theactual scalable outlines or bitmaps. Fonts are referenced by properties, suchas the 'font-family' property.

每一特定的字体描写被加入到字库中这样可用于选择相关的字体数据. 字体描写包括描述子如字体数据在环球网上的位置, 和字体数据的描述. 字体描述子需要将字体属性与特别的字体数据相匹配. 一个字体描写的详细程度可以从仅给出字体的名字到一个图元宽度的列表之间变化.   Each specified font description is added to the font database and so that itcan be used to select the relevant font data. The font description containsdescriptors such as the location of the font data on the Web, andcharacterizations of that font data. The font descriptors are also needed tomatch the font properties to particular font data. The level of detail of afont description can vary from just the name of the font up to a list of glyphwidths.

关于更多的字体描写的信息, 参见在CSS2规范 [CSS2 Fonts]中有关字体的章节.   For more aboutfont descriptions, refer to the font chapter in the CSS2 specification [CSS2 Fonts].



20.8.2 提供字体描述的可互换的方法 Alternative ways for providing a font description

字体描写可以由下列两种方法来指定:   Font descriptions can be specified in either of thefollowing ways:

  • 一个 'font-face' 元素  a 'font-face' element
  • 一个CSS样式表中的 @font-face 规则 (仅用于支持使用CSS格式化精图内容的用户代理)   an @font-face rule within a CSS style sheet (only applicable for user agents which support using CSS to style the SVG content)



20.8.3 The 'font-face'element

'font-face' 元素直接对应于CSS2中的 @font-face功能. 它可以用来描述任何字体的特征, 不管是精图字体还是其它字体.    The 'font-face' element corresponds directly tothe @font-facefacility in CSS2. It can be used to describe the characteristics of any font,SVG font or otherwise.

当用于描述精图字体特征包含在相同的文档中时, 建议 'font-face' 元素作为它所描述的'font' 元素的子元素这样便可以使得'font' 元素能够自包含并且得到充分的描述. 在这种情况下, 任何在 'font-face' 元素内的 'font-face-src' 元素被忽略因为假设'font-face' 元素描述它的上级'font'元素的特征.    When used to describe the characteristics of anSVG font contained within the same document, it is recommended that the 'font-face' element be a child of the 'font' element it is describing so that the 'font' element can be self-contained andfully-described. In this case, any 'font-face-src' elements within the 'font-face' element are ignored as it is assumed thatthe 'font-face' element is describing thecharacteristics of its parent 'font' element.

 
<!ELEMENT font-face (%descTitleMetadata;,font-face-src?,definition-src?) >
<!ATTLIST font-face 
  %stdAttrs;
  font-family CDATA #IMPLIED
  font-style CDATA #IMPLIED
  font-variant CDATA #IMPLIED
  font-weight CDATA #IMPLIED
  font-stretch CDATA #IMPLIED
  font-size CDATA #IMPLIED
  unicode-range CDATA #IMPLIED
  units-per-em %Number; #IMPLIED
  panose-1 CDATA #IMPLIED
  stemv %Number; #IMPLIED
  stemh %Number; #IMPLIED
  slope %Number; #IMPLIED
  cap-height %Number; #IMPLIED
  x-height %Number; #IMPLIED
  accent-height %Number; #IMPLIED
  ascent %Number; #IMPLIED
  descent %Number; #IMPLIED
  widths CDATA #IMPLIED
  bbox CDATA #IMPLIED
  ideographic %Number; #IMPLIED
  alphabetic %Number; #IMPLIED
  mathematical %Number; #IMPLIED
  hanging %Number; #IMPLIED
  v-ideographic %Number; #IMPLIED
  v-alphabetic %Number; #IMPLIED
  v-mathematical %Number; #IMPLIED
  v-hanging %Number; #IMPLIED
  underline-position %Number; #IMPLIED
  underline-thickness %Number; #IMPLIED
  strikethrough-position %Number; #IMPLIED
  strikethrough-thickness %Number; #IMPLIED
  overline-position %Number; #IMPLIED
  overline-thickness %Number; #IMPLIED >

属性定义:Attributedefinitions:

font-family = "<string>"

和在一个@font-face规则内的 'font-family' 描述子具有相同的语法和语义. Same syntax and semantics as the 'font-family' descriptor within an @font-facerule.
Animatable:no.

font-style = "all | [ normal | italic | oblique][, [normal | italic | oblique]]*"

和在一个@font-face规则内的 'font-style' 描述子具有相同的语法和语义.字形. 除了一个逗号分隔的列表被允许外,取和 'font-style'属性相同的值 .   Same syntax andsemantics as the 'font-style' descriptor within an @font-facerule. The style of a font. Takes on the same values as the 'font-style'property, except that a comma-separated list is permitted.
如果不指定此性质, 其效果相当于其值为"all".   Ifthe attribute is not specified, the effect is as if a value of "all"were specified.
Animatable:no.

font-variant = "[normal | small-caps] [,[normal |small-caps]]*"

和在一个@font-face规则内的 'font-variant'  描述子具有相同的语法和语义.表示是否为字体的小写变体. 除了一个逗号分隔的列表被允许外,取和 'font-variant' 属性相同的值.    Same syntax and semantics as the 'font-variant' descriptor within an @font-facerule. Indication of whether this face is the small-caps variant of a font.Takes on the same values as the 'font-variant'property, except that a comma-separated list is permitted.
如果不指定此性质, 其效果相当于其值为"normal". Ifthe attribute is not specified, the effect is as if a value of"normal" were specified.
Animatable:no.

font-weight = "all | [normal | bold |100 | 200 |300 | 400 | 500 | 600 | 700 | 800 | 900] [, [normal | bold |100 | 200 | 300 |400 | 500 | 600 | 700 | 800 | 900]]*"

和在一个@font-face规则内的 'font-weight' 描述子具有相同的语法和语义.Same syntax and semantics as the 'font-weight' descriptor within an @font-facerule.
在相同字体簇中相对的字体粗细.除了下列三个例外与 'font-weight'属性取相同的值:  The weight of a facerelative to others in the same font family. Takes on the same values as the 'font-weight'property with three exceptions:

·  不允许相对关键词 (较粗, 较细)     relativekeywords (bolder, lighter) are not permitted

·  一个逗号分隔的列表被允许, 字体包含多个粗细 a comma-separated list of values is permitted, for fonts that contain multipleweights

·  一个追加的关键词, 'all', 被允许, 这意味着字体将匹配所有可能的粗细; 要么因为它包含多个粗细, 要么因为此字体仅有一种粗细.   anadditional keyword, 'all', is permitted, which means that the font will matchfor all possible weights; either because it contains multiple weights, or becausethat face only has a single weight.

如果不指定此性质, 其效果相当于其值为"all". Ifthe attribute is not specified, the effect is as if a value of "all"were specified.
Animatable:no.

font-stretch = "all | [ normal | ultra-condensed |extra-condensed | condensed | semi-condensed | semi-expanded | expanded |extra-expanded | ultra-expanded] [, [ normal | ultra-condensed |extra-condensed | condensed | semi-condensed | semi-expanded | expanded |extra-expanded | ultra-expanded] ]*"

和在一个@font-face规则内的 'font-stretch'  描述子具有相同的语法和语义.表示在相同字体簇中相对的变窄和变宽. 除了下列例外与 'font-stretch'属性取相同的值:   Same syntax and semantics as the 'font-stretch' descriptor within an @font-facerule. Indication of the condensed or expanded nature of the face relative toothers in the same font family. Takes on the same values as the 'font-stretch'property except that:

·  不允许相对关键词 (较宽, 较窄)    relativekeywords (wider, narrower) are not permitted

·  一个逗号分隔的列表被允许  a comma-separated list is permitted

·  一个 关键词 'all'被允许  the keyword 'all' ispermitted

如果不指定此性质, 其效果相当于其值为"normal". Ifthe attribute is not specified, the effect is as if a value of"normal" were specified.
Animatable:no.

font-size = "<string>"

和在一个@font-face规则内的 'font-size' 描述子具有相同的语法和语义.Same syntax and semantics as the 'font-size' descriptor within an @font-facerule.
Animatable:no.

unicode-range = "<urange> [, <urange>]*"

和在一个@font-face规则内的 'unicode-range'  描述子具有相同的语法和语义. ISO 10646 个字符[UNICODE]的范围  可能被此字体中的图元所覆盖. 除了在此规范中提到的任何附加信息外, 此性质的正式定义在 [CSS2] 中.    Same syntax and semantics as the 'unicode-range' descriptor within an @font-facerule. The range of ISO 10646 characters [UNICODE] possiblycovered by the glyphs in the font. Except for any additional informationprovided in this specification, the normative definition of the attribute is in[CSS2].
如果不指定此性质, 其效果相当于其值为"U+0-10FFFF". Ifthe attribute is not specified, the effect is as if a value of"U+0-10FFFF" were specified.
Animatable:no.

units-per-em = "<number>"

和在一个@font-face规则内的 'units-per-em' 描述子具有相同的语法和语义.在 em 正方形上坐标单位的数目, 用于安置图元的设计网格的尺寸.   Samesyntax and semantics as the 'units-per-em' descriptor within an @font-facerule. The number of coordinate units on the em square, the size of the designgrid on which glyphs are laid out.
当几乎每一个其它性质要求一个设计网格时此值几乎总是需要的.    This value is almost always necessary as nearlyevery other attribute requires the definition of a design grid.
如果不指定此性质, 其效果相当于其值为"1000". Ifthe attribute is not specified, the effect is as if a value of "1000"were specified.
Animatable:no.

panose-1 = "[<integer>]{10}"

和在一个@font-face规则内的 'panose-1' 描述子具有相同的语法和语义.此 Panose-1 数值, 由一组十进制整数构成, 它们由空格所分隔. 除了在此规范中提到的任何附加信息外, 此性质的正式定义在 [CSS2] 中.    Same syntax and semantics as the 'panose-1' descriptor within an @font-facerule. The Panose-1 number, consisting of ten decimal integers, separated bywhitespace. Except for any additional information provided in thisspecification, the normative definition of the attribute is in [CSS2].
如果不指定此性质, 其效果相当于其值为"0 0 0 0 0 0 0 0 00". If the attribute is not specified, the effect is as if a value of"0 0 0 0 0 0 0 0 0 0" were specified.
Animatable:no.

stemv = "<number>"

和在一个@font-face规则内的 'stemv' 描述子具有相同的语法和语义.Same syntax and semantics as the 'stemv' descriptor within an @font-facerule.
Animatable:no.

stemh = "<number>"

和在一个@font-face规则内的 'stemh' 描述子具有相同的语法和语义.Same syntax and semantics as the 'stemh' descriptor within an @font-facerule.
Animatable:no.

slope = "<number>"

和在一个@font-face规则内的 'slope' 描述子具有相同的语法和语义.此字体的垂直描边角度. 除了在此规范中提到的任何附加信息外, 此性质的正式定义在 [CSS2] 中. Same syntax and semantics as the 'slope' descriptor within an @font-facerule. The vertical stroke angle of the font. Except for any additionalinformation provided in this specification, the normative definition of theattribute is in [CSS2].
如果不指定此性质, 其效果相当于其值为"0". If theattribute is not specified, the effect is as if a value of "0" werespecified.
Animatable:no.

cap-height = "<number>"

和在一个@font-face规则内的 'cap-height'  描述子具有相同的语法和语义.此字体中的大写图元在字体坐标系内的高度.  Same syntax and semantics as the 'cap-height' descriptor within an @font-facerule. The height of uppercase glyphs in the font within the font coordinatesystem.
Animatable:no.

x-height = "<number>"

和在一个@font-face规则内的 'x-height' 描述子具有相同的语法和语义.此字体中的小写图元在字体坐标系内的高度. Same syntax and semantics as the 'x-height' descriptor within an @font-facerule. The height of lowercase glyphs in the font within the font coordinatesystem.
Animatable:no.

accent-height = "<number>"

从原点到重音字符的顶部的距离, 此距离按字符坐标系的距离进行测量.   The distance from the origin to the top of accentcharacters, measured by a distance within the font coordinate system.
如果不指定此性质, 其效果相当于其值为 ascent 性质的值. 如果指定此性质, 也必须指定units-per-em 性质.  If the attribute is not specified, the effect is as if theattribute were set to the value of the ascent attribute. If this attribute is used, the units-per-em attribute must also be specified.
Animatable:no.

ascent = "<number>"

和在一个@font-face规则内的 'ascent' 描述子具有相同的语法和语义.在字符坐标系中此字体最大的无重音的高度.Same syntax and semantics as the 'ascent' descriptor within an @font-facerule. The maximum unaccented height of the font within the font coordinatesystem.
如果不指定此性质, 其效果相当于相应的字体的units-per-em值和vert-origin-y 值之间的差值.If the attribute is not specified, the effect is as if theattribute were set to the difference between the units-per-em value and the vert-origin-y value for the corresponding font.
Animatable:no.

descent = "<number>"

和在一个@font-face规则内的 'descent' 描述子具有相同的语法和语义.在字符坐标系中此字体最大的无重音的深度.   Same syntax and semantics as the 'descent' descriptor within an @font-facerule. The maximum unaccented depth of the font within the font coordinatesystem.
如果不指定此性质, 其效果相当于其值为 vert-origin-y  性质的值. If the attribute is not specified, the effect is as if theattribute were set to the vert-origin-y value for the corresponding font.
Animatable:no.

widths = "<string>"

和在一个@font-face规则内的 'widths' 描述子具有相同的语法和语义.Same syntax and semantics as the 'widths' descriptor within an @font-facerule.
Animatable:no.

bbox = "<string>"

和在一个@font-face规则内的 'bbox' 描述子具有相同的语法和语义.Same syntax andsemantics as the 'bbox' descriptor within an @font-facerule.
Animatable:no.

ideographic = "<number>"

对于水平方向的图元布局, 表示图元的对齐坐标以到达表意字对齐基线. 此值为字体坐标系中的偏移量.如果提供此性质, 则必须指定 units-per-em 性质.   For horizontally oriented glyph layouts, indicates thealignment coordinate for glyphs to achieve ideographic baseline alignment. Thevalue is an offset in the font coordinate system. If this attribute isprovided, the units-per-em attribute must also be specified.
Animatable:no.

alphabetic = "<number>"

和在一个@font-face规则内的 'baseline' 描述子具有相同的语法和语义.对于水平方向的图元布局, 表示图元的对齐坐标以到达字母对齐基线. 此值为字体坐标系中的偏移量. 如果提供此性质, 则必须指定 units-per-em 性质.   Same syntax and semantics as the 'baseline' descriptor within an @font-facerule. For horizontally oriented glyph layouts, indicates the alignmentcoordinate for glyphs to achieve alphabetic baseline alignment. The value is anoffset in the font coordinate system. If this attribute is provided, the units-per-em attribute must also be specified.
Animatable:no.

mathematical = "<number>"

和在一个@font-face规则内的  'mathline' 描述子具有相同的语法和语义.对于水平方向的图元布局, 表示图元的对齐坐标以到达数学对齐基线. 此值为字体坐标系中的偏移量. 如果提供此性质, 则必须指定 units-per-em 性质.  Same syntax and semantics as the 'mathline' descriptor within an @font-facerule. For horizontally oriented glyph layouts, indicates the alignmentcoordinate for glyphs to achieve mathematical baseline alignment. The value isan offset in the font coordinate system. If this attribute is provided, the units-per-em attribute must also be specified.
Animatable:no.

hanging = "<number>"

对于水平方向的图元布局, 表示图元的对齐坐标以到达悬空对齐基线. 此值为字体坐标系中的偏移量. 如果提供此性质, 则必须指定 units-per-em 性质.  For horizontally oriented glyph layouts, indicates thealignment coordinate for glyphs to achieve hanging baseline alignment. Thevalue is an offset in the font coordinate system. If this attribute is provided,the units-per-em attribute must also be specified.
Animatable:no.

v-ideographic = "<number>"

对于垂直方向的图元布局, 表示图元的对齐坐标以到达表意字对齐基线. 此值为字体坐标系中相对于图元指定的 vert-origin-x 性质的偏移量. 如果提供此性质, 则必须指定 units-per-em 性质.For vertically oriented glyph layouts, indicates the alignmentcoordinate for glyphs to achieve ideographic baseline alignment. The value isan offset in the font coordinate system relative to the glyph-specific vert-origin-x attribute. If this attribute isprovided, the units-per-em attribute must also be specified.
Animatable:no.

v-alphabetic = "<number>"

对于垂直方向的图元布局, 表示图元的对齐坐标以到达字母对齐基线. 此值为字体坐标系中相对于图元指定的 vert-origin-x 性质的偏移量.如果提供此性质, 则必须指定 units-per-em 性质.For vertically oriented glyph layouts, indicates the alignmentcoordinate for glyphs to achieve alphabetic baseline alignment. The value is anoffset in the font coordinate system relative to the glyph-specific vert-origin-x attribute. If this attribute isprovided, the units-per-em attribute must also be specified.
Animatable:no.

v-mathematical = "<number>"

对于垂直方向的图元布局, 表示图元的对齐坐标以到达数学对齐基线. 此值为字体坐标系中相对于图元指定的 vert-origin-x 性质的偏移量.如果提供此性质, 则必须指定 units-per-em 性质.For vertically oriented glyph layouts, indicates the alignmentcoordinate for glyphs to achieve mathematical baseline alignment. The value isan offset in the font coordinate system relative to the glyph-specific vert-origin-x attribute. If this attribute isprovided, the units-per-em attribute must also be specified.
Animatable:no.

v-hanging = "<number>"

对于垂直方向的图元布局, 表示图元的对齐坐标以到达悬空对齐基线. 此值为字体坐标系中相对于图元指定的 vert-origin-x 性质的偏移量.如果提供此性质, 则必须指定 units-per-em 性质.For vertically oriented glyph layouts, indicates the alignmentcoordinate for glyphs to achieve hanging baseline alignment. The value is anoffset in the font coordinate system relative to the glyph-specific vert-origin-x attribute. If this attribute isprovided, the units-per-em attribute must also be specified.
Animatable:no.

underline-position = "<number>"

在字体坐标系中一个下划线的理想位置.如果提供此性质, 则必须指定 units-per-em 性质.The ideal position of an underline within the font coordinatesystem. If this attribute is provided, the units-per-em attribute must also be specified.
Animatable:no.

underline-thickness = "<number>"

按照字体坐标系中的长度表示的一个下划线的理想宽度.如果提供此性质, 则必须指定 units-per-em 性质.The ideal thickness of an underline, expressed as a length withinthe font coordinate system. If this attribute is provided, the units-per-em attribute must also be specified.
Animatable:no.

strikethrough-position = "<number>"

在字体坐标系中一个删除线的理想位置.如果提供此性质, 则必须指定 units-per-em 性质.The ideal position of a strike-through within the font coordinatesystem. If this attribute is provided, the units-per-em attribute must also be specified.
Animatable:no.

strikethrough-thickness = "<number>"

按照字体坐标系中的长度表示的一个删除线的理想宽度.如果提供此性质, 则必须指定 units-per-em 性质.The ideal thickness of a strike-through, expressed as a lengthwithin the font coordinate system. If this attribute is provided, the units-per-em attribute must also be specified.
Animatable:no.

overline-position = "<number>"

在字体坐标系中一个上划线的理想位置.如果提供此性质, 则必须指定 units-per-em 性质.The ideal position of an overline within the font coordinatesystem. If this attribute is provided, the units-per-em attribute must also be specified.
Animatable:no.

overline-thickness = "<number>"

按照字体坐标系中的长度表示的一个上划线的理想宽度.如果提供此性质, 则必须指定 units-per-em 性质.The ideal thickness of an overline, expressed as a length withinthe font coordinate system. If this attribute is provided, the units-per-em attribute must also be specified.
Animatable:no.

在别处定义的属性:Attributesdefined elsewhere:

%stdAttrs;.

下列元素和性质对应一个@font-face规则中的 'src' 描述子. (参见在 CSS2 规范中[@font-facerule]和 ['src' descriptor]的描述.)  The following elementsand attributes correspond to the 'src' descriptorwithin an @font-face rule. (Refer to the descriptions of the [@font-facerule] and ['src'descriptor] in the CSS2 specification.)

当一个 'font-face-uri' 正在引用一个精图字体时, 则此引用必须为一个精图'font' 元素, 因此要求使用一种片段标识符(参见 [URI]). 此引用的 'font' 元素可以是本地的 (即, 如 'font-face-uri' 元素在相同的文档内) 或者是远程的 (即, 在一个不同的文档中).    When a 'font-face-uri' is referencing an SVG font,then that reference must be to an SVG 'font' element, therefore requiring the use of afragment identifier (see [URI]).The referenced 'font' element can be local (i.e., within thesame document as the 'font-face-uri' element) or remote (i.e., withina different document).

 
<!ELEMENT font-face-src (font-face-uri|font-face-name)+ >
<!ATTLIST font-face-src 
  %stdAttrs; >
 
<!ELEMENT font-face-uri (font-face-format*) >
<!ATTLIST font-face-uri 
  %stdAttrs;
  %xlinkRefAttrs;
  xlink:href %URI; #REQUIRED >
 
<!ELEMENT font-face-format EMPTY >
<!ATTLIST font-face-format 
  %stdAttrs;
  string CDATA #IMPLIED >
 
<!ELEMENT font-face-name EMPTY >
<!ATTLIST font-face-name 
  %stdAttrs;
  name CDATA #IMPLIED >

'definition-src' 元素对应于CSS2中的 'definition-src' 描述子. (参见CSS2规范中对['definition-src'descriptor]的描述.)   The 'definition-src' element corresponds to the'definition-src' descriptor in CSS2. (Refer to description of the ['definition-src'descriptor] in CSS2 specification.)

 
<!ELEMENT definition-src EMPTY >
<!ATTLIST definition-src 
  %stdAttrs;
  %xlinkRefAttrs;
  xlink:href %URI; #REQUIRED >

在别处定义的属性:Attributesdefined elsewhere:

%stdAttrs;,%xlinkRefAttrs;,xlink:href.



20.9 文档对象模型接口 DOM interfaces

下列接口定义如下:Thefollowing interfaces are defined below: SVGFontElement,SVGGlyphElement, SVGMissingGlyphElement, SVGHKernElement, SVGVKernElement, SVGFontFaceElement, SVGFontFaceSrcElement, SVGFontFaceUriElement, SVGFontFaceFormatElement, SVGFontFaceNameElement, SVGDefinitionSrcElement.

 

接口Interface SVGFontElement

接口SVGFontElement  对应  'font'元素.  The SVGFontElement interface corresponds to the 'font' element.

不能对经由精图文档对象模型的'font'元素的性质进行面向对象的存取. Object-oriented access to the attributes of the 'font' element via the SVG DOM is not available.


IDL 定义   IDLDefinition

 
interface SVGFontElement : 
                SVGElement,
                SVGExternalResourcesRequired,
                SVGStylable {};

 

 

接口Interface SVGGlyphElement

接口SVGGlyphElement  对应 'glyph'  元素. The SVGGlyphElementinterface corresponds to the 'glyph' element.

不能对经由精图 文档对象模型的'glyph'元素的性质进行面向对象的存取. Object-orientedaccess to the attributes of the 'glyph' elementvia the SVG DOM is not available.


IDL 定义   IDLDefinition

 
interface SVGGlyphElement : 
                SVGElement,
                SVGStylable {};

 

 

接口Interface SVGMissingGlyphElement

接口SVGMissingGlyphElement  对应'missing-glyph' 元素. The SVGMissingGlyphElement interface corresponds tothe 'missing-glyph' element.

不能对经由精图 文档对象模型的'missing-glyph'元素的性质进行面向对象的存取. Object-orientedaccess to the attributes of the 'missing-glyph'element via the SVG DOM is not available.


IDL 定义   IDLDefinition

 
interface SVGMissingGlyphElement : 
                SVGElement,
                SVGStylable {};

 

 

接口Interface SVGHKernElement

接口SVGHKernElement  对应'hkern'  元素. The SVGHKernElementinterface corresponds to the 'hkern' element.

不能对经由精图 文档对象模型的'hkern' 元素的性质进行面向对象的存取. Object-orientedaccess to the attributes of the 'hkern' elementvia the SVG DOM is not available.


IDL 定义   IDLDefinition

 
interface SVGHKernElement : SVGElement {};

 

 

接口Interface SVGVKernElement

接口SVGVKernElement  对应 'vkern' 元素. The SVGVKernElement interface corresponds to the 'vkern' element.

不能对经由精图 文档对象模型的'vkern' 元素的性质进行面向对象的存取.Object-oriented access to the attributes of the 'vkern'element via the SVG DOM is not available.


IDL 定义   IDLDefinition

 
interface SVGVKernElement : SVGElement {};

 

 

接口Interface SVGFontFaceElement

接口SVGFontFaceElement 对应 'font-face' 元素. The SVGFontFaceElement interface corresponds to the 'font-face' element.

不能对经由精图 文档对象模型的'font-face' 元素的性质进行面向对象的存取.Object-oriented access to the attributes of the 'font-face'element via the SVG DOM is not available.


IDL 定义   IDLDefinition

 
interface SVGFontFaceElement : SVGElement {};

 

 

接口Interface SVGFontFaceSrcElement

接口SVGFontFaceSrcElement 对应 'font-face-src'元素. The SVGFontFaceSrcElement interface corresponds tothe 'font-face-src' element.


IDL 定义   IDLDefinition

 
interface SVGFontFaceSrcElement : SVGElement {};

 

 

接口Interface SVGFontFaceUriElement

接口SVGFontFaceUriElement 对应'font-face-uri'元素. The SVGFontFaceUriElement interface corresponds tothe 'font-face-uri' element.

不能对经由精图 文档对象模型的'font-face-uri'元素的性质进行面向对象的存取. Object-orientedaccess to the attributes of the 'font-face-uri'element via the SVG DOM is not available.


IDL 定义   IDLDefinition

 
interface SVGFontFaceUriElement : SVGElement {};

 

 

接口Interface SVGFontFaceFormatElement

接口SVGFontFaceFormatElement 对应'font-face-format'  元素. The SVGFontFaceFormatElementinterface corresponds to the 'font-face-format'element.

不能对经由精图 文档对象模型的'font-face-format' 元素的性质进行面向对象的存取.Object-oriented access to the attributes of the 'font-face-format'element via the SVG DOM is not available.


IDL 定义   IDLDefinition

 
interface SVGFontFaceFormatElement : SVGElement {};

 

 

接口Interface SVGFontFaceNameElement

接口SVGFontFaceNameElement 对应'font-face-name' 元素. The SVGFontFaceNameElement interface corresponds tothe 'font-face-name' element.

不能对经由精图 文档对象模型的'font-face-name'元素的性质进行面向对象的存取. Object-orientedaccess to the attributes of the 'font-face-name'element via the SVG DOM is not available.


IDL 定义   IDLDefinition

 
interface SVGFontFaceNameElement : SVGElement {};

 

 

接口Interface SVGDefinitionSrcElement

接口SVGDefinitionSrcElement 对应 'definition-src'元素. The SVGDefinitionSrcElement interface corresponds tothe 'definition-src' element.

不能对经由精图 文档对象模型的'definition-src'元素的性质进行面向对象的存取. Object-orientedaccess to the attributes of the 'definition-src'element via the SVG DOM is not available.


IDL 定义   IDLDefinition

 
interface SVGDefinitionSrcElement : SVGElement {};

 


previous  next   contents   elements   attributes   properties   index  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值