LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 4568|回复: 16

自己编译xpdf-3.00能显示中文及标签!

[复制链接]
发表于 2004-11-20 23:53:56 | 显示全部楼层 |阅读模式
我已经把补丁及源文件上传到http://download.linuxsir.cn/yurt/
然后你需要下载ftp://ftp.foolabs.com/pub/xpdf/xpdf-chinese-simplified.tar.gz
首先解开补丁及源文件
[PHP]
tar zxvf xpdf-3.00-cjk.tar.gz
cd xpdf
tar zxvf xpdf-3.00.tar.gz
cd xpdf-3.00
patch -Np1 -i ../xpdf-3.00-freetype_2.1.7_hack-1.patch
patch -Np0 -i ../xpdf-3.0-cjk-font.diff
patch -Np0 -i ../xpdf-cjk-fix.diff
cd xpdf
patch -Np0 -i ../../xpdf-3.00pl1.patch
cd ..
./configure --prefix=/usr --sysconfdir=/etc --with-freetype2-includes=/usr/include/freetype2
make
make install
[/PHP]
将xpdf-chinese-simplified.tar.gz中的内容释放到/usr/share/xpdf/chinese-simplified里!
然后在~/.Xdefaults中加入
[PHP]xpdf*.fontList: -*-tahoma-medium-r-normal--14-*-*-*-*-*-iso8859-1;\       -misc-simsun-medium-r-normal--13-*-*-*-*-*-gbk-0:[/PHP]
然后执行xrdb -merge ~/.Xresources

最后在创建~/.xpdfrc加入:
[PHP]displayFontT1 Times-Roman               /usr/share/ghostscript/fonts/n021003l.pfb
displayFontT1 Times-Italic              /usr/share/ghostscript/fonts/n021023l.pfb
displayFontT1 Times-Bold                /usr/share/ghostscript/fonts/n021004l.pfb
displayFontT1 Times-BoldItalic          /usr/share/ghostscript/fonts/n021024l.pfb
displayFontT1 Helvetica                 /usr/share/ghostscript/fonts/n019003l.pfb
displayFontT1 Helvetica-Oblique         /usr/share/ghostscript/fonts/n019023l.pfb
displayFontT1 Helvetica-Bold            /usr/share/ghostscript/fonts/n019004l.pfb
displayFontT1 Helvetica-BoldOblique     /usr/share/ghostscript/fonts/n019024l.pfb
displayFontT1 Courier                   /usr/share/ghostscript/fonts/n022003l.pfb
displayFontT1 Courier-Oblique           /usr/share/ghostscript/fonts/n022023l.pfb
displayFontT1 Courier-Bold              /usr/share/ghostscript/fonts/n022004l.pfb
displayFontT1 Courier-BoldOblique       /usr/share/ghostscript/fonts/n022024l.pfb
displayFontT1 Symbol                    /usr/share/ghostscript/fonts/s050000l.pfb
displayFontT1 ZapfDingbats              /usr/share/ghostscript/fonts/d050000l.pfb

fontDir                 /usr/X11R6/lib/X11/fonts/truetype
psFile                  "|lpr"
psPaperSize             letter
enableT1lib             yes
enableFreeType          yes
antialias               yes
textEncoding                 GBK       
#----- begin Chinese Simplified support package (2004-jul-27)
cidToUnicode        Adobe-GB1        /usr/share/xpdf/chinese-simplified/Adobe-GB1.cidToUnicode
unicodeMap        ISO-2022-CN        /usr/share/xpdf/chinese-simplified/ISO-2022-CN.unicodeMap
unicodeMap        EUC-CN                /usr/share/xpdf/chinese-simplified/EUC-CN.unicodeMap
unicodeMap        GBK                /usr/share/xpdf/chinese-simplified/GBK.unicodeMap
cMapDir                Adobe-GB1        /usr/share/xpdf/chinese-simplified/CMap
toUnicodeDir                        /usr/share/xpdf/chinese-simplified/CMap
displayCIDFontTT Adobe-GB1 "/你的字体路径以及名称"
#----- end Chinese Simplified support package[/PHP]
最后还有一点需要注意,如果你没安装LessTif,记得一定要安装blfs-svn-20041120中推荐的LessTif-0.93.94
最新版的LessTif会倒置xpdf启动时出错!
发表于 2004-11-21 08:43:20 | 显示全部楼层
好。大家都将自己的经验整理一下。写出来,以利于后来者少走弯路。
向您学习。
发表于 2004-11-22 23:03:21 | 显示全部楼层
好!
发表于 2004-11-28 12:53:17 | 显示全部楼层
为什么会有下面的问题?
怎样解决?

xpdf-3.00 $ patch -Np1 -i ../xpdf-3.00pl1.patch
missing header for context diff at line 3 of patch
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|*** XRef.cc.orig       Thu Jul 22 11:04:22 2004
|--- XRef.cc    Thu Jul 22 11:04:31 2004
--------------------------
File to patch:
 楼主| 发表于 2004-11-28 15:12:34 | 显示全部楼层
你将p1改成p0试试??
发表于 2004-11-28 15:38:07 | 显示全部楼层
最初由 ippr1609 发表
为什么会有下面的问题?
怎样解决?

xpdf-3.00 $ patch -Np1 -i ../xpdf-3.00pl1.patch
missing header for context diff at line 3 of patch
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|*** XRef.cc.orig       Thu Jul 22 11:04:22 2004
|--- XRef.cc    Thu Jul 22 11:04:31 2004
--------------------------
File to patch:

cd xpdf-3.00/xpdf
then
patch -Np0 -i ...
发表于 2004-11-28 17:36:05 | 显示全部楼层
还是不行
我对patch命令不懂
能不能给出具体一点的patch方法
发表于 2004-11-29 10:04:07 | 显示全部楼层
在冒号后面打上XRef.cc 就行了,也就是它在问你给哪个文件打patch.
发表于 2004-11-29 23:53:34 | 显示全部楼层

上次搞定了xpdf的中文显示和书签,结果居然英文的pdf看不了

上次搞定了xpdf的中文显示和书签,结果居然英文的pdf看不了,只能看纯中文的。
今天我先打上gentoo的补丁,又打上debian的补丁和中文书签的补丁,总算都可以显示了。

不知道楼主的方法会不会看不了英文  :p :p
发表于 2004-11-30 00:06:46 | 显示全部楼层
应该到源代码的xpdf目录下面执行这个patch命令
patch -Np0 -i ../../xpdf-3.00pl1.patch

最初由 yurt 发表
你将p1改成p0试试??
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表