You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
not literally call the value currently stored in the <code>load</code> property of the object.)
758
758
759
+
<divclass=example>
760
+
Fonts are available when they are added to a <adata-link-type=idlhref=#dom-fontfacesettitle=fontfaceset>FontFaceSet</a>.
761
+
Adding a new <aclass=cssdata-link-type=maybehref=http://www.w3.org/TR/css-fonts-3/#at-font-face-ruletitle=@font-face>@font-face</a> rule to a stylesheet
762
+
also adds a new <adata-link-type=idlhref=#dom-fontfacetitle=fontface>FontFace</a> to the <adata-link-type=idlhref=#dom-fontfacesettitle=fontfaceset>FontFaceSet</a> of the <aclass=idl-codedata-link-type=interfacehref=http://www.w3.org/TR/html5/infrastructure.html#dom-documenttitle=document>Document</a> object.
763
+
764
+
<p> Adding a new <aclass=cssdata-link-type=maybehref=http://www.w3.org/TR/css-fonts-3/#at-font-face-ruletitle=@font-face>@font-face</a> rule:
<p> In both cases, the loading of the font resource “newfont.woff” will be initiated by the layout engine,
777
+
just as other <aclass=cssdata-link-type=maybehref=http://www.w3.org/TR/css-fonts-3/#at-font-face-ruletitle=@font-face>@font-face</a> rule fonts are loaded.
778
+
779
+
<p> Omitting the addition to <code>document.fonts</code> means the font would never be loaded
780
+
and text would be displayed in the default serif font:
781
+
782
+
<pre>var f = new FontFace("newfont", "url(newtest.woff)", {});
783
+
784
+
/* new <adata-link-type=idlhref=#dom-fontfacetitle=fontface>FontFace</a> not added to <adata-link-type=idlhref=#dom-fontfacesettitle=fontfaceset>FontFaceSet</a>,
authors can defer the addition of a new <adata-link-type=idlhref=#dom-fontfacetitle=fontface>FontFace</a> to a <adata-link-type=idlhref=#dom-fontfacesettitle=fontfaceset>FontFaceSet</a> until the load has completed:
791
+
792
+
<pre>var f = new FontFace("newfont", "url(newfont.woff)", {});
0 commit comments