W32TeX で otf.sty とヒラギノフォントを使う

2009 年 12 月 26 日 更新
Written by たちゃな@巫研 < tatyana at miko dot org >

T32TeX のインストール

http://w32tex.org/index-ja.html より最小+標準インストールの配布物を取得し、C:\temp\ 内に一時保存する。

C:\w32tex\ ディレクトリを用意し、そこに texinst2009.zip を展開する。

C:
cd \w32tex
texinst2009 C:\temp

C:\w32tex\bin\ を PATH に追加しておくこと。

otf.sty のインストール

http://w32tex.org/index-ja.html より otf.tar.bz2 (本稿執筆時点で v1.2.9 [2009/3/24]) を取得し、C:\w32tex\ に展開する。

dvipdfmx の設定

ここでは C:\w32tex\share\texmf\fonts\map\dvipdfmx\base\cid-x.map を直接編集した。

[C:\w32tex\share\texmf\fonts\map\dvipdfmx\base\cid-x.map]
...

%
% otf package (Hiragino) (S. Saito)
%
otf-ujmr-h   UniJIS-UTF16-H     HiraMinPro-W3.otf
otf-ujmr-v   UniJIS-UTF16-V     HiraMinPro-W3.otf
otf-cjmr-h   Identity-H         HiraMinPro-W3.otf
otf-cjmr-v   Identity-V         HiraMinPro-W3.otf
hminr-h      H                  HiraMinPro-W3.otf
hminr-v      V                  HiraMinPro-W3.otf

otf-ujgr-h   UniJIS-UTF16-H     HiraKakuPro-W3.otf
otf-ujgr-v   UniJIS-UTF16-V     HiraKakuPro-W3.otf
otf-cjgr-h   Identity-H         HiraKakuPro-W3.otf
otf-cjgr-v   Identity-V         HiraKakuPro-W3.otf
hgothr-h     H                  HiraKakuPro-W3.otf
hgothr-v     V                  HiraKakuPro-W3.otf

otf-ujmb-h   UniJIS-UTF16-H     HiraMinPro-W6.otf
otf-ujmb-v   UniJIS-UTF16-V     HiraMinPro-W6.otf
otf-cjmb-h   Identity-H         HiraMinPro-W6.otf
otf-cjmb-v   Identity-V         HiraMinPro-W6.otf
hminb-h      H                  HiraMinPro-W6.otf
hminb-v      V                  HiraMinPro-W6.otf

otf-ujgb-h   UniJIS-UTF16-H     HiraKakuPro-W6.otf
otf-ujgb-v   UniJIS-UTF16-V     HiraKakuPro-W6.otf
otf-cjgb-h   Identity-H         HiraKakuPro-W6.otf
otf-cjgb-v   Identity-V         HiraKakuPro-W6.otf
hgothb-h     H                  HiraKakuPro-W6.otf
hgothb-v     V                  HiraKakuPro-W6.otf

otf-ujmgr-h  UniJIS-UTF16-H     HiraMaruPro-W4.otf
otf-ujmgr-v  UniJIS-UTF16-V     HiraMaruPro-W4.otf
otf-cjmgr-h  Identity-H         HiraMaruPro-W4.otf
otf-cjmgr-v  Identity-V         HiraMaruPro-W4.otf
hmgothr-h    H                  HiraMaruPro-W4.otf
hmgothr-v    V                  HiraMaruPro-W4.otf

%otf-ukmr-h   UniKS-UCS2-H       HYSMyeongJoStd-Medium-Acro.otf
%otf-ukmr-v   UniKS-UCS2-V       HYSMyeongJoStd-Medium-Acro.otf
%%otf-ukgr-h   UniKS-UCS2-H       HYGoThic-Medium
%%otf-ukgr-v   UniKS-UCS2-V       HYGoThic-Medium

%otf-ucmr-h   UniGB-UCS2-H       STSongStd-Light-Acro.otf
%otf-ucmr-v   UniGB-UCS2-V       STSongStd-Light-Acro.otf
%%otf-ucgr-h   UniGB-UCS2-H       STHeiti-Regular
%%otf-ucgr-v   UniGB-UCS2-V       STHeiti-Regular

%otf-utmr-h   UniCNS-UCS2-H      MSungStd-Light-Acro.otf
%otf-utmr-v   UniCNS-UCS2-V      MSungStd-Light-Acro.otf
%%otf-utgr-h   UniCNS-UCS2-H      MHei-Medium
%%otf-utgr-v   UniCNS-UCS2-V      MHei-Medium

%otf-ckmr-h   Identity-H         HYSMyeongJoStd-Medium-Acro.otf
%otf-ckmr-v   Identity-V         HYSMyeongJoStd-Medium-Acro.otf
%%otf-ckgr-h   Identity-H         HYGoThic-Medium
%%otf-ckgr-v   Identity-V         HYGoThic-Medium

%otf-ccmr-h   Identity-H         STSongStd-Light-Acro.otf
%otf-ccmr-v   Identity-V         STSongStd-Light-Acro.otf
%%otf-ccgr-h   Identity-H         STHeiti-Regular
%%otf-ccgr-v   Identity-V         STHeiti-Regular

%otf-ctmr-h   Identity-H         MSungStd-Light-Acro.otf
%otf-ctmr-v   Identity-V         MSungStd-Light-Acro.otf
%%otf-ctgr-h   Identity-H         MHei-Medium
%%otf-ctgr-v   Identity-V         MHei-Medium

hgotheb-h    H                  HiraKakuStd-W8.otf
hgotheb-v    V                  HiraKakuStd-W8.otf
otf-ujml-h   UniJIS-UTF16-H     HiraMinPro-W2.otf
otf-ujml-v   UniJIS-UTF16-V     HiraMinPro-W2.otf
otf-cjml-h   Identity-H         HiraMinPro-W2.otf
otf-cjml-v   Identity-V         HiraMinPro-W2.otf
hminl-h      H                  HiraMinPro-W2.otf
hminl-v      V                  HiraMinPro-W2.otf

...

%%
%% otf (using other fonts than Hiragino)
%%
%otf-ujmr-h    UniJIS-UTF16-H KozMinPro-Regular-Acro.otf
%otf-ujmr-v    UniJIS-UTF16-V KozMinPro-Regular-Acro.otf
%otf-cjmr-h    Identity-H     KozMinPro-Regular-Acro.otf
%otf-cjmr-v    Identity-V     KozMinPro-Regular-Acro.otf
%hminr-h       H              KozMinPro-Regular-Acro.otf
%hminr-v       V              KozMinPro-Regular-Acro.otf

%otf-ujgr-h    UniJIS-UTF16-H KozGoPro-Medium-acro.otf
%otf-ujgr-v    UniJIS-UTF16-V KozGoPro-Medium-acro.otf
%otf-cjgr-h    Identity-H     KozGoPro-Medium-acro.otf
%otf-cjgr-v    Identity-V     KozGoPro-Medium-acro.otf
%hgothr-h      H              KozGoPro-Medium-acro.otf
%hgothr-v      V              KozGoPro-Medium-acro.otf

%otf-ujmb-h    UniJIS-UTF16-H KozMinStd-Bold.otf
%otf-ujmb-v    UniJIS-UTF16-V KozMinStd-Bold.otf
%otf-cjmb-h    Identity-H     KozMinStd-Bold.otf
%otf-cjmb-v    Identity-V     KozMinStd-Bold.otf
%hminb-h       H              KozMinStd-Bold.otf
%hminb-v       V              KozMinStd-Bold.otf

%otf-ujgb-h    UniJIS-UTF16-H KozGoStd-Bold.otf
%otf-ujgb-v    UniJIS-UTF16-V KozGoStd-Bold.otf
%otf-cjgb-h    Identity-H     KozGoStd-Bold.otf
%otf-cjgb-v    Identity-V     KozGoStd-Bold.otf
%hgothb-h      H              KozGoStd-Bold.otf
%hgothb-v      V              KozGoStd-Bold.otf

%otf-ujmgr-h   UniJIS-UTF16-H KozGoStd-Heavy.otf
%otf-ujmgr-v   UniJIS-UTF16-V KozGoStd-Heavy.otf
%otf-cjmgr-h   Identity-H     KozGoStd-Heavy.otf
%otf-cjmgr-v   Identity-V     KozGoStd-Heavy.otf
%hmgothr-h     H              KozGoStd-Heavy.otf
%hmgothr-v     V              KozGoStd-Heavy.otf

otf-utmr-h    UniCNS-UTF16-H MSungStd-Light-Acro.otf
otf-utmr-v    UniCNS-UTF16-V MSungStd-Light-Acro.otf
otf-utgr-h    UniCNS-UTF16-H MHei-Medium-Acro.otf
otf-utgr-v    UniCNS-UTF16-V MHei-Medium-Acro.otf
otf-ucmr-h    UniGB-UTF16-H  STSongStd-Light-Acro.otf
otf-ucmr-v    UniGB-UTF16-V  STSongStd-Light-Acro.otf
otf-ucgr-h    UniGB-UTF16-H  STHeiti-Regular.otf
otf-ucgr-v    UniGB-UTF16-V  STHeiti-Regular.otf
otf-ukmr-h    UniKS-UTF16-H  HYSMyeongJoStd-Medium-Acro.otf
otf-ukmr-v    UniKS-UTF16-V  HYSMyeongJoStd-Medium-Acro.otf
otf-ukgr-h    UniKS-UTF16-H  HYGoThic-Medium-Acro.otf
otf-ukgr-v    UniKS-UTF16-V  HYGoThic-Medium-Acro.otf
otf-ckmr-h    Identity-H     HYSMyeongJoStd-Medium-Acro.otf
otf-ckmr-v    Identity-V     HYSMyeongJoStd-Medium-Acro.otf
%otf-ckgr-h   Identity-H     HYGoThic-Medium
%otf-ckgr-v   Identity-V     HYGoThic-Medium
otf-ccmr-h    Identity-H     STSongStd-Light-Acro.otf
otf-ccmr-v    Identity-V     STSongStd-Light-Acro.otf
%otf-ccgr-h   Identity-H     STHeiti-Regular
%otf-ccgr-v   Identity-V     STHeiti-Regular
otf-ctmr-h    Identity-H     MSungStd-Light-Acro.otf
otf-ctmr-v    Identity-V     MSungStd-Light-Acro.otf
%otf-ctgr-h   Identity-H     MHei-Medium
%otf-ctgr-v   Identity-V     MHei-Medium
%
% otfextra
%
%hgotheb-h     H              DFHSGothicStd-W9.otf
%hgotheb-v     V              DFHSGothicStd-W9.otf
%otf-ujml-h    UniJIS-UTF16-H DFHSMinchoStd-W3.otf
%otf-ujml-v    UniJIS-UTF16-V DFHSMinchoStd-W3.otf
%otf-cjml-h    Identity-H     DFHSMinchoStd-W3.otf
%otf-cjml-v    Identity-V     DFHSMinchoStd-W3.otf
%hminl-h       H              DFHSMinchoStd-W3.otf
%hminl-v       V              DFHSMinchoStd-W3.otf

...

ヒラギノフォントのインストール

C:\w32tex\share\texmf\fonts\opentype ディレクトリを用意し、そこに以下のような名前でヒラギノフォントを設置する。

2003/09/13  11:18         9,367,476 HiraKakuPro-W3.otf
2003/09/13  11:18         8,876,804 HiraKakuPro-W6.otf
2003/09/13  11:18         4,281,976 HiraKakuStd-W8.otf
2003/09/13  11:18        10,114,744 HiraMaruPro-W4.otf
2003/09/13  11:18        11,585,924 HiraMinPro-W3.otf
2003/09/13  11:18        11,097,336 HiraMinPro-W6.otf

cmap のインストール

http://distfiles.macports.org/pTeX/cmap-gs863.tar.gz より UniJIS-UTF16-H, UniJIS-UTF16-V を取り出し、C:\w32tex\share\texmf\fonts\cmap\ にコピーする。

mktexlsr の実行

最後に

mktexlsr を実行し、ファイルが正しく検索されるようにする。

mktexlsr

以上でとりあえずの運用ができるようになる。

サンプルソースの組版結果


return