aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/document/fonts
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/document/fonts
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/api/document/fonts')
-rw-r--r--files/zh-cn/web/api/document/fonts/index.html57
1 files changed, 57 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/document/fonts/index.html b/files/zh-cn/web/api/document/fonts/index.html
new file mode 100644
index 0000000000..c6b680f6e4
--- /dev/null
+++ b/files/zh-cn/web/api/document/fonts/index.html
@@ -0,0 +1,57 @@
+---
+title: fonts
+slug: Web/API/Document/fonts
+translation_of: Web/API/Document/fonts
+---
+<p><span class="seoSummary">{{domxref("Document")}}的 <strong><code>fonts</code></strong> 属性接口返回文档的 {{domxref("FontFaceSet")}} 接口。</span></p>
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre class="syntaxbox"><var>let fontFaceSet</var> = <em>document</em>.fonts;</pre>
+
+<h3 id="值">值</h3>
+
+<p>返回值是文档的 {{domxref("FontFaceSet")}} 接口。<code>FontFaceSet</code> 接口对 加载新字体、检查已加载字体的加载状态 来说非常有用。</p>
+
+<h2 id="Example" name="Example">例子</h2>
+
+<h3 id="在所有字体加载完成后进行操作">在所有字体加载完成后进行操作</h3>
+
+<pre class="brush: js">document.fonts.ready.then(function() {
+ // 字体加载完成后的逻辑
+});
+</pre>
+
+<h2 id="Specifications" name="Specifications">说明</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('CSS3 Font Loading','#FontFaceSet-interface','FontFaceSet')}}</td>
+ <td>{{Spec2('CSS3 Font Loading')}}</td>
+ <td>Initial definition</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="See_Also" name="See_Also">浏览器兼容性</h2>
+
+<div class="hidden">这个兼容性表格是从结构数据自动生成的。如果你有兴趣来贡献这个数据,请查看 <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> 并给我们发pull request。</div>
+
+<p>{{Compat("api.Document.fonts")}}</p>
+
+<h2 id="See_Also" name="See_Also">参考资料</h2>
+
+<ul>
+ <li><span class="seoSummary">{{domxref("FontFaceSet")}} interface</span></li>
+ <li><span class="seoSummary">{{domxref("FontFace")}}</span></li>
+</ul>
+
+<div>{{APIRef("DOM")}}</div>