解决ubuntu GNUStep GUI程序运行错误的问题

在ubuntu中,默认安装GNUStep后,GUI程序运行不能,如ProjectCenter,Gorm等。

通过命令行运行发现跟缺少字体设置有关。

今天在github找到了解决答案:

https://github.com/michaelwisely/GNUstep-Sudoku

以下引用原作者的决绝方法:

Sudoku! is a simple sudoku game written in Objective-C using the GNUStep 
libraries.

If you are using the libgnustep-art gui back and are getting errors 
like these...

2010-12-29 13:26:34.672 Gorm[3580] The font specified for NSFont, FreeSans, can't be found.
2010-12-29 13:26:34.672 Gorm[3580] Font not found FreeSans
2010-12-29 13:26:34.672 Gorm[3580] Font not found Helvetica
2010-12-29 13:26:34.672 Gorm[3580] Font not found Helvetica
2010-12-29 13:26:34.672 Gorm[3580] Font not found Courier
2010-12-29 13:26:34.672 Gorm[3580] Font not found Fixed
2010-12-29 13:26:34.672 Gorm[3580] Font not found FreeSans
2010-12-29 13:26:34.672 Gorm[3580] The font specified ...

you have to create some .nfonts for GNUstep. In the ubuntu software repos, 
there's a tool named mknfonts.tool which reads .ttf font files (among others) 
and turns them into .nfont files. To make your .nfonts, do something like...

      ## Make the fonts and leave them in the Fonts directory
      cd /usr/share/GNUstep/Fonts
      mknfonts /usr/share/fonts/truetype/freefont/*

      ## Set the defaults for NSFont to something other than Helvetica
      defaults write NSGlobalDomain NSFont <font name>

Since FreeSans was one of the fonts mknfonts generated on my system, I ran...

      defaults write NSGlobalDomain NSFont FreeSans

 简而言之:

1.安装mknfonts.tool

   sudo apt-get install mknfonts.tool

2. cd /usr/share/GNUstep/Fonts
   sudo  mknfonts /usr/share/fonts/truetype/freefont/*
3. defaults write NSGlobalDomain NSFont FreeSans
4.OK


 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值