Thursday Feb 05, 2009

由fontconfig 到CSS

在学习fontconfig的配置的时候看到介绍,fontconfig的配置格式解析算法使用的是css2 (Cascading Style Sheets)。自然就计入CSS的主页看了,发现这个专业自动提供很多语言的翻译,其中自然还有中文的CSS主页。这下对于不喜欢读英文的朋友可以说是个福音了。
重叠样式表 (CSS) 是一种为 Web 文档添加样式(例如字体、颜色和边距)简单机制。
举个例子,假如在一个页面或整个网站中,要求凡是标题都为  H1  、黑体字及蓝色,正文则为  4  号字、宋体及黄色,这是一种风格,也即  "  样式  "  ,通过样式表来实现这种风格。  具体的内容大家自己看吧。


The current Fontconfig matching algorithm was inherited from Xft; it was designed to provide a
mechanism similar to cascading style sheets but without actually studying and duplicating that
specification. As the differences are minor, and essentially unwarranted, the matching algorithm in
Fontconfig will be changed to make performing CSS2-style matching more convenient.
There are aspects of CSS2 which Fontconfig cannot perform, in particular, it has no context in which to
interpret terms like “bolder”, “larger” or “wider”. These must still be interpreted by the application.
However, the weight fill-in and slant substitution specifications can easily be replicated, and the relative
weight operators can be handled with some application assistance.
The resulting matching mechanism will be useful wherever CSS2 is used, and also provide a more
accessible specification as developers and users become comfortable using the CSS2 font specification
mechanisms.

About

williamxue

Search

Archives
« July 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  
       
Today