只读
emHeightAscent
特性为
TextMetrics
接口是
double
giving the distance from the horizontal line indicated by the
CanvasRenderingContext2D.textBaseline
property to the top of the
em
square in the line box, in CSS pixels.
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
const text = ctx.measureText('foo'); // returns TextMetrics object
text.emHeightAscent; // 7.59765625;
| 规范 |
|---|
|
HTML 实时标准
The definition of 'TextMetrics.emHeightAscent' in that specification. |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
emHeightAscent
|
Chrome
Yes
Disabled
|
Edge
79
Disabled
|
Firefox 74 | IE No | Opera ? | Safari Yes | WebView Android No |
Chrome Android
Yes
Disabled
|
Firefox Android No | Opera Android ? | Safari iOS Yes | Samsung Internet Android No |
完整支持
不支持
兼容性未知
实验。期望将来行为有所改变。
用户必须明确启用此特征。