Lable Chinese in weathmap of centos7 cacti
First of all, the following: in order to display Chinese, the local field must have Chinese fonts, the newly installed linux does not install the field library, and the corresponding fonts. Let's take the msyh.ttf font as an example.
1. Fc-list to view the font library
2. Yum-y install fontconfig installation
3. After installation, there are two more directories, fonts and fontconfig, in the / usr/share directory
4. First create a new directory chinese under the / usr/shared/fonts directory
Here seems to support only msyh.ttf fonts, copy other fonts did not succeed, maybe the face will not be black.
5. Upload the fonts you need to / usr/shared/fonts/chinese directory to C:\ Windows\ Fonts directory
6. Modify chinese permissions: chmod-R 755 / usr/share/fonts/chinese
7. Next, you need to install ttmkfdir to search all the font information in the directory and generate a fonts.scale file.
Enter the command: yum-y install ttmkfdir
In fact, whether this step is done or not OK, I can try to see more, I did not succeed.
8. The last step is to modify the font configuration file. First, open the configuration file through the editor:
Vi / etc/fonts/fonts.conf
/ usr/share/fonts
/ usr/share/X11/fonts/Type1 / usr/share/X11/fonts/TTF / usr/local/share/fonts
Fonts
/ usr/share/fonts/chinese
~ / .fonts
9. Fc-cache refresh
10. Fc-list can see the configuration just now.
-
Go to configs of weathmap and modify the corresponding file, which is the same as the path where the font is located.
Profile Settings:
# 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 # the defined font here must be written, otherwise it is still garbled.
MAXVALUE 100
# TEMPLATE-only LINKs:
# regular NODEs:
NODE node07372
LABEL test
POSITION 360 131
# regular LINKs:
# That's All Folks!
Enter cacti through the web page and modify the corresponding path.