From 074785cea106179cb3305637055ab0a009ca74f2 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:52 -0500 Subject: initial commit --- files/ru/web/svg/attribute/lengthadjust/index.html | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 files/ru/web/svg/attribute/lengthadjust/index.html (limited to 'files/ru/web/svg/attribute/lengthadjust') diff --git a/files/ru/web/svg/attribute/lengthadjust/index.html b/files/ru/web/svg/attribute/lengthadjust/index.html new file mode 100644 index 0000000000..69284fcc46 --- /dev/null +++ b/files/ru/web/svg/attribute/lengthadjust/index.html @@ -0,0 +1,33 @@ +--- +title: lengthAdjust +slug: Web/SVG/Attribute/lengthAdjust +translation_of: Web/SVG/Attribute/lengthAdjust +--- +

Когда  SVG элемент <text> или <tspan> имеет конкретную длину, установленную с помощью атрибута  textLengt, атрибут lengthAdjust контролирует как текст помещается в эту длину (растягивается или сжимается).

+ +

Существует 2 допустимых значения для атрибута lengthAdjust: spacing и spacingAndGlyphs. Используя spacing (установлено по умолчанию), форма букв сохраняется, но расстояние между ними увеличивается или уменьшается. Используя spacingAndGlyphs весь тестовый элемент растягивается.

+ +

SVG текст с использованием lengthAdjust

+ +

HTML Content

+ +
<svg width="300" height="150" xmlns="http://www.w3.org/2000/svg">
+   <g font-face="sans-serif">
+      <text x="0" y="20" textLength="300" lengthAdjust="spacing">
+         Stretched using spacing only.
+      </text>
+      <text x="0" y="50" textLength="300" lengthAdjust="spacingAndGlyphs">
+         Stretched using spacing and glyphs.
+      </text>
+      <text x="0" y="80" textLength="100" lengthAdjust="spacing">
+         Shrunk using spacing only.
+      </text>
+      <text x="0" y="110" textLength="100" lengthAdjust="spacingAndGlyphs">
+         Shrunk using spacing and glyphs.
+      </text>
+   </g>
+</svg>
+ +

Результат

+ +

{{ EmbedLiveSample('SVG_text_fitting_using_lengthAdjust') }}

-- cgit v1.2.3-54-g00ecf