很多pdf文件的字体没有嵌入到文件中,以致于在windows下可以正常阅读到文件在linux下面是乱码或者不显示相关内容,为解决这一问题,可以为pdf文件分配单一的字体。
代码如下:
<?xml version=”1.0″?>
<!DOCTYPE fontconfig SYSTEM “fonts.dtd”>
<fontconfig>
<!–
If the font still has no generic name, add sans-serif
–>
<match target=”pattern”>
<test qual=”all” name=”family” compare=”not_eq”>
<string>URW Bookman L</string>
</test>
<test qual=”all” name=”family” compare=”not_eq”>
<string>URW Bookman L</string>
</test>
<test qual=”all” name=”family” compare=”not_eq”>
<string>URW Bookman L</string>
</test>
<edit name=”family” mode=”append_last”>
<string>URW Bookman L</string>
</edit>
</match>
</fontconfig>
将上述代码拷贝至新建文件中,命名为:49-sansserif.conf,并将文件移动至:/etc/fonts/conf.d/49-sansserif.conf。
如果仍然不起作用,在终端输入下列代码:
sudo apt-get install poppler-data