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

{{CSSRef}}

+ +

概述

+ +

font-style 描述符允许开发者在@font-rule规则中为指定字体样式(该条目区别于font-style,意指用在@font-rule中的font-style属性)

+ +

For a particular font family, authors can download various font faces which correspond to the different styles of the same font family, and then use the font-style descriptor to explicitly specify the font face's style. The values for the CSS descriptor is same as that of its corresponding font property.

+ +

{{cssinfo}}

+ +

Syntax

+ +
+
font-style: normal;
+font-style: italic;
+font-style: oblique;
+ +

Values

+ +

normal
+ Selects the normal version of the font-family.

+ +

italic
+ Specifies that font-face is an italicized version of the normal font .

+ +

oblique
+ Specifies that the font-face is an artificially sloped version of the normal font.

+ +

Formal syntax

+ +
{{csssyntax}}
+ +

Examples

+ +

As an example, consider the garamond font family, in its normal form, we get the following result:

+ +
@font-face {
+  font-family: garamond;
+  src: url('garamond.ttf');
+}
+ +

unstyled Garamond

+ +

The italicized version of this text uses the same glyphs present in the unstyled version, but they are artificially sloped by a few degrees.

+ +

artificially sloped garamond

+ +

On the other hand, if a true italicized version of the font family exists, we can include it in the src descriptor and specify the font style as italic, so that it is clear that the font is italicized. True italics use different glyphs and are a bit different from their upright counterparts, having some unique features and generally have a rounded and calligraphic quality. These fonts are specially created by font designers and are not artificially sloped.

+ +
@font-face {
+  font-family: garamond;
+  src: url('garamond-italic.ttf');
+  font-style: italic;
+}
+ +

italic garamond

+ +

Specifications

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('CSS3 Fonts', '#descdef-font-face-unicode-range', 'unicode-range')}}{{Spec2('CSS3 Fonts')}}Initial definition
+ +

Browser compatibility

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureFirefox (Gecko)ChromeInternet ExplorerOperaSafari
Basic support{{CompatGeckoDesktop("1.9.1")}}4.0  4.010.03.1
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MiniOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatGeckoMobile("1.9.1")}}{{CompatUnknown}}{{CompatNo}}10.0{{CompatVersionUnknown}}
+
+
-- cgit v1.2.3-54-g00ecf