[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 大家 新年快乐 ! <关于CJK的新包>



Hi!

> > Here are a few highlights:
> >  - CJK version 4.6.0, with CVS changes up to 2005年10月31日
> >    lots of things have changed, e.g. now you can use bkai or gbsn in a
> >    UTF-8 encoded file, and you don't need to wait for those PK fonts
> >    to get compiled: CJK now uses primarily .pfb fonts
> These fonts names drove me mad. What is .pfb fonts anyway? Where to get them
> and how to install them? The only font type I know of is .ttf (is it called
> truetype?) and I am wondering where I can get more information about these
> weird font names. 
> >  - recreate the Arphic TFM fonts, and provide Type1 fonts (that's the
> >    way CJK now uses: it has dropped ttf2tfm in favour of fontforge)
> >    along with the necessary .map files
> Again. What is Type1 fonts and what is its functions?

You can get all the fonts from the same Alioth APT repository:
latex-cjk-chinese-arphic-*.deb.  If you want to include your own
Chinese fonts, then you'll have to use Fontforge and a few Perl
scripts.  You'll find them in /usr/share/latex-cjk/utils/subfonts/.
Mind though, creating the .pfb files will take an hour or two, or
three, for each font.  ttf2tfm is much quicker, but hey, Type1 fonts
are better than TFM/PK fonts.

  .ttf are indeed TrueType Fonts.  They're easy to use, because all
glyphs ("characters") are contained in one file.  Unfortunately, LaTeX
can't read these font files; each TeX font metric file (.tfm) can only
contain up to 256 glyphs per page.  Omega and Lambda support TTF
natively, but are still not popular in contrast to TeX and LaTeX.

  So we need to split these TTF into different smaller files.  If it's
a GB2312 encoded file, we need about 30, if it's Big5, we need about 55
parts.  A TTF is converted to .tfm, .afm [Adobe font metrics] and .pfb
[Type1 fonts] files.  .tfm files are used by (La)TeX to calculate the
space each glyph needs.  But to actually display the DVI file, or
convert it to PDF or PS, you will need the actual fonts: either PK
or Type1 fonts.

  PK fonts are "packed" bitmap fonts, and inherently get a bit chunky
and pixelated.  We had a TTF, converted it to TFM with "ttf2tfm", and
when we ran "xdvi", "dvips" or "dvipdfm", MakeTeXPK would make PK
fonts from these TFM fonts using ttf2pk.  Every time you used new
characters and MakeTeXPK didn't compile these PK fonts before, you had
to wait a few minutes before xdvi or other program would finally show
the result.  This was the way *before* CJK4.6.0.

  Type1 fonts are the so-called "Postscript fonts", and end with the
suffix ".pfa".  But .pfa files are quite big because they are simple
7-bit clean ASCII files, so we compress it into binaries, and it
becomes ".pfb" [which is BTW also used in PDF].  These .pfb fonts
provide some better quality, and it makes the quality of the fonts
consistent: whether you use xdvi, dvips, dvipdfm or pdflatex, the
result will always be the same.

  The naming scheme might be somewhat complicated indeed: the regular
Norasi Thai font for example is called "ftnr8z.tfm".  It is an acronym
of different names according to Karl Berry's font naming scheme.  It
also takes into account the limitation of a certain OS with 8.3
filenames... *shrug*

  There are four fonts that I provide, the Arphic fonts.  They are
called "bkai", "bsmi", "gkai" and "gbsn".  Bkai and bsmi are for
traditional Chinese [fanti; Big5 encoded], gkai and gbsn are for
simplified Chinese [jianti; GB2312 encoded].  The .pfb fonts are
derived from the same Arphic TTF fonts that are provided in Debian.


> >  - compatible with teTeX3 and TeXlive Debian packages, with necessary
> >    changes to the filepaths because of TDS1.1
> I have a penchant for Texlive iso images since I assume that Texlive cd
> images are more complete and supposed to work better than Debian packages.
> (I know I am very much on the wrong side). The problem I have is: Debian
> packages put all the configuration files in /etc but for Texlive cd the
> directory structure seems quite different. So when I installed some new
> gbkfont converted Chinese fonts, I don't know how to make them compliant
> with with Debian's Latex suite. 

The latex-cjk package is not compatible with the original TeXlive CD,
but Norbert Preining has recently packaged the TeXlive distro for
Debian.  You can put
  deb http://www.tug.org/texlive/Debian/pool/
  deb-src http://www.tug.org/texlive/Debian/pool/
to your /etc/apt/sources.list.  TeXlive does indeed contain all
packages and work alright, but some Debian specific things like Emacs
Lisp scripts are not installed autmatically.  I hope that my packages
work as well as TeXlive CD.  Norbert Preining's TeXlive packages
now depend on latex-cjk.


> > If you use some of the HBF fonts, don't upgrade (yet).  I still need
> > to repackage them, i.e. applying the new TDS1.1 filepaths and
> > providing the font definition (.fd) files.  But who uses these fonts
> > anyway, apart from CNS users? o.O?
> 
> What does this HBF fonts mean and again what is its functions?

HBF fonts are Hanzi Bitmap Fonts (which you can find at
http://www.ibiblio.org/pub/packages/ccic/software/info/HBF-1.1/).  As
the name says, these are bitmap fonts and IMHO quite ugly if you wish
to use these for typesetting.  But... the complete CNS is available in
HBF, so this makes it interesting for people who wish to use some very
exotic characters might be interested in them (like me *ahem*).  All
seven "planes" are provided.  You can find the fonts and lots more at
http://www.ibiblio.org/pub/packages/ccic/software/fonts/, but they are
also packaged in Debian.  Beware though: my recent latex-cjk uploads
don't support HBF yet because of some internal changes.  If you want
to use HBF fonts, use the older cjk-latex4.5.1 with the hbf-*
packages.


> Last question: 
> 
> I know there are some free Chinese fonts available but are they immediately
> workable when I install CJK/latex package (I mean all those fonts are
> available in .pfb/type1/HBF format so that I can use them right away?) ?
> Are those free fonts up to the serious task like writing a file with lots characters
> that needs GBK encoding?  Or do I need the gbkfont tool to covert some MS
> windows fonts?

I have no experience (yet) with the GBK encoding, but it might be
worth a try.  UTF-8 though is now fully supported, so you can mix
FanTi and JianTi without problems anymore (this was an issue *before*
CJK4.6.0).  So perhaps you could use "iconv" to convert some texts
into UTF-8, and then insert them in a .tex file.

  I wouldn't worry about MS Windows fonts: the Arphic fonts are just
as beautiful, and with LaTeX they'll come out even more beautiful than
with M$ Word.


> I am really a beginner of Tex/Latex and your kind help is appreciated. 

Everyone has to start somewhere, aye? ;)  And CJK issues are not
easy.  So you're most welcome to ask any questions about TeX/LaTeX.


Best regards



Danai SAE-HAN
韓達耐

-- 
题目:《四时田园杂兴》(选一)
作者:范成大(1126-1193)

昼出耘田夜绩麻,村庄儿女各当家。
童孙未解供耕织,也傍桑阴学种瓜。



Reply to: