[2007-07-21] 如何用gedit打开GBK编码的文本文件
=================================================================
gedit:
一直以来,只在"Edit/Proferences"中去找配置项,不料却在"Open Files..."对话框中。
GNOME Terminal:
较早明白,通过"Terminal/Set Character Encoding/Add or Remove"打开"Add or Remove Terminal Encodings"对话框。
这是一个命令行环境,不知有执行"Set Character Encoding"功能的命令没有?
[2007-03-28] 使用ps2pdf时遭遇invalidfont问题:
=================================================================
wxq@wxq-desktop:~/ubuntu$ man -t libtiff > libtiff.ps
wxq@wxq-desktop:~/ubuntu$ ps2pdf libtiff.ps libtiff.pdf
ERROR: /invalidfont in findfont
Operand stack:
Times-Italic@0 --nostringval-- Times-Italic Font Times-Italic 370765 Times-Italic --nostringval-- Times-Italic NimbusRomNo9L-ReguItal
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- 3 4 %oparray_pop 4 4 %oparray_pop --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 7 5 %oparray_pop --nostringval-- --nostringval-- --nostringval-- 1 -1 1 --nostringval-- %for_neg_int_continue
Dictionary stack:
--dict:1121/1686(ro)(G)-- --dict:0/20(G)-- --dict:81/200(L)-- --dict:59/120(L)-- --dict:17/17(ro)(G)-- --dict:1121/1686(ro)(G)--
Current allocation mode is local
Last OS error: 2
Current file position is 5291
ESP Ghostscript 815.02: Unrecoverable error, exit code 1
wxq@wxq-desktop:~/ubuntu$
上下求索:
看过 ps2pdf: invalidfont in findfont,知道这个问题与整个ghostscript包的字体搜索机制有关。gv libtiff.ps也一样提示invalidfont in findfont。按该文提示打gs -h:
Search path:
. : /usr/share/gs-esp/8.15/lib : /usr/share/gs-esp/8.15/Resource :
/usr/share/gs-esp/fonts : /var/lib/defoma/gs.d/dirs/fonts :
/usr/share/cups/fonts : /usr/share/ghostscript/fonts :
/usr/local/lib/ghostscript/fonts
For more information, see /usr/share/doc/gs-esp/Use.htm.
于是又看帮助文件/usr/share/doc/gs-esp/Use.htm,知道要到Search Path中去寻找Fontmap。
Search Path中有两个Fontmap文件:/usr/share/gs-esp/8.15/lib/Fontmap和/var/lib/defoma/gs.d/dir/fonts/Fontmap。找到了映射链:Times-Italic -> NimbusRomNo9L-ReguItal -> n0210231.pfb,但只有/var/lib/defoma/gs.d/dir/fonts/目录中存在n0210231.pfb。
ls -l n0210231.*,发现它是一个指向/usr/share/fonts/type1/gsfonts/n0210231.pfb的符号连接(symbolic link)。重要线索:该符号连接破了!而且/var/lib/defoma/gs.d/dir/fonts/目录中有几十个破了的符号连接!T42主机上的ps2pdf(ghostscript组件)工作正常,其/usr/share/fonts/type1/gsfonts/目录下有35个pfb文件。而desktop主机上该目录下只有9个pfb文件!/var/lib/defoma/gs.d/dir/fonts/目录下几十个残破的符号连接表明,/usr/share/fonts/type1/gsfonts/目录下被非正常地删除了几十个pfb文件!
办法:在尚不完全清楚哪个deb包负责这些文件的安装的情况下,我只好把T42主机上/usr/share/fonts/type1/gsfonts目录下的所有文件拷贝过来。然后运行gv libtiff.ps,工作正常!问题暂时得以解决。
存疑:
但是,这个局面是怎么造成的——是谁、什么情况下删除了/usr/share/fonts/type1/gsfonts/目录下的众多文件?只知道,我没有有意识地在/usr/share/fonts/type1/gsfonts/目录下删除过文件,也应该没有其他人删除过desktop主机上的文件。我曾经通过ubuntu的“字体文件夹”界面删除过很多字体文件,或许就是这样的删除字体动作造成这个目录下众多pfb文件的消失?有待将来去搞清楚。
别人对这个问题的阐述:
goldfisch.at-knowledgebase
=================================================================
gedit:
一直以来,只在"Edit/Proferences"中去找配置项,不料却在"Open Files..."对话框中。
GNOME Terminal:
较早明白,通过"Terminal/Set Character Encoding/Add or Remove"打开"Add or Remove Terminal Encodings"对话框。
这是一个命令行环境,不知有执行"Set Character Encoding"功能的命令没有?
[2007-03-28] 使用ps2pdf时遭遇invalidfont问题:
=================================================================
wxq@wxq-desktop:~/ubuntu$ man -t libtiff > libtiff.ps
wxq@wxq-desktop:~/ubuntu$ ps2pdf libtiff.ps libtiff.pdf
ERROR: /invalidfont in findfont
Operand stack:
Times-Italic@0 --nostringval-- Times-Italic Font Times-Italic 370765 Times-Italic --nostringval-- Times-Italic NimbusRomNo9L-ReguItal
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- 3 4 %oparray_pop 4 4 %oparray_pop --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 7 5 %oparray_pop --nostringval-- --nostringval-- --nostringval-- 1 -1 1 --nostringval-- %for_neg_int_continue
Dictionary stack:
--dict:1121/1686(ro)(G)-- --dict:0/20(G)-- --dict:81/200(L)-- --dict:59/120(L)-- --dict:17/17(ro)(G)-- --dict:1121/1686(ro)(G)--
Current allocation mode is local
Last OS error: 2
Current file position is 5291
ESP Ghostscript 815.02: Unrecoverable error, exit code 1
wxq@wxq-desktop:~/ubuntu$
上下求索:
看过 ps2pdf: invalidfont in findfont,知道这个问题与整个ghostscript包的字体搜索机制有关。gv libtiff.ps也一样提示invalidfont in findfont。按该文提示打gs -h:
Search path:
. : /usr/share/gs-esp/8.15/lib : /usr/share/gs-esp/8.15/Resource :
/usr/share/gs-esp/fonts : /var/lib/defoma/gs.d/dirs/fonts :
/usr/share/cups/fonts : /usr/share/ghostscript/fonts :
/usr/local/lib/ghostscript/fonts
For more information, see /usr/share/doc/gs-esp/Use.htm.
于是又看帮助文件/usr/share/doc/gs-esp/Use.htm,知道要到Search Path中去寻找Fontmap。
Search Path中有两个Fontmap文件:/usr/share/gs-esp/8.15/lib/Fontmap和/var/lib/defoma/gs.d/dir/fonts/Fontmap。找到了映射链:Times-Italic -> NimbusRomNo9L-ReguItal -> n0210231.pfb,但只有/var/lib/defoma/gs.d/dir/fonts/目录中存在n0210231.pfb。
ls -l n0210231.*,发现它是一个指向/usr/share/fonts/type1/gsfonts/n0210231.pfb的符号连接(symbolic link)。重要线索:该符号连接破了!而且/var/lib/defoma/gs.d/dir/fonts/目录中有几十个破了的符号连接!T42主机上的ps2pdf(ghostscript组件)工作正常,其/usr/share/fonts/type1/gsfonts/目录下有35个pfb文件。而desktop主机上该目录下只有9个pfb文件!/var/lib/defoma/gs.d/dir/fonts/目录下几十个残破的符号连接表明,/usr/share/fonts/type1/gsfonts/目录下被非正常地删除了几十个pfb文件!
办法:在尚不完全清楚哪个deb包负责这些文件的安装的情况下,我只好把T42主机上/usr/share/fonts/type1/gsfonts目录下的所有文件拷贝过来。然后运行gv libtiff.ps,工作正常!问题暂时得以解决。
存疑:
但是,这个局面是怎么造成的——是谁、什么情况下删除了/usr/share/fonts/type1/gsfonts/目录下的众多文件?只知道,我没有有意识地在/usr/share/fonts/type1/gsfonts/目录下删除过文件,也应该没有其他人删除过desktop主机上的文件。我曾经通过ubuntu的“字体文件夹”界面删除过很多字体文件,或许就是这样的删除字体动作造成这个目录下众多pfb文件的消失?有待将来去搞清楚。
别人对这个问题的阐述:
goldfisch.at-knowledgebase