---
title: "宋体字体添加到LINUX "
author: "jguangyou"
date: "2012-04-23T14:12:02Z"
tags: []
categories: ["操作系统"]
slug: "linux"
draft: false
lastmod: "2012-04-23T14:12:02Z"
id: 1495391
url: "https://deep-fish.iteye.com/blog/1495391"
---

1.将simsun.ttc拷贝到/usr/share/fonts/zh\_CN/TrueType

#cp simsun.ttc /usr/share/fonts/zh\_CN/TrueType  
\# 使用以下命令来更新字体信息：  
ttmkfdir -d /usr/share/fonts/zh\_CN/TrueType/ -o /usr/share/fonts/zh\_CN/TrueType/fonts.dir" 然后:  
把 fonts.dir 拷贝出来一份 fonts.scale.  
#chkfontpath --add /usr/share/fonts/zh\_CN/

2.更新字体缓存

#fc-cache -v /usr/share/fonts/

3.在JDK中生效  
拷贝font.properties.zh到$JAVA\_HOME/jre/lib目录中，将zysong.ttf替换为simsun.ttc (最下面一行)