FontFaceSet: delete() method
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{APIRef("CSS Font Loading API")}}{{AvailableInWorkers}}
The **delete()** method of the {{domxref("FontFaceSet")}} interface removes a font from the set.
Font faces that were added to the set using the CSS {{cssxref("@font-face")}} rule remain connected to the corresponding CSS, and cannot be deleted.
Syntax
js-nolint
delete(font)Parameters
font- : A {{domxref("FontFace")}} to be removed from the set.
Return value
A boolean value which is true if the deletion was successful, and false otherwise.
Examples
In the following example a new {{domxref("FontFace")}} object is created and then deleted from the {{domxref("FontFaceSet")}}.
js
const font = new FontFace("MyFont", 'url("myFont.woff2")');
document.fonts.delete(font);Specifications
{{Specifications}}
Browser compatibility
{{Compat}}