【问题标题】:Octave Fontconfig error八度字体配置错误
【发布时间】:2016-05-16 22:46:41
【问题描述】:

我使用 here 给出的说明通过 Homebrew 安装了 Octave。

当我尝试生成绘图时,我收到以下消息:

Fontconfig error: Cannot load default config file
warning: could not match any font: *-normal-normal-10
warning: called from
    axes at line 66 column 10
    gca at line 58 column 9
    newplot at line 148 column 8
    surf at line 70 column 9
    sombrero at line 65 column 5

然后我收到一长串以下消息:

warning: ft_render: unable to load appropriate font
warning: could not match any font: *-normal-normal-10

通常情节会出现一次,但如果我再次调用它,Octave 会退出并显示以下消息。

panic: Segmentation fault: 11 -- stopping myself...
attempting to save variables to 'octave-workspace'...
warning: unable to open 'octave-workspace' for writing...
warning: called from
    __gnuplot_drawnow__>gnuplot_trim_term at line 368 column 10
    __gnuplot_drawnow__>gnuplot_set_term at line 119 column 20
    __gnuplot_drawnow__ at line 84 column 16
Segmentation fault: 11

在讨论类似错误时,我经常看到对 /etc/fonts/fonts.conf 的引用。我的 /etc 目录不包含字体子目录。这可能是问题的根源,但我不知道如何解决它。当我运行时,brew install fontconfig,我得到Warning: fontconfig-2.11.1_1 already installed。当我运行sudo find / -name fonts.conf 时,我得到/opt/X11/lib/X11/fontconfig/fonts.conf

brew doctor 产生以下警告,可能是相关的,我不知道如何修复(没有卸载 Anaconda):

Warning: Anaconda is known to frequently break Homebrew builds, including Vim 
and MacVim, due to bundling many duplicates of system and Homebrew-available
tools.

If you encounter a build failure please temporarily remove Anaconda
from your $PATH and attempt the build again prior to reporting the
failure to us. Thanks!

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
    /Users/greg/anaconda/bin/curl-config
    /Users/greg/anaconda/bin/freetype-config
    /Users/greg/anaconda/bin/libdynd-config
    /Users/greg/anaconda/bin/libpng-config
    /Users/greg/anaconda/bin/libpng16-config
    /Users/greg/anaconda/bin/python-config
    /Users/greg/anaconda/bin/python2-config
    /Users/greg/anaconda/bin/python2.7-config
    /Users/greg/anaconda/bin/xml2-config
    /Users/greg/anaconda/bin/xslt-config

我正在运行 OS X 10.11.3 (El Capitan)。

【问题讨论】:

    标签: homebrew octave fontconfig


    【解决方案1】:

    实际上,这不是 Octave 的问题,而是它的复杂设置和其他实用程序(尤其是 fontconfig)的错误配置。

    为了正常工作,您需要手动设置 fontconfig 的路径,这样它就不会在不适当的目录中查找字体(/etc/fonts 适用于 Linux 安装,但 OS X XQuartz 会转到不同的位置)。

    您应该运行命令export FONTCONFIG_PATH=/opt/X11/lib/X11/fontconfig 以正确设置fontconfig。您也可以将行 export FONTCONFIG_PATH=/opt/X11/lib/X11/fontconfig 添加到您的 ~/.bash_profile 并重新启动您的终端,这样您就不需要再运行此命令了。

    【讨论】:

    • 有没有一种有效的方法来学习这些技术?也许我可以读一本书来了解 bash 配置文件和 Unix 类型的文件系统是如何工作的?
    • 不幸的是,我不能推荐一些具体的东西,它来自经验和尝试和错误。我花了大约一个小时通过谷歌搜索错误消息并将其他人重现的问题与我的配置进行比较来解决此问题
    • 这帮了我很多 - 谢谢。注意:您需要安装 xquartz.org 才能正常工作。
    • 非常感谢您的回答。帮了大忙!
    • @OleGG 不禁为此称赞你。我现在要迟到 1 小时回家,而不是迟到 3 小时。谢谢!
    【解决方案2】:

    试试

    brew uninstall fontconfig
    
    brew install fontconfig --universal
    

    如果你没有或者不想用xquartz,可以用qt

    brew uninstall gnuplot
    
    brew install gnuplot --with-qt
    

    【讨论】:

    • 希望我能告诉你在找到这个答案之前我尝试了多少东西。非常感谢
    • 在 - brew install gnuplot --with-qt 上收到不推荐使用的警告。这有效: brew install gnuplot --with-qt5
    • 这适用于 OSX 10.11.6 (El Capitan) 和 Octave 4.0.3。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-11
    相关资源
    最近更新 更多