只读 actualBoundingBoxLeft 特性为 TextMetrics 接口是 double giving the distance parallel to the baseline from the alignment point given by the CanvasRenderingContext2D.textAlign property to the left side of the bounding rectangle of the given text, in CSS pixels.

范例

const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
const text = ctx.measureText('foo'); // returns TextMetrics object
text.actualBoundingBoxLeft; // 0;
					

规范

规范
HTML 实时标准
The definition of 'TextMetrics.actualBoundingBoxLeft' in that specification.

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
actualBoundingBoxLeft Chrome 77
77
不支持 ? — 77 Disabled
Disabled Until version 77 (exclusive): this feature is behind the Experimental Web Platform Features preference. To change preferences in Chrome, visit chrome://flags.
Edge 79 Firefox 74 IE No Opera ? Safari Yes WebView Android 77 Chrome Android 77
77
不支持 ? — 77 Disabled
Disabled Until version 77 (exclusive): this feature is behind the Experimental Web Platform Features preference. To change preferences in Chrome, visit chrome://flags.
Firefox Android No Opera Android ? Safari iOS Yes Samsung Internet Android 12.0

图例

完整支持

完整支持

不支持

不支持

兼容性未知 ?

兼容性未知

实验。期望将来行为有所改变。

实验。期望将来行为有所改变。

用户必须明确启用此特征。

用户必须明确启用此特征。

另请参阅

元数据

  • 最后修改: