2005年3月31日 星期四
新闻: Slackware删除GNOME
虽然Dropline GNOME等的存在也是一个诱因,虽然我喜欢GNOME界面的简洁,但GNOME安装之麻烦似乎也是不争的事实:
use full-featured desktop on Linux. I guess easy to use doesn't mean
easy to package."
"At one point, I had a printout of all the deps for Gnome. It was a huge
spiderweb of tangles that had to be decoded and followed exactly to get
Gnome to build."
"Have you ever tried to build GNOME?! Just take a look at the build scripts [uky.edu] for the two in Slackware. KDE has a unified build script. GNOME is a dependency nightmare."
我当初搞CyGNOME-2的
时候也是被六、七十个包搞得晕头,后来部分包被Gerrit P. Haase和Yaakov Selkowitz加入了cygwin正式版本,
而桌面部分又不搞,而且对于他们不肯采用独立的prefix我觉得很不爽,因为这样的话非“官方”包不好维护了,索性不搞了。
不过从讨论中来看XFCE倒是获得了众口一致的好评。嗯,看来有必要更新cygwin port了。
Patrick在ChangeLog里面详细解释了原因:
gnome/*:
Removed from -current, and turned over to community support and distribution. I'm not going to rehash all the reasons behind this, but it's been under consideration for more than four years. There are already good projects in place to provide Slackware GNOME for those who want it, and these are more complete than what Slackware has shipped in the past. So, if you're looking for GNOME for Slackware -current, I would recommend looking at these two projects for well-built packages that follow a policy of minimal interference with the base Slackware system:
http://gsb.sf.net
http://gware.sf.net
There is also Dropline, of course, which is quite popular. However, due to their policy of adding PAM and replacing large system packages (like the entire X11 system) with their own versions, I can't give quite the same sort of nod to Dropline. Nevertheless, it remains another choice, and it's _your_ system, so I will also mention their project:
http://www.dropline.net/gnome/
Please do not incorrectly interpret any of this as a slight against GNOME itself, which (although it does usually need to be fixed and polished beyond the way it ships from upstream more so than, say, KDE or XFce) is a decent desktop choice. So are a lot of others, but Slackware does not need to ship every choice. GNOME is and always has been a moving target (even the "stable" releases usually aren't quite ready yet) that really does demand a team to keep up on all the changes (many of which are not always well documented). I fully expect that this move will improve the quality of both Slackware itself, and the quality (and quantity) of the GNOME options available for it.
Folks, this is how open source is supposed to work. Enjoy. :-)
2005年3月30日 星期三
foobar2k/winamp + cdplayer.ini
foobar2000:
http://www.digitalblues.org
http://www.hydrogenaudio.org
winamp:
http://www.url.ru/~copah
http://www.mpex.net/software
[@more@]
先后用过好多种CD播放软件,常常在里面输入CD和曲目的名称,但换个工具后又要重新输入,麻烦的紧。
解决这个问题的一个方法是采用支持CDDB的播放器,将曲目名称上载到一个服务器上。
但并不总是在线上,于是开始寻找一个可以交换数据的方式。
我还是比较喜欢win98下的CD播放器,它将数据保存在cdplayer.ini,文本文件,很直观的一种方式。
但win2000里面的CD播放器是另外一个样子,win98的cdplayer.exe拿过来又不能用。
所以后来我将一个用作Delphi示例的CD播放器修改了一下,添加了cdplayer.ini支持,
但其实现在更多地是在用foobar2000和winamp在播放音乐,所以想找相应的插件。
标签: windows
2005年3月28日 星期一
搞到Knoppix Hacks一书电子件
2005年3月25日 星期五
给Knoppix动态添加软件(7)

安装很简单,将deb包解开,将所有文件拷贝到~/.dist/(当然删除那些用不着的文件)
然后在~/.dist/bin下添加一个wrapper
另外还从apt-get上搜索了一个krename,将可执行文件拷贝到路径上就可以了。Krusader 调用它来做批量重命名。
本来想直接用Windows里面安装上的Total Commander,但这次感觉跑起来很不流畅(以前都挺好的)
Krusader似乎也是在模仿TC, 很多功能都是跟它做得一样。这也不奇怪,毕竟TC可以稳坐第一把交椅。不过Krusader有个很好的地方就是集成了Konsole,很方便吧(见上图)。
以前搞cygnome时用过gnome-commander, 也是在学习TC,但它需要FAM的支持才能刷新文件夹,而且对于压缩包的支持也一直不加(作者说他是想用gnome-vfs来做),加上更新又很慢.... 反正在Cygwin下我也有rox, mc, 还有Windows下的TC; 在Linux上还有krusader 和 nautilus (虽然nautilus以前版本实在是不怎么样)
标签: knoppix, total commander
2005年3月24日 星期四
转: 不刻盘运行Knoppix
文章摘自: 不刻盘运行Knoppix和将Knoppix植入硬盘 (http://www.thinkjam.org/cgi-bin/blog/mt-tb.cgi/158)
巴蛮子注: 另外为了速度方面的考虑,Knoppix本身支持将光盘内容拷贝到硬盘运行
knoppix fromhd Skip checking for Knoppix on CD-ROM
knoppix fromhd=/dev/hda1 Boot from previously copied CD-Image
knoppix bootfrom=/dev/hda1 Access Image then boot from previously copied CD-Image (enables booting from NTFS / ReiserFS) ***)
knoppix bootfrom=/dev/hda1/KNX.iso Access image, boot from ISO-Image. ***)
原文内容:
- 用虚拟光驱软件(如DAEMON Tools等)加载下载的光盘映像,然后进入虚拟成的光盘,将KNOPPIX目录拷贝到FAT32分区上,如D:KNOPPIX;
- 进 入Knoppix光盘的“bootisolinux”目录,将linux24和minirt24.gz拷贝到D盘根目录下(若您使用2.6.x内核,请 拷贝linux26和minirt26.gz),然后到http://elserv.ffm.fgan.de/~lermen/下载loadlin,解压 缩为loadlin.exe放到D盘根目录下;
- 在D盘根目录下建立一个批处理文件,例如knoppix.bat,其内容内容如下:
loadlin linux24 root=/dev/hda5 ramdisk_size=100000 init=/etc/init lang=cn apm=power-off vga=791 initrd=minirt24.gz nomce quiet BOOT_IMAGE=knoppix myconfig=scan
其中/dev/hda5是Knoppix所在的FAT32分区。Knoppix将主分区当做/dev/hda1,第一个从分区为/dev/hda5,第二 个从分区为/dev/hda6,依次类推,因此D盘是/dev/hda5。如果是第一次使用,可以去掉myconfig这个参数; - 用软盘、U盘启动盘或者vfloppy虚拟软驱等想办法进入dos界面;
- 进入你放置Knoppix的分区,输入knoppix.bat,就可进入Knoppix。
给Knoppix动态添加软件(6): Firefox, d4x
Firefox没有什么好说的,直接从mozilla.org下载一个二进制版本,解压到任何一个目录就可以了。只是注意大约需要22M空间,另外还得为cache什么的留些空间,所以HOME要足够大才行。

虽 然Knoppix有自带的kget, 但我还是喜欢d4x,于是从debian服务器上下载了编译好的版本,不需要做什么改动,将/usr/bin/nt拷贝到~/.dist/bin即可正常 运行,没有任何问题,如果想要中文显示的话,再拷贝一下/usr/share/locale/zh_CN/LC_MESSAGES下的mo。
为了让Firefox调用kget或者d4x,安装了一个flashgot插件,相当好使。(PATH内只有d4x的时候, flashgot是不认的,还必须得有nt才行,虽然d4x只是到nt的一个软链接)

2005年3月22日 星期二
给Knoppix动态添加中文支持(5)
stardict用到了gnome2的一些动态库,比如libgnome,libbonobo等,而Knoppix不带任何GNOME2的动态库(原来还有,但自从evolution被删除后就没有了),所以比较棘手。

讲一下大致步骤,细节就不说了。
OpenQ
-----OpenQ下载自Linux公社,是先编译好的gaim-1.0的版本
http://www.linuxfans.org/nuke/modules.php?name=Site_Downloads&op=geninfo&did=2879
1.将插件拷贝到~/.gaim/plugins/
2. 将表情图标(/usr/share/pixmaps/gaim/smileys)拷贝到~/.gaim/smileys
人物图标(/usr/share/pixmaps/gaim/status)不知道应该拷贝到什么地方。
难道要我再用一次mount --bind?
stardict
--------stardict用到了gnome2的一些动态库,比如libgnome,libbonobo等,而Knoppix不带任何GNOME2的动态库(原来还有,但自从evolution被删除后就没有了),所以比较棘手。
抱着试试看的想法,将用到的依赖库都拉下来了
libbonobo2-0_2.6.2-7_i386.deb
libbonobo2-common_2.6.2-7_i386.deb
libbonoboui2-0_2.6.1-1_i386.deb
libbonoboui2-common_2.6.1-1_all.deb
libgnome2-0_2.6.1.2-2_i386.deb
libgnome2-common_2.6.1.2-2_all.deb
libgnomecanvas2-0_2.6.1.1-2_i386.deb
libgnomecanvas2-common_2.6.1.1-2_all.deb
libgnome-keyring0_0.2.1-3_i386.deb
libgnomeui-0_2.6.1.1cvs-1_i386.deb
libgnomeui-common_2.6.1.1cvs-1_all.deb
libgnomevfs2-0_2.6.2-2_i386.deb
libgnomevfs2-common_2.6.2-2_i386.deb
stardict_2.4.3-5_i386.deb
stardict-common_2.4.3-5_all.deb
全部解压到~/Software/stardict(应为文件比较多,我采用了AppDirs模式, 将相关东西都放在一个目录下。
knx-live-inst发现某个module下面有exes这个文件就会采用AppDirs模式,并且对exes里面列出的程序在~/.dist/bin下创建wrapper)
删除无用的locale, doc, gtk-doc, help等文件
然后
perl -pi -e 's#/usr/share/stardict#./../share/stardict#g' ~/Software/stardict/usr/bin/stardict
再在~/Software/stardict/bin下添加一个wrapper script
#!/bin/sh
DESTDIR=${HOME}/Software/stardict
cd ${DESTDIR}/usr/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${DESTDIR}/usr/lib
exec ./stardict $*
这里跟以前不一样的就是多了LD_LIBRARY_PATH
试了一下,居然成功启动!
(其实stardict没有必要使用gnome库,因为并没有跟桌面其他部分的交互。用gtk库多简单)
03.24 补充: stardict不能修改设置的解决办法
今天发现stardict不能设置为“按下Ctrl键时取词"(其实是什么选项都改不了),这是因为gconf schema没有安装的缘故。因为knoppix上这些目录是不可写的,只要用点变通的办法:
关闭stardict和其他一些可能会用到gconf的程序(在Knoppix上并不多), 然后用gconftool-2 --shutdown停掉gconfd-2(用ps -ef看一下,如果有root启动的gconfd-2就得用root来停掉)
然后编辑~/.gconf/apps/stardict/preferences/dictionary/%gconf.xml(如果没有就创建一个)
按下面的内容修改,补充缺少的项就可以了
2005年3月21日 星期一
给Knoppix动态添加中文支持(4)

本来还想加上我比较喜欢的rox的,但因为官方版本对非UTF-8的文件名支持不好(以前我胡乱弄了个补丁),所以没弄。
而且似乎Knoppix上也没有必要用这个文件管理器,除非打算在性能差的机器上不用KDE做桌面。
stardict没有搞成功,因为需要很多gnome的库,
BTW: 刚发现debian上似乎非得用LANGUAGE这个环境变量才能让程序文字生效,比如LANGUAGE=zh_CN beep-media-player。但我在Cygwin上从来都是只用LANG和LC_MESSAEGS的。
1. GQview 1.4.5
这个比较简单,不需要读取什么数据文件,只要将usr/bin/gqview拷贝到~/.dist/bin就可以了。
但Help菜单下的几个菜单项会读取/usr/share/doc/gqview/README,我替换成了/home/knoppix/.gqview/README(恰好一样长!),不过不做这一步也没有问题。
如果想要中文翻译,将/usr/share/locale/zh_CN/LC_MESSAGES/gqview.mo拷贝到~/.dist/下相应的目录即可。因为我们前几天已经做了mount --bind映射了。
2. beep-media-player
Knoppix自带xmms, 但这个不如bmp好看,而且不用自己配置中文(只要有中文字体就可以了)——虽然xmms配置中文也不难
perl -pi -e 's#/usr/share/bmp#./../share/bmp#g' $DESTDIR/usr/bin/beep-media-player #注1
# add a wrapper
cat <
#!/bin/sh
cd `dirname $0`/../usr/bin
exec ./beep-media-player $*
EOF
chmod 755 $DESTDIR/bin/beep-media-player
#shared library required by bmp
cp beep-media-player/usr/lib/libbeep.so.2.0.0 $DESTDIR/lib
(cd $DESTDIR/lib && ln -s libbeep.so.2.0.0 libbeep.so.2 )
sudo ldconfig # is this really needed?
# data (glade,
rsync -Ha beep-media-player/usr/share/ $DESTDIR/usr/share/
# now the Skins dir. Let bmp share the same Skins with xmms
[ ! -d ~/.xmms/Skins ] && mkdir -p ~/.xmms/Skins
[ ! -d ~/.bmp/Skins ] && (cd ~/.bmp && ln -s ../.xmms/Skins .)
# now the Plugins dir.
[ ! -d ~/.bmp/Plugins ] && mkdir -p ~/.bmp/Plugins
rsync -Ha beep-media-player/usr/lib/bmp/ ~/.bmp/Plugins/ #注2
#1: 注意perl行的语句里面最后有个g,表示行内全部替换,前两天没有留意这个
#2: 这里将自带的插件也都放到~/.bmp/Plugins下。当然用相对路径替换掉/usr/lib/bmp也是可以的,这里只是为了说明有时也可以利用程序自己的功能(比如回头我们可以试试按这个思路给Knoppix自带的gaim添加QQ插件)
2005年3月18日 星期五
给Knoppix动态添加中文支持(3)
* OpenOffice的中文字体
Knoppix上带的OpenOffice不是Debian直接提供的版本,而是Knopper自己制作的一个版本,我还没有试验如何添加中文包。
但字体配置可以按如下方式(openoffice有自己的字体配置文件)
cp -a /opt/openoffice/share/fonts/truetype/*.ttf ~/.fonts
cd ~/.fonts && ttmkfdir && cp fonts.scale fonts.dir && cp fonts.dir fonts_dir.global
sudo mount --bind ~/.fonts /opt/openoffice/share/fonts/truetype
* GTK程序打开文件对话框中出现乱码:
export G_FILENAME_ENCODING=GB2312
* less不能查看中文编码文件:
export LESSCHARSET=iso8859标签: knoppix
2005年3月17日 星期四
给Knoppix动态添加中文支持(II)

数据文件位置问题
这个问题比较棘手: 前面配置kde-i18n-zhcn时/usr/share/locale/zh_CN可以用别的目录映射,那是因为这个目录还不是很大;现在/usr/share下并没有一个叫做fcitx的目录供我们映射,难道我们要映射整个/usr/share? 显然是M:I-3.
fcitx是否一定要从/usr/share/fcitx读取数
难道就没有什么办法了么?在编译的时候指定了prefix=
想到别的程序也应该有这样的问题,我看了一下Knoppix里面
perl -pi -e 's|/usr/share/games/tuxkart|./
(注意两个字符串长度需要是一样的)
然后用一个wrapper确保真正启动可执行程序时当前目录在
cat <
#!/bin/sh
cd `dirname $0`/../games
./tuxracer $*
EOF
chmod 755 $DESTDIR/bin/tuxracer
所以fcitx的install.sh可以做成这样:
[ ! -d $DESTDIR/usr/share/fcitx ] && mkdir -p $DESTDIR/usr/share/fcitx
cp -a fcitx/usr/share/fcitx/* $DESTDIR/usr/share/fcitx/
# copy executables
[ ! -d $DESTDIR/usr/bin ] && mkdir -p $DESTDIR/usr/bin
cp -a fcitx/usr/bin/* $DESTDIR/usr/bin/
chmod 755 $DESTDIR/usr/bin/*
cp -a fcitx/usr/bin/fcitx $DESTDIR/bin/
perl -pi -e 's|/usr/share/fcitx|./../share
# add a wrapper $DESTDIR/bin/fcitx
cat <
#!/bin/sh
cd `dirname $0`/../usr/bin
exec ./fcitx $*
EOF
chmod 755 $DESTDIR/bin/fcitx
但经过实际试验,并没有成功,fcitx还是无法找到码表和词库
用strings fcitx | grep usr/share/fcitx发现并没有什么匹配的结果
最后发现只能用./..来替换/usr
perl -pi -e 's#/usr#./..#' $DESTDIR/usr/bin/fcitx
环境配置
环境变量似乎比较好解决,无非是修改~/.bashrc(或者/etc/environment文件,如果~/.bashrc不好使的话),然后source一下。慢着! X启动的时候,是否会去读取~/.bash_profile? 记得从gdm等启动X回话的时候是不读取的。
如果这里也不读取,就比较麻烦。为了确认这一点,在~/
echo "~/.bash_profile called: **ITEMS**quot; >> /tmp/xsession_test.log
然后用root在控制台重新启动xsession:
/etc/init.d/xsession restart
结果发现没有 :-(
所以只好改用saveconfig保存文件的方式,而且这样的话这里就简单得多了
+++ etc/X11/Xsession.d/45xsession 2005-03-18 10:35:28.000000000 +0800
@@ -745,6 +745,13 @@ EOF
done
}
+export XMODIFIERS="@im=fcitx"
+unset LC_ALL
+export LC_ALL=zh_CN.GB2312
+if [ -x $HOME/.dist/bin/fcitx ] ; then
+ $HOME/.dist/bin/fcitx &
+fi
+
# Check for sufficient Real Memory for starting KDE or GNOME
# (We don't want to end in a swap-a-lot loop.)
REALMEM="$(awk '/MemTotal/{print $2}' /proc/meminfo)"
@@ -753,7 +760,8 @@ if [ "$REALMEM" -lt 25000 ]; then
starttwm
else
case "$DESKTOP" in
- kde|KDE) [ "$FREEMEM" -ge "60000" ] && startkde || starttwm lowmem 82; ;;
+ kde|KDE) sudo mount --bind $HOME/.dist/usr/share/locale
+ [ "$FREEMEM" -ge "60000" ] && startkde || starttwm lowmem 82; ;;
gnome|GNOME) [ "$FREEMEM" -ge "45000" ] && startgnome || starttwm lowmem 67; ;;
larswm|LARSWM) [ "$FREEMEM" -ge "35000" ] && startlarswm || starttwm lowmem 64; ;;
enlightenment|ENLIGHTENMENT) [ "$FREEMEM" -ge "35000" ] && startenlightenment || starttwm lowmem 64; ;;
然后重启动(或者象nvidia模块那样在exit.sh里面执行一下/etc/init.d/xsession restart)
备注:
当启动时添加参数lang=cn后,/etc/init.d/knoppix-autoconfig会自动对KDE的配置进行修改,使其启动时使用zh_CN; 如果配置成中文后,以后启动又用了home=....选项,则保存下来的设置会生效。所以这方面不用再担心。回头看输入法: 启动时若添加了lang=cn,knoppix-autocon
为了减少依赖,干脆不考虑lang=cn的情况
2005年3月16日 星期三
MP3转换和提取工具
Apple iTunes可以进行MP3,AAC,WAV,M4A的相互转换(本身也是iPod的管理工具)
FairStars Audio Converter可以实现WMA,MP3,OGG,WAV等格式的相互转换,还可以将MP1,MP2,RA等格式转换为MP3/WMA格式
ACE DVD Audio Extractor可以从DVD里面提取音轨,至少可以输出MP3,其他格式不记得是否支持了
Boilsoft RM to MP3 Converter可以将RM,RA的声音提取为MP3或者WAV
要从MP4/AVI中提取音频为MP3/WMA,好像有一个叫All Video Audio Extractor的工具,但这个工具不支持批量转换,比较麻烦
要从VCD(MPEG2)中提取音轨,我没有发现什么好工具,只有原来一个叫TMPGEnc的工具有分解视频和音频的功能,然后再用FairStars将MP2压缩为MP3
另外从CD提取MP3或者OGG, 虽然工具很多,但我觉得AltoMP3 Maker(现在已经改名叫做AltoMP3 CD Ripper了)这个工具还可以: 音质比较好(没有结巴那种噪音),而且用LAME压缩器速度快,另外还支持CDDB和ID3v2。
iTunes是免费的,后面几个不是。
2005年3月15日 星期二
xffm back to cygwin!
但今天终于再此搞定了,虽然费了整整一天。(但我还是更喜欢用rox)
大致的方法如下:
- 将smb模块和将libs目录下的库编译为静态库
- 将xffm与上述模块进行链接,得到xffm.exe, 用dlltool 输出(export)xffm.exe的全部public符号
- modules下的模块全部依赖于xffm.exe
From the viewpoint of cygwin/windows, the module structure of xffm-4.2 is a whole mass. The xffm executable and a pack of shared libraries used each other's symbols, which is not allowed on
cygwin/windows. This made it very hard to port xffm-4.2 to cygwin.
But now xffm (4.2) is back to cygwin! I spent a whole day on this. (Nevertheless I'd prefer rox to xffm).
- Turn the libraries in directory `libs' into static libraries
- Link xffm against the libraries above and then we have xffm.exe. Use dlltool to export all the public symbols of xffm.exe.
- Link the modules in directory `modules' against xffm.exe.
依赖于libs目录下的一堆库,这些库当中又有引用xffm中的符号的情况;smb模块似乎是可以不编译的,但
libs目录下面的那些库偏偏又用到了smb可加载情况下才有的一些功能;另外modules目录学唉还有一堆插件,实现书签、回收站等虚拟文件系统;
xfdiff4这个小功能也需要libs目录下的libxffm_secondary里面的一些函数。
因为windows下不允许一个可执行文件或者动态库中包含未定义的符号, 所以需要仔细界定一个函数或者变量是在哪里实现,所以从4.1.90版本开始一直搞不定这个东西的移植,每次开始折腾一会儿就晕了。
仔细琢磨了一下代码结构,发掘其实也蛮简单,将原来libs下面的共享库变成静态库不就行了?
但这样的大调整,仅仅靠修改Makefile.in不禁会繁死,而且还很难成功,因为有些东西(比如将编译动态库改为编译静态库,因为用了libtool这些东西)靠修改Makefile.in不知道怎么下手。
于是我从Makefile.am下手,运气好的是,用automake重新生成Makefile.in很顺利,并没有用到什么目前cygwin下面没有的宏。
源代码补丁正在整理中,过两天就可以上载到主页上去了。
The xffm executable used some symbols defined in the libraries in
directory `libs', but these libs also reference some symbols defined
in the xffm executable; the smb module seems to be loadable, for
supporting some systems that don't have smb support , but the libraries
in `libs' insist to call some functions implmented in smb module.
As Windows doesn't allow undefined symbols in the executable and shared
libraries, thus we should know exactly where a symbols is implemented.
Starting from version 4.1.90 of xffm, I neven succeed in porting xffm
to cygwin. Every time I started to work on it, I would be confused and
disoriented just in a few minutes.
I
walked through the code structure, suddenly the God shed some lights on
me: why not just build those libraries into static ones and link xffm
to them?
Then I tried, works! (This change requires me to hacked the Makefile.ams. I'm not familar with
automake/autoconf. But fortunately enough, I got no any error when
running automake.)
Now I'm examining the modification to got a source patch. Maybe you can see it on my repository in a few days.
Good News: KNOPPIX-3.8 released, with UNIONFS support
In a few days, KNOPPIX Version 3.8.1 will be available on the mirrors. It's an update for the 3.8 Cebit 2005 Edition, featuring:
- Kernel 2.6.11 as default,
- write support
for all virtual directories (i.e. live-installation of software without
writable media is possible) in a running live system, made possible
through UNIONFS, - native Support for ipw2200 (Centrino2) WLAN chipsets,
- permanent homedirectory on harddisk (even on NTFS),
- KDE 3.3.2, Gimp 2.2.4, OpenOffice 1.1.4 and many updates,
- Wallpaper and bootscreen graphics design by newthinking communications.
TaR_nircmd: nircmd -> TypeAndRun connector
标签: addons, total commander, windows
2005年3月14日 星期一
用Knoppix Live Installer添加中文支持(I)
Knoppix Live Installer(前次的介绍)这种方式比我原来设想的似乎要更高级一点,方便一点,于是就用这种方式来试验了一下。
中文支持主要是环境配置、中文字体、中文message catalog和中文输入法。
arphic字体包和KDE的中文i18n很容易就搞定了,但中文输入法就不太顺利。
安装字体字体
安装字体我们要做的是:1. 用apt下载当前的ttf-arphic-gbsn00lp等字体包
2. 将包解开,将ttf字体安装到~/.fonts
3. 用fc-cache生成~/.fonts
4. 注册defoma hints
前三步很容易完成:
"'AR PL SungtiL GB' Chinese TrueType font by Arphic Technology"
modules/ttf-arphic-gbsn00lp/files:
# basename location_to_download type md5sum
ttf-arphic-gbsn00lp none apt none
modules/ttf-arphic-gbsn00lp/install.sh:
#!/bin/bash
[ ! -d $HOME/.fonts ] && mkdir $HOME/.fonts
# copy fonts
cp -a ttf-arphic-gbsn00lp/usr/share/fonts/truetype/arphic/*.ttf $HOME/.fonts
# generate font cache
fc-cache $HOME/.fonts
mkfontscale $HOME/.fonts
cp -f $HOME/.fonts/fonts.scale $HOME/.fonts/fonts.dir
xset +fp $HOME/.fonts
麻烦的是注册hints这一步需要root权限,而且不一定能够执行(因为在Knoppix光盘上运行,大部分目录都是只读的)
好在这一步不做问题也不大。
但我还是试验了一下,似乎也可以:
# register defoma hints
fontsdir=$HOME/.fonts
hintfile=/etc/defoma/hints/ttf-arphic-gbsn00lp.hints
sed 's#/usr/share/fonts/truetype/arphic/gbsn00lp.ttf#$fontsdir/gbsn00lp.ttf#'
ttf-arphic-gbsn00lp$hintfile > $hintfile
sudo /usr/bin/defoma-font -t reregister-all $hintfile
中文message catalog
其他软件的各种语言mo都是一起安装的,所以没有什么问题,不需要再做什么。唯独KDE是例外,需要另外安装一个中文语言包kde-i18n-zhcn。这里存在的另一个问题就是这些翻译包都要放到/usr/share/locale/下面去的,但Knoppix从光盘上运行,/usr是只读的,怎么办?
好在现在的Linux内核都支持文件系统的bind(就是将一个目录映射为另外一个目录),我们只要这样就可以了
mount --bind $mydir /usr/share/locale/zh_CN
mydir是新建立的存放message catalog的地方,kde-i18n-zhcn中的mo文件解压后就放在这里
注意映射之前需要先将原来/usr/share/locale/zh_CN拷贝到新目录,否则就只有kde的翻译了
"Chinese Simplified (zh_CN) internationalized (i18n) files for KDE"
modules/kde-i18n-zhcn/files
# basename location_to_download type md5sum
kde-i18n-zhcn none apt none
modules/kde-i18n-zhcn/install.sh
[ ! -d $DESTDIR/usr/share/locale/zh_CN ] && mkdir -p $DESTDIR/usr/share/locale/zh_CN
# copy message catalogs
mv kde-i18n-zhcn/usr/share/locale/zh_CN/* $DESTDIR/usr/share/locale/zh_CN/
# copy other translations to new folder
# WARNING: you should have enough spaces for storing all this
cp -a /usr/share/locale/zh_CN/* $DESTDIR/usr/share/locale/zh_CN/
# rebind /usr/share/locale/zh_CN/
sudo mount --bind $DESTDIR/usr/share/locale/zh_CN/ /usr/share/locale/zh_CN/
这里还需要解决一个问题: 执行上述mount之后再从KDE的Control Center或者Configuration Wizard选择"简体中文"当然没有问题。但下次重启动呢?如何让系统启动时自动执行上面的mount? 这一步必须在/home加载后,KDE启动之前完成,时机很是问题。
考虑到非KDE桌面下用这个特性的可能性比较小,所以我选择了用KDE的Autostart特性来做这一步
cat <
[Desktop Entry]
Name=kde-i18n-zhcn
Exec=sudo mount --bind $DESTDIR/usr/share/locale/zh_CN/ /usr/share/locale/zh_CN/
Type=Application
Icon=message
Terminal=0
EOF
中 文输入法我打算用比较熟悉的fcitx来做,但这里有一个障碍: fcitx需要读取/usr/share/fcitx目录下的数据文件,系统并没有先建立一个/usr/share/fcitx供我们mount --bind,而我们也不能象前面那样映射整个/usr/share. 我现在看到一个解决办法,但是否可行,明天试验了才能知道。
标签: knoppix
怎样在exe中内嵌程序的帮助文档
1. 编写用户文档
假设有index.htm, manual.htm, minimsg.png, buttons.gif四个文件, htm间有相互连接,
2.编写doc.rc文件
INDEX_HTML 23 "index.htm"
MANUAL_HTML 23 "manual.htm"
minimsgr_png 23 "minimsgr.png"
buttons_gif 23 "buttons.gif"
3.编译得到doc.res文件, 可用brcc32
brcc32 doc.rc
4.将doc.res连接到exe中
比如Delphi中
{$R doc.res}
5.然后在代码中调用
sDocFile := '"res://' + Application.ExeName + '/index_html"';
ShellExecute(Self.Handle, 'Open', //action
'iexplore.exe', //program
PChar(sDocFile),//parameters
nil, //current dir
SW_MAXIMIZE); //window command
注意URL的最后(index_html)就是index.html在rc中的资源标识符
6.但这里有一个问题: index.htm嵌入的图片显示不出来,点击index.htm中到manual.html的连接也无法出来。
这是因为res://foo.exe/后面是根据资源标识符来定位资源的,但这里并没有一个名称为manual.html或者buttons.gif的资源,而同时manual.html也不是一个合法的资源标识符('.'是不允许的)。
解决办法是用UltraEdit编辑doc.res,查找FF FF 17 00,每个后面都是资源标识符,改为对应的文件名即可('_'改为'.')。注意如果入口标识符(INDEX_HTML)如果改掉的话,代码中也要相应修改。
标签: delphi
2005年3月13日 星期日
转: 如何优化WINDOWS XP操作系统?
- 关闭报告错误
- 关闭系统还原及休眠支持
- 删除Windows XP 中不需要的组件
- 如何提高Windows XP 的运行速度?
- 禁用Dr. Watson 调试程序
此案例仅供参考,(适合对系统比较了解,对系统要求比较高的用户可以参考。)
关闭报告错误
-------
点开始-〉运行-〉敲入msconfig-〉服务-
OK 了。以后再也没有程序因错误或兼容性不好被强行关闭后弹出的讨厌
关闭系统还原及休眠支持
---------------
虽然这两项功能也并非完全没有任何作用,但考虑到需要需要占用很
关闭;首先鼠标右健单击桌面上的"我的电脑",选择"属性"
System Restore on all drives"前打上勾就可以了。
休眠支持只需要通过控制面板-> 电源选项-> 休眠(Hibernate),把"Enable Hibernate"前面的勾去掉就可
以了,这样一来可以空出512MB 的硬盘空间。
删除Windows XP 中不需要的组件
---------------------
1)、删除系统文件备份,执行sfc.exe /purgecache
2)、删除驱动备份,删除WINDOWS(XP 安装目录)driver cachei386 目录下的Driver.cab 文件
3)、删除DLL 备份文件,目录为WINDOWS(XP 安装目录)system32dllcache,
4)、删除WINDOWS(XP 安装目录)ime 下不用的输入法
如何提高Windows XP 的运行速度?
-----------------------
Windows XP 虽然提供了一个非常好的界面外观,但是不可否认这样的设置也在极
的运行速度。如果你的机器运行起来速度不是很快,建议将所有的附
XP 的桌面恢复到Windows 2000 样式。设置的方法非常简单,在"我的电脑"上单击鼠标右键,选择
在"高级"选项卡中单击"性能"项中的"设置"按钮
一个对Windows XP 影响重大的硬件就是内存。使用256MB 内存运行Windows XP 会比较流畅,512MB 的
内存可以让系统运行得很好。
禁用Dr. Watson 调试程序
-----------------
在运行中输入"drwtsn32",然后把除了"(Dump All Thread Contexts)转储全部线程上下文"之外的全都
去掉,否则一旦有程序出错,硬盘会响很久,而且会占用很多硬盘空
标签: windows
2005年3月12日 星期六
Knoppix Live Install的大致工作流程
问题是一篇文档也没有,我只能阅读knx-live-inst.sh这个脚本。
这个东西大致工作流程如下:
先 读取所有模块下的description(get_software()),然后用xdialog显示出来供用户选择要安装哪个模块 (choose_soft()), 然后调用该模块的eula.sh显示EULA(如果该模块有eula.sh的话),然后以non_interactive方式调用自身执行 install.sh(non_interactive()),如果安装成功完成就执行module的exit.sh(如果有的话)来完成一些post install操作,然后退出。
(下面简称Knoppix Live Install为KLI)
/usr/sbin/knx -live-inst.sh会先检查有哪些module可供安装(如果当前目录没有modules这个目录就检查缺省目录/usr/share/knx- live-inst/modules,这样倒是方便了自己括这新的module),目前提供了f-prot, flash plugin等模块。
每个module下面可能有如下一些文件
description 模块的描述文件
files 要从网上下载的文件,包含网地址、文件类型
install.sh 安装脚本
eula.sh (可选)用于显示End User License Agreement的脚本
一般用在一些非free的软件上,比如flash plugin, nvidia driver
exit.sh 安装完成后执行的脚本
menu (可选)指明需要在Kstart上创建的菜单项
exes (可选)指明程序所包含的可执行文件,KLI在AppDirs模式下使用,会在~/.dist/bin下创建相应的可执行程序
(实际是链接到~/Sofeware/$MODULE_NAME/bin/wrappper-$MODULE_NAME)
KLI 先读取所有模块下的description(get_software()),然后用dialog显示出来供用户选择要安装哪个模块 (choose_soft()), 然后调用该模块的eula.sh显示EULA(如果该模块有eula.sh的话),然后以non_interactive方式调用自身执行 install.sh(non_interactive()),如果安装成功完成就执行module的exit.sh(如果有的话)来完成一些post install操作,然后退出。
回头看non_interactive(),这个函数包含了安装的核心过程:
1. 先调用setup_destdir()修改~/.bashrc(将~/.dist/bin/加到PATH, ~/.dist/lib加到LD_LIBRARY_PATH)并创建~/.dist/bin/live-wrapper
2. 然后根据MODULE/files从网上下载指定的文件(用wget或者apt-get,见函数get_file()), 放到临时目录/tmp/knx-live-inst.$,检查md5
3. 将files列出的每个文件解压到/tmp/knx-live-inst.$/${MODULE_NAME} (knx-unpack())
4. 调用MODULE/install.sh执行模块特定的步骤
5. 如果模块有menu文件,安装菜单项目(install_icons())
再来看一些细节
1.文件下载
下载的文件可能会保存在~/.knx-live-inst/cache下(DL_DIRECTORY), 如果解压某个文件不成功会删除对应cache。
传入get_file的各个参数是:
$1: Module name
$2-$5: fields in files
$2: filename
$3: location to download (for apt type, it's empty)
$4: type (apt, tgz...)
$5: md5
注意这里是支持apt的,这可以让你安装跟当前系统配套的版本,而且这也可以利用debian丰富的软件包。
2. install.sh需要做的事情
主 要只有一件事: 将需要的文件从/tmp/knx-live-inst.$ (这也是install.sh开始运行时所在的目录),拷贝到合适的位置。如果是程序运行所需要的数据文件,为了统一,可以拷贝到~/.dist下去(不 要硬编码,用$DESTDIR变量)。可执行文件可以放到$(DESTDIR)/.dist/bin里面去。
3. live-wrapper
如果打算允许用户从桌面上运行,需要编写menu文件以便KLI创建对应的"快捷方式",这个快捷方式会用~/.dist/bin/live-wrapper来启动目标程序,以便PATH,MANPATH,LD_LIBRARY_PATH等问题不会影响程序运行。
live-wrapper内容如下:
#!/bin/bash
. ~/.bashrc (PATH, MANPATH等在~/.bashrc中设置)
PROG="$1"
shift
exec $DESTDIR/bin/$PROG "$@"
4. AppDirs模式
模 块可以采用AppDirs模式进行安装,就是每个模块各自一个目录~/Software/$MODULE_NAME,这样删除起来就比较方便。当用 AppDirs模式时,KLI会在~/.dist/bin下创建一个明为wrapper-${MODULE_NAME}的脚本,
DESTDIR=$DESTDIR (后面这个DESTDIR会在生成时被替换为实际值,
等于~/Software/$MODULE_NAME)
export MANPATH=$DESTDIR/man/:$MANPATH
export PATH=$DESTDIR/bin/:$PATH
export LD_LIBRARY_PATH=$DESTDIR/lib:$LD_LIBRARY_PATH
exec $DESTDIR/bin/$(basename $0) "$@"
然后对exes里面列出的每个名称在~/.dist/bin下创建一个到wrapper的链接。
最后KLI再调用install.sh执行后面的安装。
注意AppDirs模式下DESTDIR就是~/Software/$MODULE_NAME(所以前面说install.sh不要硬编码而要用$DESTDIR)。
2005年3月11日 星期五
GTK2 port of sylpheed-claws
运 行起来感觉相当不错,至少中文显示不用配置了,也可以编写新邮件了(我是说可以直接输入中文了,gtk1版本里它自己扩展的gtkstext控件不支持 XIM,我一直都是在别的程序里面输入了邮件内容再贴过去)。 唯 一的问题就是删除、移动邮件的时候速度有些慢,另外不是很稳定。
[@more@]
原 来就看见sylpheed-claws的主页上开始有gtk2版本的信 息了,但一直没有正式发过版本,都是cvs中取,我一向懒得自己去cvs里面折腾(除了原来搞rrafs时嫌它版本间隔太长就自己从cvs检版本),而且 又要autoconf, automake什么的,晕。
前两日看见debian-chinese邮件列表上有朋友在问sylpheed- claws的中文输入问题,居然是讲gtk2版本版本的,开始还以为他自己折腾的,没想到在debian的experimental里面看见已经有 sylpheed-claws-gtk2了。今天有点时间,将debian准备好的源代码包下载下来捣腾。本来以为编译会有很多新问题,先用make -i就出去吃饭去了,准备回来解决问题,没想到出奇地顺利,除了trayicon需要链接libX11之外,没有碰到什么问题。
迫不及待跑起来(先备份了gtk1版本的配置文件),先就留意到终端上输出
/home/glyoung/.sylpheed-gtk2/sylpheedrc: fopen: No such file or directory
看来它跟gtk1版本的配置文件(~/.sylpheed)是分开的,挺好。
接着居然出现一个配置向导,说是没有创建帐户。记得原来是没有这个的,也挺好。
设置邮箱为原来的邮箱位置,嘿,读取正常,邮件列表里中文标题显示也没有问题,打开一封中文邮件,显示正常,根本不需要自己再去配置字体。然后启动xorg-x11和xfce4,启动输入法,再重新运行,新建邮件,嘿嘿,可以输入中文了。
最后用zh_CN.gbk为locale试了一下,再截了一张图。

标签: claws-mail, gtk
Knoppix Live Installer
Knoppix 目前用它来安装一些因为版权(比如flash plugin, msttcorefonts, nvidia graphic cards driver)或者大小(比如tuxracer, crack-attack, pingus等游戏)等原因不能放在光盘上的东西。
[@more@]
几天前看见Knoopix Hacks的介绍,下载了网站提供的示例章节。Hack 78: Scan For Virus一节提到了可以动态安装一个f-port来进行查杀病毒,哦?还可以动态安装软件?可惜文中提到的Hack 27: Use the Knoppix Live Installer并没有提供。
在网上搜索Knoppix Live Installer并没有得到什么结果,除了后来贴的那篇文摘Remaster Knoppix Without Remastering中也提到了这个东西(刚才方注意到作者就是Knoppix Hacks的作者)。
只得回家下载了新的Knoppix,开始琢磨这个东西。从ChangeLog[1]中看到其实在v3.4-2004-05-04就有这个东西了,想来当初应该看见过但不知道是个什么东西。
用它安装额外的应用程序时需要注意一点,那就是磁盘空间,应为所有的东西都是安装到$HOME目录下的,所以应该先用mkpersisthome创建一个HOME映像,建议空间选得大一点。
标签: knoppix
gtkpod又升级了(0.88发布)
ChangeLog上说开始支持iPod Shuffle了。可惜还是不支持Audiobooks。
另外我倒是很希望有歌词编辑功能: 单独一个窗口(非模态), 选中一首歌曲就可以在里面编辑歌词。
原来找到一个PodLyrics实在是不怎么样,还不如自己来写一个。
2005年3月10日 星期四
用Debian要读的第一份文档
而且这个文档常常更新,不象其他一些文档还在讲述一些老版本上的东西。从这里可 以下载到最新的版本。
[@more@]
Debian 参考手册由Osamu Aoki osamu@debian.org发起,最初是一部个人的系统安装备忘录,而最终称之为“Quick Reference ...”。许多内容来自于“debian-user”邮件列表中的存档,同时也参考了《Debian ― Installation Manual》和《Debian ― Release Notes》。
由Debian Documentation Project(DDP)的积极参与者、也是目前《The Debian FAQ》的主要维护者的Josip Rodin提议,将本文档更名为“Debian 参考手册”并将《The Debian FAQ》中一些类似参考形式的章节内容合并过来。后来摘录出一部分内容形成了《Debian 快速参考手册》。
You can get latest source directly from CVS:
# apt-get install debiandoc-sgml
$ cvs -d :pserver:anonymous@cvs.sourceforge.net:/cvsroot/qref login
... press Enter when asked for password
$ cvs -z3 -d :pserver:anonymous@cvs.sourceforge.net:/cvsroot/qref co -P qref
$ cd qref; make htmlan
标签: debian
QuickCHM这个工具还不错
如果原来发现这个,就不必编写python脚本来自己提取html的标题生成hhp/hhc了
做X Files和Friends剧本的CHM版本也方便多了。
Old posts:
How to convert Friends.doc into a CHM file
Create a CHM file for PyGTK2 Tutorial
2005年3月8日 星期二
Grouping support of iPod
后又是评书《隋唐演义》,张学友的《她来听我的演唱会》,Nick Drake的民谣,X
Files的声轨......怎么就不能让我选择只在古典音乐里面随机,或者只在摇滚里面随机......
今天折腾gtkpod,无意发现smart playlist编辑器里面有一个Grouping条件, 看着很象我要的东西。
仔细研究一下,果然。
但以前没有看到过啊?回头检查,发现ChangeLog里面有一条:
IMPROVEMENT: Support for iTunes' "checked", file descriptor (kind), and grouping fields
果然是新增的。
Powered by ScribeFire.
2005年3月7日 星期一
Fw: Remaster Knoppix without Remastering
原文位置: http://www.oreillynet.com/lpt/wlg/5964
主要讲了saveconfig/knoppix的用法,以及新的knx-live-inst,另外还提供了一个新东西: http://klik.sourceforge.net
Remaster Knoppix without Remastering
http://www.oreillynet.com/lpt/wlg/5964
The saveconfig script
----------------
The
saveconfig script within Knoppix is probably the best way to "remaster"
Knoppix without remastering. You can type saveconfig from a terminal,
or otherwise you can click Kmenu->KNOPPIX->Configure->Save
Knoppix configuration. A simple GUI will pop up and allow you to choose
what categories of settings to save from desktop and program settings,
the entire Desktop directory, network settings, graphics settings, and
other system settings. Choose the settings to save, and the device to
save them to (from a list of detected devices Knoppix provides), and
the script does the rest, creating a configs.tbz and knoppix.sh file on
the device you chose.
Next time you boot, add the cheat code
myconfig=scan and Knoppix will scan all available devices for the
knoppix.sh script and then execute it. This script will extract
configs.tbz and otherwise restore your settings.
If you are the
kind of person who likes to hack around with things, you might think to
yourself: "Hmmm I bet I could tweak that knoppix.sh script and do other
things at boot." And you would be right, the knoppix.sh script is the
key to remaster Knoppix without remastering.
What is the knoppix.sh script?
----------------------
The
knoppix.sh file is a simple shell script. When Knoppix boots, it scans
the KNOPPIX directory on the CD for a knoppix.sh file (or if you use
the myconfig=scan cheat code, it will also scan other devices on your
system). If it finds this file, it will execute it. Windows users can
think of this file as an autoexec.bat script. You can basically put any
series of commands into this script and Knoppix will execute them upon
startup. A typical knoppix.sh script looks like this:
#!/bin/sh
[ "`id -u`" = "0" ] || { echo "You need root privileges to modify the system!" >
&2 ; exit 1; }
[ -d "$1" ] && CONFIGS="$1/configs.tbz"
[ -f "$CONFIGS" ] || CONFIGS="/cdrom/KNOPPIX/configs.tbz"
[ -f "$CONFIGS" ] || CONFIGS="/mnt/floppy/configs.tbz"
if [ -f "$CONFIGS" ]; then
echo "^[[1mExtracting config archive $CONFIGS...^[[0m"
tar -jpPtf "$CONFIGS" | while read i; do rm -f "$i"; done
tar -jpPxf "$CONFIGS" ; chown -R knoppix.knoppix /home/knoppix
fi
The
best way to get started with tweaking this file is to run the
saveconfig script once to generate a knoppix.sh file to work from.
There are some various checks this script runs, but its basic function
is to extract the configs.tbz file. Based on what settings you saved,
this file will overwrite settings in /etc or /home/knoppix. You can
simply change the configs.tbz file if you want and add or remove files
with the settings you want.
It's important to remember that
certain parts of the filesystem under Knoppix, such as all of /usr,
will be read-only even when the system completely boots, so this means
that the interesting areas you will be able to change are in /etc/ and
/home/knoppix/. Also, at the time knoppix.sh runs, /home/knoppix
doesn't exist yet (that directory is copied from /etc/skel later), so
while you might think that you can just add a cp filename
/home/knoppix/ command to the script, it will fail when you run it. If
you want to copy files to /home/knoppix, you will need to create a
tarball from / that includes those files, that way the /home/knoppix
directory will be created for you as that extracts.
Install Programs
-------------
While
this setup is typically used for saving your settings, you can also
work around having to install programs with this method. Knoppix has
two different popular methods for installing software directly to the
live CD, the included knx-live-inst.sh script (or click
Kmenu->KNOPPIX->Utilities->Install Software while running from
CD), or klik. Both of these programs install software directly into the
/home/knoppix directory and modify file paths so that they can run from
there. After you install programs with this method, you can save your
home directory and those programs will still be there the next time you
boot with myconfig=scan.
If your program isn't included in the
list of software you can live-install, you can attempt to install it to
the local path yourself. Of course this process will vary in difficulty
depending on the complexity of the software you want to install.
Powered by ScribeFire.
How to create Audiobooks for your ipod
升级了iPod的固件,除了Shuffle Songs选项之外,还看到了一个"有声读物"(Audiobooks)选项
对于"有声读物",iPod会记录停止的位置,下次播放不会重头再来,而且有语速可以选择。
查iTunes帮助,这个有声读物居然只能在它指定的两个网站购买,不会吧?
在网上搜了一下,理所当然地发现有方法...
[@more@]
原文: http://www.splatpunk.com/tutorials/audiobook/audiobooks.htm
其实作者有些罗嗦了,前面讲了如何从CD得到MP3,然后将多个MP3合并为一个等等,而关键的步骤是:
1. 将MP3加到iTunes的曲库(暂时不要放到iPod去)
2. 将该曲转换为AAC格式,(该功能在歌曲的右键菜单里,如果不是AAC,在偏好里面将导入格式设置为AAC,并选定位速率(作为audiobooks的一般可以低一点吧?)
3. 在资源管理器里面将得到的AAC文件(扩展名为m4a)的扩展名改为m4b
4. 将m4b拖入iTunes,加到iPod里面去
2005年3月6日 星期日
xpdf的中文支持问题
语言包内包含了CMap files, text encodings, and various other configuration
information necessary or useful for specific character sets.
记得Debian对于语言包的自动安装做了一些改进[4](但Debian中似乎没有见到针对xpdf-3.0的语言包?)。
然后就是对于CJK字体的支持了,有两个补丁:
一个来自lucida's linux patch,可用于2.03和3.0
另一个来自原作者(补丁下载, 但在xpdf主页上没有发现) ,可以正确显示不带内嵌字体的中文pdf文件,但仅能用于3.0
还有一个问题就是对书签中中文的支持,这个在lucida的网页上有详细说明
另:
3.0不再支持X server字体,不再支持freetype 1.x,而支持TTF字体(不支持TTC)
3.0支持PDF 1.5, 而2.03最高支持PDF 1.4
以下内容摘自lucida的网页:
中文书签的显示需要额外的配置工作。
1. 在~/.Xdefaults里面加入资源项
xpdf*.fontList:
-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1;-misc-simsun-medium-r-normal--12-*-*-*-*-*-gbk-0:
注意标点,另外确保使用的字体的确存在,然后
xrdb -merge ~/.Xdefaults
使修改生效
2. 正确设置PDF文件的encoding
方法1. 在/etc/xpdfrc里面增加一行
textEncoding GBK
方法2. 使用参数启动xpdf,如下
xpdf -enc GBK aa.pdf
3. 关于编译以及使用中的一些问题
a. 无法在Freetype版本≧2.1.6的系统上编译
这是因为Freetype从此版本开始,强制引用"ft2build.h"而非"freetype/freetype.h",造成xpdf configure检测Freetype版本失败。本地下载
b.
关于资源项的设置,某些系统上应使用Xpdf*.fontList:(首字母X大写)而非xpdf*.fontList:。我不知道原因,不过如果您自觉资源项设置没有生效,可以试试。
另外一个设置资源项的方法是,修改或者新建/etc/X11/app-defaults/Xpdf,加入对应内容,这样可以省略xrdb
-merge的步骤(感谢seb@smth的建议)
c. 某些PDF制作不规范(比如Linux国家标准草案PDF档),请使用
xpdf -enc Latin1 buggy.pdf
d. 注意修改/etc/xpdfrc,加入合适的ttf字体,比如
displayCIDFontTT Adobe-GB1 /usr/share/fonts/simhei.ttf
xpdf3不再支持老的XLFD字体(以及displayCIDFontX资源项),所以以前的设置文章不再有效。另外,xpdf3目前只支持ttf字体,不支持ttc(TrueType
font Collection)字体。


