下面就把flex设置字体的方法大体列举几种,以供参考。
1. 引用外部字体库的方法:
1
2
3
4
5
6
7
|
@font-face { font-family:FZHY; //这个名字可以随便设置 src:url( "FZHY.TTF" ); //使用相对路径 } |
2. 设置错误提示的字体(使用Validator控件时):
1
2
3
4
5
|
.errorTip{ font-family:FZHY; font-size:14px; font-weight:normal; } |
3. 设置ToolTip的字体(一般默认的字体很小,特别难看清楚,所以一般情况需要设置该值):
1
2
3
4
|
ToolTip{ font-family:FZHY; font-size:14px; } |
4. 设置TabNavigator的字体:
1
2
3
4
5
6
7
8
9
|
TabNavigator{ font-size:14px; font-family:FZHY; selected-tab-text-style-name:common; //设置navigator的选项卡字体样式 } .common{ font-family:FZHY; font-size:14px; } |
5. 设置DataGrid标题的样式:
1
2
3
|
DataGrid{ header-style-name:common; } |
6. 设置日期输入框的字体样式:
1
2
3
4
5
6
7
8
|
DateField{ date-chooser-style-name:dateChooserStyle; } .dateChooserStyle{ header-style-name:common; //设置年月的样式 week-day-style-name:common; //设置日的样式 } |
7. 设置其他基础控件的样式(用控件类型名进行定义,自动应用到相应类型的控件):
1
2
3
4
5
6
7
8
9
10
11
12
13
|
Button{ font-family:FZHY; font-weight:normal; } Canvas{ font-family:FZHY; font-weight:normal; } ComboBox{ fontWeight:normal; } |