From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/api/fontface/index.html | 122 ++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 files/zh-cn/web/api/fontface/index.html (limited to 'files/zh-cn/web/api/fontface/index.html') diff --git a/files/zh-cn/web/api/fontface/index.html b/files/zh-cn/web/api/fontface/index.html new file mode 100644 index 0000000000..33f591f749 --- /dev/null +++ b/files/zh-cn/web/api/fontface/index.html @@ -0,0 +1,122 @@ +--- +title: FontFace +slug: Web/API/FontFace +translation_of: Web/API/FontFace +--- +

{{APIRef("CSS Font Loading API")}}{{SeeCompatTable}}

+ +

FontFace 接口表示一个可用的字体。它允许您控制字体的源文件,作为外部资源的URL或缓冲区; 它还允许您控制字体的加载时间和字体当前的状态。

+ +

Constructor

+ +
+
{{domxref("FontFace.FontFace", "FontFace()")}}
+
使用URL指向的外部资源或{{domxref("ArrayBuffer")}}构造并返回一个新的 FontFace 对象。
+
+ +

Properties

+ +

这个接口不继承任何属性。

+ +
+
{{domxref("FontFace.family")}}
+
这是不是一个{{domxref("DOMString")}} ?是的话将表示该字体的 family 属性,相当于 {{cssxref("@font-face/family", "family")}} 。
+
{{domxref("FontFace.style")}}
+
这是不是一个 {{domxref("DOMString")}} ?是的话将表示该字体的 style 属性,相当于 {{cssxref("@font-face/style", "style")}} 。
+
{{domxref("FontFace.weight")}}
+
这是不是一个 {{domxref("DOMString")}} ?是的话将表示该字体的 weight 属性,相当于 {{cssxref("@font-face/weight", "weight")}}。
+
{{domxref("FontFace.stretch")}}
+
这是不是一个 {{domxref("DOMString")}} ?是的话将表示该字体的 stretches 属性,相当于 {{cssxref("@font-face/stretch", "stretch")}} 。
+
{{domxref("FontFace.unicodeRange")}}
+
这是不是一个 {{domxref("DOMString")}} ?是的话将表示该字体涵盖的 range of code (字符编码的范围),相当于 {{cssxref("@font-face/unicode-range", "unicode-range")}} 。
+
{{domxref("FontFace.variant")}}
+
这是不是一个 {{domxref("DOMString")}} ?是的话将表示该字体的 variant 属性,相当于 {{cssxref("@font-face/range", "range")}} 。
+
{{domxref("FontFace.featureSettings")}}
+
这是不是一个 {{domxref("DOMString")}} ?是的话将表示该字体的 features 属性,相当于 {{cssxref("@font-face/feature-settings", "feature-settings")}} 。
+
{{domxref("FontFace.status")}} {{readonlyinline}}
+
返回一个表示字体当前状态的可枚举值,它可能是下列之一: "unloaded", "loading", "loaded""error"
+
{{domxref("FontFace.loaded")}} {{readonlyinline}}
+
当字体完全加载或加载失败时返回该 FontFace 的{{domxref("Promise")}} 。
+
+ +

Methods

+ +

这个接口不继承任何方法

+ +
+
{{domxref("FontFace.load()")}}
+
加载该字体,返回该字体完全加载或加载失败时的{{domxref("Promise")}} 。
+
+ +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('CSS3 Font Loading','#FontFace-interface','FontFaceSet')}}{{Spec2('CSS3 Font Loading')}}Initial definition
+ +

Browser compatibility

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support{{CompatChrome(35.0)}}{{CompatGeckoDesktop(41)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidAndroid WebviewFirefox Mobile (Gecko)Firefox OSIE MobileOpera MobileSafari MobileChrome for Android
Basic support{{CompatNo}}{{CompatChrome(35.0)}}{{CompatGeckoMobile(41)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatChrome(35.0)}}
+
-- cgit v1.2.3-54-g00ecf