TextMetrics: Eigenschaft emHeightAscent
Hinweis: Diese Funktion ist in Web Workers verfügbar.
Die schreibgeschützte Eigenschaft emHeightAscent
der TextMetrics
-Schnittstelle gibt die Entfernung von der durch die CanvasRenderingContext2D.textBaseline
-Eigenschaft angegebenen horizontalen Linie zur Oberseite des em-Quadrats im Linienkasten in CSS-Pixeln zurück.
Wert
Eine Zahl, in CSS-Pixeln.
Beispiele
js
const canvas = document.createElement("canvas");
const ctx = canvas.getContext("2d");
const text = ctx.measureText("foo"); // returns TextMetrics object
text.emHeightAscent; // 7.59765625;
Spezifikationen
Specification |
---|
HTML # dom-textmetrics-emheightascent-dev |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
emHeightAscent |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- User must explicitly enable this feature.
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.