CentOS Linux安装中文字体库,解决中文乱码问题

35 篇文章 0 订阅

CentOS Linux安装中文字体库,解决中文乱码问题

原因

CentOS中没有安装中文字体库,会出现中文乱码问题,解决问题需安装中文字库

解决步骤

Centos7系统添加Windows中文字体

查看centos系统的字体库

fc-list :lang=zh

在这里插入图片描述

进入到该字体库的目录

cd /usr/share/fonts
mkdir chinese 

将本地windows 的字体库(C:\Windows\Fonts)拷贝至chinese目录下。
注意将ttc 后缀改为ttf

执行命令:mkfontscale

执行命令:mkfontdir ,执行此命令遇到入下错误时,可直接将vga936.fon文件删除。然后再开始
(按关键字查找扩展名的命令为:find / -name "*.fon"
删除查找出的内容命令为: find / -name "*.fon" | xargs rm -rf

在这里插入图片描述

执行命令:fc-cache

再次查看字体库,显示如下就安装成功

在这里插入图片描述

fc-list

fc-list
FC-LIST(1)                                                          FC-LIST(1)

NAME
       fc-list - list available fonts

SYNOPSIS
       fc-list  [ -vVh ]  [ --verbose ]  [  [ -f format ]  [ --format format ]
       ]  [  [ -q ]  [ --quiet ]  ]  [ --version ]  [ --help ]

        [ pattern  [ element... ]   ]

DESCRIPTION
       fc-list lists fonts and styles available on the system for applications
       using  fontconfig.   If  any  elements  are  specified,  only those are
       printed.  Otherwise family and style are printed, unless verbose output
       is requested.

OPTIONS
       This  program  follows  the  usual  GNU  command line syntax, with long
       options starting with  two  dashes  (`-').  A  summary  of  options  is
       included below.

       -v     Print  verbose  output of the whole font pattern for each match,
              or elements if any is provided.

       -f     Format output according to the format specifier format.

       -q     Suppress all normal output. returns 1 as the error  code  if  no
              fonts matched.

       -V     Show version of the program and exit.

       -h     Show summary of options.

       pattern
              If  this  argument  is set, only fonts matching pattern are dis-
              played.

       element
              If set, the element property is displayed for matching fonts.

EXAMPLES
       fc-list
              Lists all font faces.

       fc-list :lang=hi
              Lists font faces that cover Hindi.

       fc-list : family style file spacing
              Lists the filename and spacing value for each font  face.  ``:''
              is an empty pattern that matches all fonts.

SEE ALSO
       fc-match(1)  FcFontList(3) FcPatternFormat(3) fc-cat(1) fc-cache(1) fc-
       pattern(1) fc-query(1) fc-scan(1)

       The fontconfig user's guide, in  HTML  format:  /usr/share/doc/fontcon-
       fig/fontconfig-user.html.


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值