FontFace.idl 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. dictionary FontFaceDescriptors {
  2. CSSOMString style = "normal";
  3. CSSOMString weight = "normal";
  4. CSSOMString stretch = "normal";
  5. CSSOMString unicodeRange = "U+0-10FFFF";
  6. CSSOMString featureSettings = "normal";
  7. CSSOMString variationSettings = "normal";
  8. CSSOMString display = "auto";
  9. CSSOMString ascentOverride = "normal";
  10. CSSOMString descentOverride = "normal";
  11. CSSOMString lineGapOverride = "normal";
  12. };
  13. enum FontFaceLoadStatus { "unloaded", "loading", "loaded", "error" };
  14. // https://drafts.csswg.org/css-font-loading/#fontface-interface
  15. [Exposed=(Window,Worker)]
  16. interface FontFace {
  17. // FIXME: BufferSource usage needs https://github.com/w3c/csswg-drafts/pull/10309
  18. constructor(CSSOMString family, (CSSOMString or BufferSource) source, optional FontFaceDescriptors descriptors = {});
  19. attribute CSSOMString family;
  20. attribute CSSOMString style;
  21. attribute CSSOMString weight;
  22. attribute CSSOMString stretch;
  23. attribute CSSOMString unicodeRange;
  24. attribute CSSOMString featureSettings;
  25. attribute CSSOMString variationSettings;
  26. attribute CSSOMString display;
  27. attribute CSSOMString ascentOverride;
  28. attribute CSSOMString descentOverride;
  29. attribute CSSOMString lineGapOverride;
  30. readonly attribute FontFaceLoadStatus status;
  31. Promise<FontFace> load();
  32. readonly attribute Promise<FontFace> loaded;
  33. };