Saturday, April 13, 2013

Texlive and CJK

  1. suppose texlive and CJK is installed correctly
  2. install fontforge
    sudo apt-get install fontforge
  3. download font.tar.bz2
  4. prepare font song.ttc, and generate font files
    fontforge -script simsun.ttc song Unicode.sfd
  5. create bash script, run the script to generate map file
    if [ -f ]; then
    for i in *.tfm
        echo "${i%.tfm} ${i%.tfm} <${i%.tfm}.pfb" >>
  6. create c70song.fd
    % This is c70song.fd for CJK package.
    % created by Edward G.J. Lee
    % modify by Yue Wang
    \DeclareFontFamily{C70}{song}{\hyphenchar \font\m@ne}
    \DeclareFontShape{C70}{song}{m}{n}{<-> CJK * song}{}
    \DeclareFontShape{C70}{song}{bx}{n}{<-> CJKb * song}{\CJKbold}
  7. check system conf file location
    kpsewhich texmf.cnf
  8. change TEXMFHOME to
    TEXMFHOME = $HOME/texmf
  9. change TEXMFDBS to
  10. mimic texmf tree and copy fonts and configs. texmf should match those in TEXMFHOME
    mkdir -p ~/texmf/fonts/map/dvips/CJK
    mkdir -p ~/texmf/fonts/tfm/CJK/song
    mkdir -p ~/texmf/fonts/type1/CJK/song
    mkdir -p ~/texmf/tex/latex/CJK/UTF8
    cp   ~/texmf/fonts/map/dvips/CJK
    cp *.tfm      ~/texmf/fonts/tfm/CJK/song
    cp *.pfb      ~/texmf/fonts/type1/CJK/song
    cp c70song.fd ~/texmf/tex/latex/CJK/UTF8
  11. update system conf
    sudo texhash
  12. in $HOME/texmf/fonts/map/pdftex/updmap/, append content in

No comments:

Post a Comment