-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
33 lines (22 loc) · 887 Bytes
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
---
title: "TextMetrics: alphabeticBaseline property"
short-title: alphabeticBaseline
slug: Web/API/TextMetrics/alphabeticBaseline
page-type: web-api-instance-property
browser-compat: api.TextMetrics.alphabeticBaseline
---
{{APIRef("Canvas API")}}{{AvailableInWorkers}}
The read-only `alphabeticBaseline` property of the {{domxref("TextMetrics")}} interface is a `double` giving the distance from the horizontal line indicated by the {{domxref("CanvasRenderingContext2D.textBaseline")}} property to the alphabetic baseline of the line box, in CSS pixels.
## Examples
```js
const canvas = document.createElement("canvas");
const ctx = canvas.getContext("2d");
const text = ctx.measureText("foo"); // returns TextMetrics object
text.alphabeticBaseline; // -0;
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("TextMetrics")}}