TextMetrics: actualBoundingBoxDescent プロパティ
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2020年7月.
メモ: この機能はウェブワーカー内で利用可能です。
actualBoundingBoxDescent は TextMetrics インターフェイスの読み取り専用プロパティで、double 型であり、CanvasRenderingContext2D.textBaseline 属性で示された水平線から、テキストの描画に使用される境界矩形の下端までの距離を CSS ピクセル単位で返します。
例
js
const canvas = document.createElement("canvas");
const ctx = canvas.getContext("2d");
const text = ctx.measureText("foo"); // TextMetrics オブジェクトを返す
text.actualBoundingBoxDescent; // 0;
仕様書
| Specification |
|---|
| HTML> # dom-textmetrics-actualboundingboxdescent-dev> |