首先說明下:要想顯示中文,本地的字段裏面必需要有中文字體,新裝的linux沒有安裝字段庫,和相應的字體。下面以msyh.ttf字體爲例來講明。
一、fc-list查看字體庫
二、yum -y install fontconfig安裝
三、安裝好後/usr/share目錄下多兩個目錄fonts和fontconfigphp
四、首先在/usr/shared/fonts目錄下新建一個目錄chinesenode
這裏貌似只支持msyh.ttf字體,拷貝其餘字體沒成功,也許哪會臉黑。
五、到C:\Windows\Fonts目錄下上傳你須要的字體到/usr/shared/fonts/chinese目錄下linux
六、修改chinese權限:chmod -R 755 /usr/share/fonts/chinesecentos
七、接下來須要安裝ttmkfdir來搜索目錄中全部的字體信息,並彙總生成fonts.scale文件,
輸入命令:yum -y install ttmkfdir編輯器
其實這步作不作都OK得,本身能夠多嘗試看下,我本身是沒成功
八、最後一步就是修改字體配置文件了,首先經過編輯器打開配置文件:ide
vi /etc/fonts/fonts.conf測試
<!-- Font directory list -->
<dir>/usr/share/fonts</dir>
<dir>/usr/share/X11/fonts/Type1</dir> <dir>/usr/share/X11/fonts/TTF</dir> <dir>/usr/local/share/fonts</dir>
<dir prefix="xdg">fonts</dir>
<dir>/usr/share/fonts/chinese<dir> <!-- 這裏是重點 -->
<!-- the following element will be removed in the future -->
<dir>~/.fonts</dir>字體
九、fc-cache刷新centos7
十、fc-list能夠看到剛剛的配置了
————————————————element
進入到weathmap的configs下修改對應的文件,和字體所在路徑一致便可
配置文件設置:
#Automatically generated by php-weathermap v0.98a
FONTDEFINE 100 /usr/share/fonts/chinese/msyh.ttf 10
#End of global section
#TEMPLATE-only NODEs:
NODE DEFAULT
LABELFONT 100 #這裏的定義字體必需要寫的,否則仍是亂碼
MAXVALUE 100
#TEMPLATE-only LINKs:
#regular NODEs:
NODE node07372
LABEL 測試
POSITION 360 131
#regular LINKs:
#That's All Folks!
經過網頁進入cacti,修改相應的路徑。