毕竟是老外的框架,默认的字体大小弄个11px
明显不符合中国国情,不够和谐
不过还好,RichFaces与其他JAVA开源框架一样,提供了很强大的定制功能
只需三步即可修正这个问题
一、复制
richfaces-impl.jar/META-INF/skins/DEFAULT.skin.properties至
ClassPath下
并改名为
common.skin.properties
二、修改其中与字体大小相关的设置,将11px改为12px,如下
generalSizeFont=12px
headerSizeFont=12px
tabSizeFont=12
buttonSizeFont=12 (这两个为啥没有px?)
再顺便将默认字体也改下,首选宋体(SimSun),如下
generalFamilyFont=SimSun, Arial, Verdana, sans-serif
headerFamilyFont=SimSun, Arial, Verdana, sans-serif
tabFamilyFont=SimSun, Arial, Verdana, sans-serif
buttonFamilyFont=SimSun, Arial, Verdana, sans-serif
三、web.xml添加一行配置
<context-param>
<param-name>org.richfaces.SKIN</param-name>
<param-value>common</param-value>
</context-param>
启动服务 查看页面 太和谐了...
附上最终配置
#Colors
headerBackgroundColor=#D4CFC7
headerGradientColor=#EDEAE6
headerTextColor=#000000
headerWeightFont=bold
generalBackgroundColor=#FFFFFF
generalTextColor=#000000
generalSizeFont=12px
generalFamilyFont=SimSun, Arial, Verdana, sans-serif
controlTextColor=#000000
controlBackgroundColor=#ffffff
additionalBackgroundColor=#F1EEE9
shadowBackgroundColor=#000000
shadowOpacity=1
panelBorderColor=#C4C0B9
subBorderColor=#ffffff
tabBackgroundColor=#E3DED5
tabDisabledTextColor=#B1ADA7
trimColor=#DFDCD5
tipBackgroundColor=\#FAE6B0
tipBorderColor=\#E5973E
selectControlColor=#E79A00
generalLinkColor=#0078D0
hoverLinkColor=#0090FF
visitedLinkColor=#0090FF
# Fonts
headerSizeFont=12px
headerFamilyFont=SimSun, Arial, Verdana, sans-serif
tabSizeFont=12
tabFamilyFont=SimSun, Arial, Verdana, sans-serif
buttonSizeFont=12
buttonFamilyFont=SimSun, Arial, Verdana, sans-serif
tableBackgroundColor=#FFFFFF
tableFooterBackgroundColor=#cccccc
tableSubfooterBackgroundColor=#f1f1f1
tableBorderColor=#C4C0C9
tableBorderWidth=1px
#Calendar colors
calendarWeekBackgroundColor=#F1EEE9
calendarHolidaysBackgroundColor=#FFEBDA
calendarHolidaysTextColor=#FF7800
calendarCurrentBackgroundColor=#FF7800
calendarCurrentTextColor=#FFEBDA
calendarSpecBackgroundColor=#F1EEE9
calendarSpecTextColor=#000000
warningColor=#FFE6E6
warningBackgroundColor=#FF0000
editorBackgroundColor=#F1F1F1
editBackgroundColor=#FEFFDA
#Gradients
gradientType=plain