LinuxSir.cn,穿越时空的Linuxsir!

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

CJK-LaTeX中使用UTF8

[复制链接]
发表于 2005-9-18 15:30:59 | 显示全部楼层 |阅读模式
发表于 2005-9-18 15:56:16 | 显示全部楼层
打开好慢
等下试试
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-9-18 16:16:58 | 显示全部楼层
我打开挺快的. 呵呵. 把全文转贴过来吧


New way for generating fonts
Letter from Werner LEMBERG

At the time ttf2tfm has been written, the excellent fontforge font
editor wasn't available.  Today, I use a different route which will be
directly available in TeXLive.  Below you can find the steps to
convert the Chinese bsmi00lp.ttf into Unicode encoded Type 1 subfonts;
additionally, virtual fonts for Big 5 encoding and fonts with vertical
glyph representation forms are created.  The scripts are generic so
that you can use other encodings as well (I've done the same for
simplified Chinese and for Korean).

Those scripts are part of the CJK 4.6.0 version, in directory
utils/subfonts; *.pe files are for fontforge, *.pl are for perl.  Note
that fontforge can be compiled even on Windows platforms (but without
the GUI).

Finally, I suggest that you direct further questions to the cjk
mailing list so that others can participate (the snippet below is from
an answer sent to this list).


    Werner

======================================================================

For the bsmi00lp font in TeXLive, I've created *Unicode* encoded real
fonts which are mapped to virtual Big 5 fonts.  Using the font names
from TeXLive, we have


  # create Unicode encoded subfonts `bsmiu00' .. `bsmiuff'
  1. fontforge -script subfonts.pe bsmi00lp.ttf bsmiu Unicode.sfd
复制代码


  # create font `bsmiuv' with all vertical glyph representation forms
  1. fontforge -script vertical.pe bsmi00lp.ttf bsmiuv
复制代码


  # create font `bsmiuvr' which has the same structure as `bsmiuv',
  # but normal glyphs instead of vertical representation forms
  1. fontforge -script vertref.pe bsmi00lp.ttf bsmiuvr
复制代码


  # create a virtual font `bsmilpv' which is a clone of `bsmiuv'
  1. perl clonevf.pl bsmiuv bsmilpv
复制代码


  # create virtual fonts `bsmilp00' .. `bsmilp55' in Big 5 encoding
  # which use Unicode encoded `bsmiuXX' subfonts as raw fonts
  # and `cjkbig5' as the `CODINGSCHEME' parameter value
  1. perl uni2sfd.pl bsmiu UBig5.sfd bsmilp cjkbig5
复制代码


  # create entries for the extended font definition file
  # `c00bsmi.fdx' (which uses Big 5 encoding), with `bsmiuvr' as
  # the reference font
  1. perl makefdx.pl bsmiuvr.afm UBig5.sfd c00bsmi.fdx
复制代码


  # create entries for the extended font definition file
  # `c70bsmi.fdx' (which uses Unicode encoding), with `bsmiuvr' as
  # the reference font
  1. perl makefdx.pl bsmiuvr.afm Unicode.sfd c70bsmi.fdx
复制代码


Directory structure

teTeX3 requires the elegant directory structure, so in /usr/local/share/texmf/

fonts/cmap/UTF8-UCS2
fonts/enc/truetype/cyberb/cyberb??.enc
fonts/map/dvips/truetype/cyberbps.map
fonts/map/truetype/cyberb.map
fonts/sfd/Unicode.sfd
fonts/tfm/truetype/cyberb/cyberb??.tfm
fonts/truetype/Cyberbit.ttf
fonts/type1/truetype/cyberb/cyberb??.pfb
tex/latex/CJK/UTF8/c70cyberb.fd

cyberb.map

cyberb00 <cyberb00.enc <Cyberbit.ttf
...

cyberbps.map

cyberb00 cyberb00 <cyberb00.pfb
...

Configuration files
/usr/share/texmf/fonts/map/dvipdfm/cid-x.map

cyberb@Unicode@         Identity-H      :0:Cyberbit.ttf

updmap.cfg

Map cyberb.map

dvips/config/config.ps

p +cyberbps.map

xdvi/xdvi.cfg

dvipsmap cyberbps.map
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-9-18 16:24:45 | 显示全部楼层
我只用
  1. fontforge -script subfonts.pe gbsn00lp.ttf gbsnu Unicode.sfd
复制代码

生成tfm和pfb字体, 这样latex, dvipdfmx已经可以使用. 运行
  1. fontforge -script vertical.pe gbsn00lp.ttf gbsnuv
复制代码

时候出错.
Unicode.sfd包含在包freetype1-tools内.

默认生成的song使用粗体时候会出现彩虹, 可以用黑体或者粗宋体来代替.
回复 支持 反对

使用道具 举报

发表于 2006-7-13 20:58:30 | 显示全部楼层
我以前做过tetex 3 在utf8下生成相关的字体的配置
不过全都忘记了
现在要尝试用texlive+latex-cjk_4.6+cvs来实现

看过SDE兄所给的链接的网址

1.

感觉是不是只要安装了
http://chinese.alioth.debian.org/latex-cjk/
这里的latex-cjk-common +几个中文字体和latex-cjk-chinese
用里面的几个字体就行了呢?

2.

如果想添加字体是不是用
latex-cjk-common里的几个脚本配合fontforge来生成相应字体
配置一下相应文件(添加字体)就行了呢?

3.我在ustc的  unofficial源里发现了CTex相关包

latex-ctex-utf8
latex-cjkaddons
如果装上这两个包是不是基本上就能实现像CTex套装的效果了?
(感觉差不多,CTex也只不过做了一些宏包)
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-7-14 00:02:36 | 显示全部楼层
装完 latex-cjk-chinese-* 那几个字体,就可以使用 gbsn 等字体了,
\begin{CJK}{UTF8}{gbsn}...\end{CJK}

可以用 fontforge 通过 CJK 自带的那几个脚本来生成字体,然后自己生成 map, enc 等文件,最后进行配置。

ustc unofficial 里的 latex-ctex-utf8 和 latex-cjkaddon 没有装过,不知道包含哪些东东。不过我安装 cct 包和 ctex, cct 里的 ccmap 还是挺有用的,其他基本没用过。
回复 支持 反对

使用道具 举报

发表于 2006-7-14 14:08:24 | 显示全部楼层
ctex-utf8 or gbk 是ctex的宏包,估计是从ctex官方checkout出来的吧
  1. Package: latex-ctex-utf8
  2. Priority: extra
  3. Section: tex
  4. Installed-Size: 560
  5. Maintainer: oseen <lyfever@gmail.com>
  6. Architecture: i386
  7. Source: latex-ctex
  8. Version: 0.8-1
  9. Replaces: latex-ctex-gbk
  10. Depends: tex-common (>= 0.17)
  11. Recommends: tetex-bin (>= 3.0) | texlive-base-bin, tetex-extra (>= 3.0) | texlive-latex-extra, tetex-base (>= 3.0) | texlive-latex-base, tex-cjkfonts, latex-cjkaddons
  12. Suggests: latex-cjk-fonts-utf8song, latex-cjk-fonts-utf8kai, latex-cjk-fonts-utf8li, latex-cjk-fonts-utf8you, latex-cjk-fonts-utf8hei, latex-cjk-fonts-utf8fs
  13. Conflicts: latex-ctex-gbk
  14. Filename: dists/sid/misc/pool/latex-ctex/latex-ctex-utf8_0.8-1_i386.deb
  15. Size: 388174
  16. MD5sum: 0d7ef31eb3bc40823a77f2e644af63de
  17. Description: Chinese document class for LaTeX2e (UTF-8 version)
  18. Ctex macro provides an uniform framework for chinese document in
  19. LaTeX, it works on top of CJK or CCT but in a much user-friendly
  20. way.
  21. .
  22. You can either directly use the three documentclass (ctexarc,
  23. ctexrep, ctexbook) instead of using article, report or book,
  24. or you can invoke the macro by adding "usepackage{ctex}" on the
  25. preamble of your LaTeX source file.
  26. .
  27. This is the UTF-8 version of latex-ctex for those who uses UTF8
  28. and zh_CN.GB18030 locales
  29. .
  30. Homepage: http://www.ctex.org, http://www.ctex.org/PackageCTeX
复制代码

这个估计就是你说的CCT的宏包,里面有ccmap宏包,那个gbk2uni /utf2uni估计是解决中文标签乱码的问题的程序, CJKpunct不知道是干吗用的。
  1. Package: latex-cjkaddons
  2. Priority: extra
  3. Section: tex
  4. Installed-Size: 2458
  5. Maintainer: oseen <lyfever@gmail.com>
  6. Architecture: i386
  7. Version: 0.2-1
  8. Depends: libc6, tex-common (>= 0.16)
  9. Conflicts: tetex-cjkaddons
  10. Filename: dists/sid/misc/pool/thuthesis/latex-cjkaddons_0.2-1_i386.deb
  11. Size: 600812
  12. MD5sum: b9d79d49005b41962bdc87949e7b7539
  13. Description: Misc CJK utilities for thuthesis
  14. ccmap:
  15.   * Generate cmap files for using c(c)map.sty with CJK fonts.
  16. gbk2uni:
  17.   * Transform GBK characters in .out file to unicode codes.
  18. utf2uni:
  19.   * Transform UTF-8 characters in .out file to unicode codes.
  20. CJKpunct:
  21.   * Beautify TeX by adjusting CJK punctuations.
复制代码

感觉如果这两个包如果全包含了CTex 和CCT
那还是挺方便的
不过偶没测试过
现在想写个脚本来自动生成想加的字体和map、enc文件
不过我不太会写,而且我在考虑配置系统文件的问题
我喜欢把自己安装的字体和配置文件放到/usr/local/texmf里
配置系统设置可能不太难,难的是我想怎么能写一个删除配置的脚本,这样以后可以随时删除,做得标准一些,呵呵:)
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-7-14 16:46:29 | 显示全部楼层
CJKpunct 是调整标点符号的
回复 支持 反对

使用道具 举报

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

本版积分规则

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