FontFace: thuộc tính ascentOverride
Khả dụng hạn chế
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 ascentOverride của giao diện FontFace trả về và đặt chỉ số ascent của font, tức chiều cao phía trên đường cơ sở mà CSS dùng để dàn xếp các line box trong ngữ cảnh định dạng inline.
Thuộc tính này tương đương với descriptor ascent-override của @font-face.
Giá trị
Một chuỗi. Các giá trị có thể là normal (nghĩa là lấy chỉ số từ file font) hoặc một phần trăm.
Thuộc tính này chấp nhận cùng giá trị với descriptor ascent-override.
Ví dụ
js
let fontFace = new FontFace(
"Roboto",
'url("https://fonts.example.com/roboto.woff2")',
{ ascentOverride: "90%" },
);
console.log(fontFace.ascentOverride); // 90%
fontFace.ascentOverride = "normal";
console.log(fontFace.ascentOverride); // 'normal'
Thông số kỹ thuật
| Thông số kỹ thuật |
|---|
| CSS Font Loading Module Level 3> # dom-fontfacedescriptors-ascentoverride> |