非常教程

SVG参考手册

属性 | Attributes

kerning

kerning属性指示浏览器是否应基于包含在相关字体中的字距表(即,启用自动调整)来调整字符间间距,而不是禁用自动调整,或是将字符间间距设置为特定的长度(通常,零)。

auto——表示用户代理应根据将使用的字体中所包含的字距表调整字符间间距。

如果提供了<length>类型的值,则自动调整就被禁用。相反,字符间距设置为给定的<length>。除了auto以外,最常见的情况是kerning将其值设置为0,以便禁用自动调整。

如果提供的<length>没有单位标识符(例如,无单位的数字,如128),则浏览器将<length>作为当前用户坐标系中的宽度值进行处理。

如果<length>带有单位标识符(例如.25em或1%),则浏览器将<length>转换为当前用户坐标系中的对应值。

当提供<length>时,它的值将被添加到由letter-spacing属性指定的字符间间距值。

作为一个表现属性,它也可以作为一个属性直接在一个CSS样式表中使用,请参阅css kerning查看进一步的信息。

用法上下文

Categories

Presentation attribute

Value

auto | <length> | inherit

Animatable

Yes

Normative document

SVG 1.1 (2nd Edition)

<length>

长度是一个距离度量,与一个单位一起作为一个数字给出。长度以下面两种方式之一指定。在样式表中使用时,<length>定义如下:

length ::= number (~"em" | ~"ex" | ~"px" | ~"in" | ~"cm" | ~"mm" | ~"pt" | ~"pc")?

有关单元标识符的含义,请参阅CSS2规范。

对于在CSS2中定义的属性,必须提供长度单位标识符。对于SVG特定属性中的长度值及其对应的表示属性,长度单位标识符是可选的。如果未提供,则长度值表示当前用户坐标系中的距离。在所有属性的表示属性中,无论是在SVG1.1还是在CSS2中定义的,长度标识符(如果指定)都必须是小写。

当在SVG属性中使用长度时,<length>的定义如下:

length ::= number ("em" | "ex" | "px" | "in" | "cm" | "mm" | "pt" | "pc" | "%")?

这些<length>值中的单位标识符必须小写。

请注意,非属性的<length>定义还允许百分比单位标识符。百分比长度值的含义取决于已指定了百分比长度值的属性。两个常见的情况是:

  • 当百分比长度值代表视口宽度或高度的百分比
  • 当百分比长度值表示给定对象上的边界框宽度或高度的百分比时。

在SVG DOM中,使用SVGLengthSVGAnimatedLength对象来表示<length>值。

适用元素

以下元素可以使用该kerning属性

  • 文本内容元素»另请参阅
  • css kerning

属性 | Attributes相关

1.accent-height(焦点高度)
2.accumulate(积累)
3.additive
4.alignment-baseline(对齐基线)
5.ascent
6.attributename(属性名字)
7.Attributes(属性)
8.attributetype(属性类型)
9.azimuth(方位)
10.basefrequency
11.baseline-shift(基线漂移)
12.baseprofile
13.begin(开始)
14.bias(偏压)
15.calcmode
16.class
17.clip(剪辑)
18.clip-path(剪辑路径)
19.clip-rule(剪辑规则)
20.clippathunits
21.color(颜色)
22.color-interpolation(彩色插值)
23.color-interpolation-filters(色彩插值滤波器)
24.color-profile(彩色轮廓)
25.color-rendering(显色)
26.contentscripttype
27.contentstyletype
28.cursor(光标)
29.cx
30.cy
31.d
32.diffuseconstant
33.direction(方向)
34.display(显示)
35.divisor
36.dominant-baseline(显性基线)
37.dur
38.dx
39.dy
40.edgemode
41.elevation
42.end
43.externalresourcesrequired
44.fill
45.fill-opacity
46.fill-rule
47.filter
48.filterres
49.filterunits
50.flood-color
51.flood-opacity
52.font-family
53.font-size
54.font-size-adjust
55.font-stretch
56.font-style
57.font-variant
58.font-weight
59.fr
60.from
61.fx
62.fy
63.gradienttransform
64.gradientunits
65.height
66.href
67.image-rendering
68.in
69.in2
70.k1
71.k2
72.k3
73.k4
74.kernelmatrix
75.kernelunitlength
76.keysplines
77.keytimes
78.lengthadjust
79.letter-spacing
80.lighting-color
81.limitingconeangle
82.local
83.marker-end
84.marker-mid
85.marker-start
86.markerheight
87.markerunits
88.markerwidth
89.mask
90.maskcontentunits
91.maskunits
92.max
93.min
94.mode
95.numoctaves
96.opacity
97.operator
98.order
99.overflow
100.overline-position
SVG

可缩放矢量图形是基于可扩展标记语言(标准通用标记语言的子集),用于描述二维矢量图形的一种图形格式。它由万维网联盟制定,是一个开放标准。