LinuxSir.cn,穿越时空的Linuxsir!

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

tetex中文环境完美解决UTF-8编码,现放出ebuild

[复制链接]
发表于 2006-9-9 11:21:32 | 显示全部楼层 |阅读模式
鉴于上一个帖子大家对该配置的积极响应,今改善了一下脚本,大大提高了配置的自动化程度,放出ebuild供大家分享,希望大家喜欢。。。

不再以附件形式提供ebuild,请使用gentoo-china-overlay,直接emerge latex-unicode-font-utils即可,配置好/etc/font_maps.dat文件,格式基本同locale.gen,然后执行instfonts.<local/home> <你的中文字体目录>即可。

如果希望生成配置文件到主目录下则执行instfonts.home,如果希望生成配置文件到/usr/local/share/texmf下所有用户都可以使用,则执行instfonts.local。

生成pdf流程如下:
latex xxx.tex
dvipdfmx -v xxx.dvi

祝大家好运!
 楼主| 发表于 2006-9-9 13:55:36 | 显示全部楼层
晕。。。兄弟们来测试测试啊。。。
回复 支持 反对

使用道具 举报

发表于 2006-9-9 14:01:46 | 显示全部楼层
友情顶一个!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-9-9 16:40:23 | 显示全部楼层
又修改了一下脚本,配置时间会大大缩短的
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-9-9 21:14:58 | 显示全部楼层
不好意思又改一次贴,以前的配置脚本最终产生的环境用dvipdfmx输出pdf时无法做到直接嵌入TrueType字体而使用由ttf2pt1产生的Type1字体,任何工具不管是gbkfonts还是ttf2p1都无法完美地做到TrueType字体到Type1字体的转换,总是会有瑕疵的,而这次研究了一下dvipdfmx代码,真正完美解决了dvipdfmx生成pdf的问题,现在生成的pdf内嵌TrueType字体而不是Type1字体,pdf中的字体效果非常完美,而且文档更小。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

发表于 2006-9-9 21:52:04 | 显示全部楼层
无限,真的被你超越了!

强力支持~ 测试中。。。
回复 支持 反对

使用道具 举报

发表于 2006-9-9 22:06:08 | 显示全部楼层
编译失败了。。。
$ latex test-utf8.tex

This is pdfeTeX, Version 3.141592-1.30.5-2.2 (Web2C 7.5.5)
entering extended mode
(./test-utf8.tex
LaTeX2e <2003/12/01>
Babel <v3.8d> and hyphenation patterns for american, french, german, ngerman, b
ahasa, basque, bulgarian, catalan, croatian, czech, danish, dutch, esperanto, e
stonian, finnish, greek, icelandic, irish, italian, latin, magyar, norsk, polis
h, portuges, romanian, russian, serbian, slovak, slovene, spanish, swedish, tur
kish, ukrainian, nohyphenation, loaded.
(/usr/share/texmf/tex/latex/base/book.cls
Document Class: book 2004/02/16 v1.4f Standard LaTeX document class
(/usr/share/texmf/tex/latex/base/bk12.clo))
(/usr/share/texmf/tex/latex/cjk-latex/CJK.sty
(/usr/share/texmf/tex/latex/cjk-latex/mule/MULEenc.sty)
(/usr/share/texmf/tex/latex/cjk-latex/CJK.enc)) (./test-utf8.aux)
(/usr/share/texmf/tex/latex/cjk-latex/UTF8/UTF8.bdg)
(/usr/share/texmf/tex/latex/cjk-latex/UTF8/UTF8.enc)
(/usr/share/texmf/tex/latex/cjk-latex/UTF8/UTF8.chr)
(/usr/share/texmf/tex/latex/cjk-latex/UTF8/c70song.fd)kpathsea: Running mktextfm cyberb62
/var/lib/texmf/web2c/mktexnam: Could not map typeface abbreviation yb for cyberb62.
/var/lib/texmf/web2c/mktexnam: Need to update /usr/share/texmf/fonts/map/fontname/special.map?
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input cyberb62
This is METAFONT, Version 2.71828 (Web2C 7.5.5)

kpathsea: Running mktexmf cyberb62
! I can't find file `cyberb62'.
<*> ...ljfour; mag:=1; nonstopmode; input cyberb62
                                                  
Please type another input file name
! Emergency stop.
<*> ...ljfour; mag:=1; nonstopmode; input cyberb62
                                                  
Transcript written on mfput.log.
grep: cyberb62.log: 没有那个文件或目录
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input cyberb62' failed to make cyberb62.tfm.
kpathsea: Appending font creation commands to missfont.log.
! Font C70/song/bx/n/17.28/62=cyberb62 at 17.28pt not loadable: Metric (TFM) fi
le not found.
<to be read again>
                   relax
l.7 \section*{我为何而生}
                              
?
! Emergency stop.
<to be read again>
                   relax
l.7 \section*{我为何而生}
                              
No pages of output.
Transcript written on test-utf8.log.
回复 支持 反对

使用道具 举报

发表于 2006-9-9 22:09:23 | 显示全部楼层
怎么用instfonts.sh生成的~/texmf只有140K大小
~ $ instfonts.sh /usr/share/fonts/ttf/zh_CN/
/usr/bin/ttf2pt1
/usr/bin/t1asm
/usr/bin/extconv
***************************************************************************
* Please confirm that current working directory is EMPTY except scripts   *
* and HAS ENOUGH SPACE to contain so many intermediate files.             *
* If it is not empty, this script may DAMAGE INNOCENT FILES!!!            *
***************************************************************************
/usr/bin/ttf2pt1
/usr/bin/t1asm
/usr/bin/extconv
***************************************************************************
* Please confirm that current working directory is EMPTY except scripts   *
* and HAS ENOUGH SPACE to contain so many intermediate files.             *
* If it is not empty, this script may DAMAGE INNOCENT FILES!!!            *
***************************************************************************
/usr/bin/ttf2pt1
/usr/bin/t1asm
/usr/bin/extconv
***************************************************************************
* Please confirm that current working directory is EMPTY except scripts   *
* and HAS ENOUGH SPACE to contain so many intermediate files.             *
* If it is not empty, this script may DAMAGE INNOCENT FILES!!!            *
***************************************************************************
/usr/bin/ttf2pt1
/usr/bin/t1asm
/usr/bin/extconv
***************************************************************************
* Please confirm that current working directory is EMPTY except scripts   *
* and HAS ENOUGH SPACE to contain so many intermediate files.             *
* If it is not empty, this script may DAMAGE INNOCENT FILES!!!            *
***************************************************************************
/usr/bin/ttf2pt1
/usr/bin/t1asm
/usr/bin/extconv
***************************************************************************
* Please confirm that current working directory is EMPTY except scripts   *
* and HAS ENOUGH SPACE to contain so many intermediate files.             *
* If it is not empty, this script may DAMAGE INNOCENT FILES!!!            *
***************************************************************************
mktexlsr: Updating /home/mf/texmf/ls-R...
mktexlsr: /usr/share/texmf: directory not writable. Skipping...
mktexlsr: /usr/share/texmf-site: directory not writable. Skipping...
mktexlsr: /var/cache/fonts/ls-R: no write permission. Skipping...
mktexlsr: /var/lib/texmf: directory not writable. Skipping...
mktexlsr: Done.
updmap: This is updmap, version 1122009795
updmap: using transcript file `/home/mf/.texmf-var/web2c/updmap.log'
updmap: initial config file is `/var/lib/texmf/web2c/updmap.cfg'
updmap: configuration (updmap.cfg) unchanged. Map files will not be recreated.
回复 支持 反对

使用道具 举报

发表于 2006-9-9 23:26:32 | 显示全部楼层
Post by debianl
不好意思又改一次贴,以前的配置脚本最终产生的环境用dvipdfmx输出pdf时无法做到直接嵌入TrueType字体而使用由ttf2pt1产生的Type1字体,任何工具不管是gbkfonts还是ttf2p1都无法完美地做到TrueType字体到Type1字体的转换,总是会有瑕疵的,而这次研究了一下dvipdfmx代码,真正完美解决了dvipdfmx生成pdf的问题,现在生成的pdf内嵌TrueType字体而不是Type1字体,pdf中的字体效果非常完美,而且文档更小。
你说的是什么瑕疵?可否说具体点?
回复 支持 反对

使用道具 举报

发表于 2006-9-10 03:58:46 | 显示全部楼层
使用新的ebuild后,生成的pdf确实比之前好看了,但我用xdvi直接查看生成的dvi文件时出错,
按楼主之前的方法dvi可以查看
  1. kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+120/600 --dpi 720 stsong7f
  2. mktexpk: don't know how to create bitmap font for stsong7f.
  3. kpathsea: Appending font creation commands to missfont.log.
  4. xdvi: Error: Can't find font stsong7f; using cmr10 instead. Expect ugly output.
  5. kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+120/600 --dpi 720 stsong81
复制代码
之类的提示,中文变成乱码,是否缺少Type1字体?这是我个人设置的问题吗?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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