8.9. CSS3 font

发布时间 : 2025-10-25 13:34:14 UTC      

Page Views: 9 views

Image0

8.9.1. CSS3 @ font-face Rule

With previous versions of CSS, web designers had to use fonts that were already installed on the user’s computer.

With CSS3, a web designer can use any font he or she likes.

When you find the font file you want to use, simply include the font file inthe website and it will be automatically downloaded to the users who need it.

The font you selected is in the new CSS3 the version has information about @font-face rule description.

Your “own” font is in CSS3 @font-face defined in the rules.

8.9.2. Browser support

The number in the table represents the first browser version number that supports the property.

Attribute

@ font-face

4.0

9.0

3.5

3.2

10.0

Internet Explorer 9 font, Firefox, Chrome, Safari, and Opera support WOFF (Web Open Font Format) fonts.

Firefox, Chrome, Safari, and Opera support .ttf (True Type font) and .otf (OpenType) font type).

Chrome, Safari and Opera also support SVG fonts / folding.

Internet Explorer also supports EOT (Embedded OpenType) fonts.

Note: Internet Explorer 8 and earlier versions do not support the new @font-face rules.

8.9.3. Use the font you need

In the new @font-face in the rule, you must first define the name of the font (such as myFirstFont), and then point to the font file.

Image1

Tip: please use lowercase letters in URL. Uppercase letters can produce unexpected results in IE.

To use fonts for HTML elements, use the font-family property to reference the name of the font (myFirstFont):

Example

<style> @font-face { font-family: myFirstFont; src: url(sansation_light.woff); } div { font-family:myFirstFont; } style>     

8.9.4. Use bold text

You must add another one that contains bold text @font-face rules:

Example

@font-face { font-family: myFirstFont; src: url(sansation_bold.woff); font-weight:bold; } 

This file “Sansation_Bold.ttf” is another font file that contains Sansation the bold type of the font.

Browsers should appear in bold when using the font family “myFirstFont” of this text.

So you can have many of the same fonts. @font-face the rules.

8.9.5. CSS3 font description

The following table lists all the font descriptions and the @font-face rule definition:

Descriptor

Value

Description

Font-family

Name

Necessary. Specifies the name of the font.

Src

URL

Necessary. Defines the URL of the font file.

Font-stretch

Normal

Optional. Defines how fonts are stretched. Default is “normal”.

Condensed

Ultra-condensed

Extra-condensed

Semi-condensed

Expanded

Semi-expanded

extra-expanded

Ultra-expanded

Font-style

Normal

Optional. Defines the style of the font. Default is “normal”.

Italic

Oblique

Font-weight

Normal

Optional. Defines the weight of the font. Default is “normal”.

Bold

100

200

300

400

500

600

700

800

900

Unicode-range

Unicode-range

Optional. Defines the range of UNICODE characters supported by fonts. The default is “Ubuno-10FFFF”.

《地理信息系统原理、技术与方法》  97

最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。