TextMetrics: emHeightDescent property

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Note: This feature is available in Web Workers.

Thuộc tính chỉ đọc emHeightDescent của giao diện TextMetrics trả về khoảng cách từ đường ngang được chỉ định bởi thuộc tính CanvasRenderingContext2D.textBaseline đến đáy của ô em trong hộp dòng, tính bằng pixel CSS.

Giá trị

Một số, tính bằng pixel CSS.

Ví dụ

js
const canvas = document.createElement("canvas");
const ctx = canvas.getContext("2d");
const text = ctx.measureText("foo"); // trả về đối tượng TextMetrics

text.emHeightDescent; // -2.40234375;

Thông số kỹ thuật

Specification
HTML
# dom-textmetrics-emheightdescent-dev

Tương thích trình duyệt

Xem thêm