Skip to content

Commit 70bc891

Browse files
authored
Enable additional TextMetrics properties (#2575)
1 parent 72ef869 commit 70bc891

File tree

2 files changed

+48
-4
lines changed

2 files changed

+48
-4
lines changed

crates/web-sys/src/features/gen_TextMetrics.rs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,46 @@ extern "C" {
1818
#[doc = ""]
1919
#[doc = "*This API requires the following crate features to be activated: `TextMetrics`*"]
2020
pub fn width(this: &TextMetrics) -> f64;
21+
# [wasm_bindgen (structural , method , getter , js_class = "TextMetrics" , js_name = actualBoundingBoxLeft)]
22+
#[doc = "Getter for the `actualBoundingBoxLeft` field of this object."]
23+
#[doc = ""]
24+
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics/actualBoundingBoxLeft)"]
25+
#[doc = ""]
26+
#[doc = "*This API requires the following crate features to be activated: `TextMetrics`*"]
27+
pub fn actual_bounding_box_left(this: &TextMetrics) -> f64;
28+
# [wasm_bindgen (structural , method , getter , js_class = "TextMetrics" , js_name = actualBoundingBoxRight)]
29+
#[doc = "Getter for the `actualBoundingBoxRight` field of this object."]
30+
#[doc = ""]
31+
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics/actualBoundingBoxRight)"]
32+
#[doc = ""]
33+
#[doc = "*This API requires the following crate features to be activated: `TextMetrics`*"]
34+
pub fn actual_bounding_box_right(this: &TextMetrics) -> f64;
35+
# [wasm_bindgen (structural , method , getter , js_class = "TextMetrics" , js_name = fontBoundingBoxAscent)]
36+
#[doc = "Getter for the `fontBoundingBoxAscent` field of this object."]
37+
#[doc = ""]
38+
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics/fontBoundingBoxAscent)"]
39+
#[doc = ""]
40+
#[doc = "*This API requires the following crate features to be activated: `TextMetrics`*"]
41+
pub fn font_bounding_box_ascent(this: &TextMetrics) -> f64;
42+
# [wasm_bindgen (structural , method , getter , js_class = "TextMetrics" , js_name = fontBoundingBoxDescent)]
43+
#[doc = "Getter for the `fontBoundingBoxDescent` field of this object."]
44+
#[doc = ""]
45+
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics/fontBoundingBoxDescent)"]
46+
#[doc = ""]
47+
#[doc = "*This API requires the following crate features to be activated: `TextMetrics`*"]
48+
pub fn font_bounding_box_descent(this: &TextMetrics) -> f64;
49+
# [wasm_bindgen (structural , method , getter , js_class = "TextMetrics" , js_name = actualBoundingBoxAscent)]
50+
#[doc = "Getter for the `actualBoundingBoxAscent` field of this object."]
51+
#[doc = ""]
52+
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics/actualBoundingBoxAscent)"]
53+
#[doc = ""]
54+
#[doc = "*This API requires the following crate features to be activated: `TextMetrics`*"]
55+
pub fn actual_bounding_box_ascent(this: &TextMetrics) -> f64;
56+
# [wasm_bindgen (structural , method , getter , js_class = "TextMetrics" , js_name = actualBoundingBoxDescent)]
57+
#[doc = "Getter for the `actualBoundingBoxDescent` field of this object."]
58+
#[doc = ""]
59+
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics/actualBoundingBoxDescent)"]
60+
#[doc = ""]
61+
#[doc = "*This API requires the following crate features to be activated: `TextMetrics`*"]
62+
pub fn actual_bounding_box_descent(this: &TextMetrics) -> f64;
2163
}

crates/web-sys/webidls/enabled/CanvasRenderingContext2D.webidl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,17 +339,19 @@ interface TextMetrics {
339339
// x-direction
340340
readonly attribute double width; // advance width
341341

342-
/*
343-
* NOT IMPLEMENTED YET
344-
345342
readonly attribute double actualBoundingBoxLeft;
346343
readonly attribute double actualBoundingBoxRight;
347344

348-
// y-direction
349345
readonly attribute double fontBoundingBoxAscent;
350346
readonly attribute double fontBoundingBoxDescent;
347+
348+
// y-direction
351349
readonly attribute double actualBoundingBoxAscent;
352350
readonly attribute double actualBoundingBoxDescent;
351+
352+
/*
353+
* NOT IMPLEMENTED YET
354+
353355
readonly attribute double emHeightAscent;
354356
readonly attribute double emHeightDescent;
355357
readonly attribute double hangingBaseline;

0 commit comments

Comments
 (0)