Evince 中的字体错误

Tim*_*Tim 3 fonts pdf evince

当我从终端在 Evince 中打开pdf 文件时:

I/O Error: Cannot open '/usr/local/texlive/2014/texmf-dist/fonts/opentype/public/tex-gyre/texgyrecursor-regular.otf'
Syntax Error: failed to load truetype font<0a>
some font thing failed
Run Code Online (Sandbox Code Playgroud)

有一些程序代码未显示在 pdf 文件中。我想知道错误意味着什么以及我能做什么?谢谢。

Apt*_*ryx 5

该问题是由于 Evince 的 AppArmor 配置文件造成的,它限制了 Evince 可用的文件资源。

因为 TexLive 字体可供系统使用,所以在某些情况下它们可能会被 Evince 接收(在我的系统上,/etc/fonts/conf.avail/30-metric-aliases.conf 中定义了一个规则,它绑定了“ Tex Gyre Heros”和“Helvetica”。因为我没有安装 Helvetica 字体,Tex Gyre Heros 被 fontconfig 选中)。

错误消息有点误导,但如果您查看内核日志(dmesg在控制台中键入,或tail -f /var/log/syslog),您会看到错误消息,例如:

[345695.334701] type=1400 audit(1462672575.673:72990): apparmor="DENIED" operation="open" profile="/usr/bin/evince" name="/usr/local/texlive/2015/texmf-dist/fonts/opentype/public/tex-gyre/texgyreheros-regular.otf" pid=31050 comm="EvJobScheduler" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Run Code Online (Sandbox Code Playgroud)

要授予 Evince 对您的 TexLive 字体的读取访问权限,您可以在文件中添加以下规则/etc/apparmor.d/local/usr.bin.evince

/usr/local/texlive/**/public/** r,
Run Code Online (Sandbox Code Playgroud)

保存文件并通过发出(在终端中)重新加载规则:

sudo service apparmor reload
Run Code Online (Sandbox Code Playgroud)

并退出任何打开的 Evince 实例。下次您在 Evince 中打开 PDF 文件时,它应该可以正确显示您的 PDF,并可以访问所需的字体。