A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/ja/docs/Web/API/SVGTextContentElement/getComputedTextLength below:

SVGTextContentElement: getComputedTextLength() メソッド - Web API

SVGTextContentElement: getComputedTextLength() メソッド

Baseline Widely available

getComputedTextLength() は SVGTextContentElement インターフェイスのメソッドで、この要素内のテキストの計算された長さを表します。

構文 引数

なし。

返値

実数です。

例 テキストの長さの計算
<svg width="300" height="100">
  <text id="exampleText" x="10" y="50" font-size="16">Hello, SVG World!</text>
</svg>
const textElement = document.getElementById("exampleText");

// 計算されたテキストの長さを取得
const textLength = textElement.getComputedTextLength();

console.log(textLength); // 出力: 124.5 (例。フォントサイズやテキストコンテンツによって変わる)
仕様書 ブラウザーの互換性

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4