Re:VIEWでPDFを作成するとき、フリーフォントのMigmixを埋め込みたかったのでメモ

### 実行環境

CentOS 6
Texlive 2014

### フォントを「/usr/local/texlive/texmf-local/fonts/truetype/public/migmix」に配置

配置したフォントは「MigMix-1M-regular.ttf」 「MigMix-2P-bold.ttf」


### mapを作成

```shell-session
cd /usr/local/texlive/texmf-local/fonts/map/dvipdfmx
```
「map」「dvipdfmx」フォルダがなければ作成する

* 「otf-migmix.map」「otf-up-migmix.map」「ptex-migmix.map」「uptex-migmix.map」を作成

確かipa.mapからコピペった

```map:otf-migmix.map
% TEXT, 90JIS
hminl-h	H	MigMix-1M-regular.ttf %!PS IPAMincho
hminl-v	V	MigMix-1M-regular.ttf %!PS IPAMincho
hminr-h	H	MigMix-1M-regular.ttf %!PS IPAMincho
hminr-v	V	MigMix-1M-regular.ttf %!PS IPAMincho
hminb-h	H	MigMix-1M-regular.ttf %!PS IPAMincho
hminb-v	V	MigMix-1M-regular.ttf %!PS IPAMincho
hgothr-h	H	MigMix-2P-bold.ttf %!PS IPAGothic
hgothr-v	V	MigMix-2P-bold.ttf %!PS IPAGothic
hgothb-h	H	MigMix-2P-bold.ttf %!PS IPAGothic
hgothb-v	V	MigMix-2P-bold.ttf %!PS IPAGothic
hgotheb-h	H	MigMix-2P-bold.ttf %!PS IPAGothic
hgotheb-v	V	MigMix-2P-bold.ttf %!PS IPAGothic
hmgothr-h	H	MigMix-2P-bold.ttf %!PS IPAGothic
hmgothr-v	V	MigMix-2P-bold.ttf %!PS IPAGothic

% TEXT, JIS04
hminln-h	H	MigMix-1M-regular.ttf %!PS IPAMincho
hminln-v	V	MigMix-1M-regular.ttf %!PS IPAMincho
hminrn-h	H	MigMix-1M-regular.ttf %!PS IPAMincho
hminrn-v	V	MigMix-1M-regular.ttf %!PS IPAMincho
hminbn-h	H	MigMix-1M-regular.ttf %!PS IPAMincho
hminbn-v	V	MigMix-1M-regular.ttf %!PS IPAMincho
hgothrn-h	H	MigMix-2P-bold.ttf %!PS IPAGothic
hgothrn-v	V	MigMix-2P-bold.ttf %!PS IPAGothic
hgothbn-h	H	MigMix-2P-bold.ttf %!PS IPAGothic
hgothbn-v	V	MigMix-2P-bold.ttf %!PS IPAGothic
hgothebn-h	H	MigMix-2P-bold.ttf %!PS IPAGothic
hgothebn-v	V	MigMix-2P-bold.ttf %!PS IPAGothic
hmgothrn-h	H	MigMix-2P-bold.ttf %!PS IPAGothic
hmgothrn-v	V	MigMix-2P-bold.ttf %!PS IPAGothic

% CID
otf-cjml-h	Identity-H	MigMix-1M-regular.ttf/AJ16 %!PS IPAMincho
otf-cjml-v	Identity-V	MigMix-1M-regular.ttf/AJ16 %!PS IPAMincho
otf-cjmr-h	Identity-H	MigMix-1M-regular.ttf/AJ16 %!PS IPAMincho
otf-cjmr-v	Identity-V	MigMix-1M-regular.ttf/AJ16 %!PS IPAMincho
otf-cjmb-h	Identity-H	MigMix-1M-regular.ttf/AJ16 %!PS IPAMincho
otf-cjmb-v	Identity-V	MigMix-1M-regular.ttf/AJ16 %!PS IPAMincho
otf-cjgr-h	Identity-H	MigMix-2P-bold.ttf/AJ16 %!PS IPAGothic
otf-cjgr-v	Identity-V	MigMix-2P-bold.ttf/AJ16 %!PS IPAGothic
otf-cjgb-h	Identity-H	MigMix-2P-bold.ttf/AJ16 %!PS IPAGothic
otf-cjgb-v	Identity-V	MigMix-2P-bold.ttf/AJ16 %!PS IPAGothic
otf-cjge-h	Identity-H	MigMix-2P-bold.ttf/AJ16 %!PS IPAGothic
otf-cjge-v	Identity-V	MigMix-2P-bold.ttf/AJ16 %!PS IPAGothic
otf-cjmgr-h	Identity-H	MigMix-2P-bold.ttf/AJ16 %!PS IPAGothic
otf-cjmgr-v	Identity-V	MigMix-2P-bold.ttf/AJ16 %!PS IPAGothic

% Unicode 90JIS
otf-ujml-h	UniJIS-UTF16-H	MigMix-1M-regular.ttf %!PS IPAMincho
otf-ujml-v	UniJIS-UTF16-V	MigMix-1M-regular.ttf %!PS IPAMincho
otf-ujmr-h	UniJIS-UTF16-H	MigMix-1M-regular.ttf %!PS IPAMincho
otf-ujmr-v	UniJIS-UTF16-V	MigMix-1M-regular.ttf %!PS IPAMincho
otf-ujmb-h	UniJIS-UTF16-H	MigMix-1M-regular.ttf %!PS IPAMincho
otf-ujmb-v	UniJIS-UTF16-V	MigMix-1M-regular.ttf %!PS IPAMincho
otf-ujgr-h	UniJIS-UTF16-H	MigMix-2P-bold.ttf %!PS IPAGothic
otf-ujgr-v	UniJIS-UTF16-V	MigMix-2P-bold.ttf %!PS IPAGothic
otf-ujgb-h	UniJIS-UTF16-H	MigMix-2P-bold.ttf %!PS IPAGothic
otf-ujgb-v	UniJIS-UTF16-V	MigMix-2P-bold.ttf %!PS IPAGothic
otf-ujge-h	UniJIS-UTF16-H	MigMix-2P-bold.ttf %!PS IPAGothic
otf-ujge-v	UniJIS-UTF16-V	MigMix-2P-bold.ttf %!PS IPAGothic
otf-ujmgr-h	UniJIS-UTF16-H	MigMix-2P-bold.ttf %!PS IPAGothic
otf-ujmgr-v	UniJIS-UTF16-V	MigMix-2P-bold.ttf %!PS IPAGothic

% Unicode JIS04
otf-ujmln-h	UniJIS2004-UTF16-H	MigMix-1M-regular.ttf %!PS IPAMincho
otf-ujmln-v	UniJIS2004-UTF16-V	MigMix-1M-regular.ttf %!PS IPAMincho
otf-ujmrn-h	UniJIS2004-UTF16-H	MigMix-1M-regular.ttf %!PS IPAMincho
otf-ujmrn-v	UniJIS2004-UTF16-V	MigMix-1M-regular.ttf %!PS IPAMincho
otf-ujmbn-h	UniJIS2004-UTF16-H	MigMix-1M-regular.ttf %!PS IPAMincho
otf-ujmbn-v	UniJIS2004-UTF16-V	MigMix-1M-regular.ttf %!PS IPAMincho
otf-ujgrn-h	UniJIS2004-UTF16-H	MigMix-2P-bold.ttf %!PS IPAGothic
otf-ujgrn-v	UniJIS2004-UTF16-V	MigMix-2P-bold.ttf %!PS IPAGothic
otf-ujgbn-h	UniJIS2004-UTF16-H	MigMix-2P-bold.ttf %!PS IPAGothic
otf-ujgbn-v	UniJIS2004-UTF16-V	MigMix-2P-bold.ttf %!PS IPAGothic
otf-ujgen-h	UniJIS2004-UTF16-H	MigMix-2P-bold.ttf %!PS IPAGothic
otf-ujgen-v	UniJIS2004-UTF16-V	MigMix-2P-bold.ttf %!PS IPAGothic
otf-ujmgrn-h	UniJIS2004-UTF16-H	MigMix-2P-bold.ttf %!PS IPAGothic
otf-ujmgrn-v	UniJIS2004-UTF16-V	MigMix-2P-bold.ttf %!PS IPAGothic
```

```map:otf-up-migmix.map
% TEXT, 90JIS
uphminl-h	UniJIS-UTF16-H	MigMix-1M-regular.ttf %!PS IPAMincho
uphminl-v	UniJIS-UTF16-V	MigMix-1M-regular.ttf %!PS IPAMincho
uphminr-h	UniJIS-UTF16-H	MigMix-1M-regular.ttf %!PS IPAMincho
uphminr-v	UniJIS-UTF16-V	MigMix-1M-regular.ttf %!PS IPAMincho
uphminb-h	UniJIS-UTF16-H	MigMix-1M-regular.ttf %!PS IPAMincho
uphminb-v	UniJIS-UTF16-V	MigMix-1M-regular.ttf %!PS IPAMincho
uphgothr-h	UniJIS-UTF16-H	MigMix-2P-bold.ttf %!PS IPAGothic
uphgothr-v	UniJIS-UTF16-V	MigMix-2P-bold.ttf %!PS IPAGothic
uphgothb-h	UniJIS-UTF16-H	MigMix-2P-bold.ttf %!PS IPAGothic
uphgothb-v	UniJIS-UTF16-V	MigMix-2P-bold.ttf %!PS IPAGothic
uphgotheb-h	UniJIS-UTF16-H	MigMix-2P-bold.ttf %!PS IPAGothic
uphgotheb-v	UniJIS-UTF16-V	MigMix-2P-bold.ttf %!PS IPAGothic
uphmgothr-h	UniJIS-UTF16-H	MigMix-2P-bold.ttf %!PS IPAGothic
uphmgothr-v	UniJIS-UTF16-V	MigMix-2P-bold.ttf %!PS IPAGothic

% TEXT, JIS04
uphminln-h	UniJIS2004-UTF16-H	MigMix-1M-regular.ttf %!PS IPAMincho
uphminln-v	UniJIS2004-UTF16-V	MigMix-1M-regular.ttf %!PS IPAMincho
uphminrn-h	UniJIS2004-UTF16-H	MigMix-1M-regular.ttf %!PS IPAMincho
uphminrn-v	UniJIS2004-UTF16-V	MigMix-1M-regular.ttf %!PS IPAMincho
uphminbn-h	UniJIS2004-UTF16-H	MigMix-1M-regular.ttf %!PS IPAMincho
uphminbn-v	UniJIS2004-UTF16-V	MigMix-1M-regular.ttf %!PS IPAMincho
uphgothrn-h	UniJIS2004-UTF16-H	MigMix-2P-bold.ttf %!PS IPAGothic
uphgothrn-v	UniJIS2004-UTF16-V	MigMix-2P-bold.ttf %!PS IPAGothic
uphgothbn-h	UniJIS2004-UTF16-H	MigMix-2P-bold.ttf %!PS IPAGothic
uphgothbn-v	UniJIS2004-UTF16-V	MigMix-2P-bold.ttf %!PS IPAGothic
uphgothebn-h	UniJIS2004-UTF16-H	MigMix-2P-bold.ttf %!PS IPAGothic
uphgothebn-v	UniJIS2004-UTF16-V	MigMix-2P-bold.ttf %!PS IPAGothic
uphmgothrn-h	UniJIS2004-UTF16-H	MigMix-2P-bold.ttf %!PS IPAGothic
uphmgothrn-v	UniJIS2004-UTF16-V	MigMix-2P-bold.ttf %!PS IPAGothic
```

```map:ptex-migmix.map
rml	H	MigMix-1M-regular.ttf %!PS IPAMincho
rmlv	V	MigMix-1M-regular.ttf %!PS IPAMincho
gbm	H	MigMix-2P-bold.ttf %!PS IPAGothic
gbmv	V	MigMix-2P-bold.ttf %!PS IPAGothic
```

```map:uptex-migmix.map
urml	UniJIS-UTF16-H	MigMix-1M-regular.ttf %!PS IPAMincho
urmlv	UniJIS-UTF16-V	MigMix-1M-regular.ttf %!PS IPAMincho
ugbm	UniJIS-UTF16-H	MigMix-2P-bold.ttf %!PS IPAGothic
ugbmv	UniJIS-UTF16-V	MigMix-2P-bold.ttf %!PS IPAGothic
uprml-h	UniJIS-UTF16-H	MigMix-1M-regular.ttf %!PS IPAMincho
uprml-v	UniJIS-UTF16-V	MigMix-1M-regular.ttf %!PS IPAMincho
upgbm-h	UniJIS-UTF16-H	MigMix-2P-bold.ttf %!PS IPAGothic
upgbm-v	UniJIS-UTF16-V	MigMix-2P-bold.ttf %!PS IPAGothic
uprml-hq	UniJIS-UCS2-H	MigMix-1M-regular.ttf %!PS IPAMincho
upgbm-hq	UniJIS-UCS2-H	MigMix-2P-bold.ttf %!PS IPAGothic
```

### mktexlsr実行


### kanji-config-updmap

```shell-session
kanji-config-updmap migmix
```

ここで何もエラーが出ず、下記みたいなログが出ればOK。初の設定だとKanjiMapは6ファイルなんじゃないかな。

```shell-session
kanjiEmbed replacement string    : migmix (/root/.texlive2014/texmf-config/web2c/updmap.cfg)
kanjiVariant replacement string  :  (/root/.texlive2014/texmf-config/web2c/updmap.cfg)

...

Scanning for LW35 support files  [  3 files]
Scanning for MixedMap entries    [ 44 files]
Scanning for KanjiMap entries    [  6 files]
Scanning for Map entries         [225 files]
```

### dvipdfmx.cfg

dvipdfmx.cfgを開いて

```shell-session
vi /usr/local/texlive/2014/texmf-dist/dvipdfmx/dvipdfmx.cfg
```

最後らへんに下記の４行を追加

```shell-session
f otf-migmix.map
f otf-up-migmix.map
f ptex-migmix.map
f uptex-migmix.map
```

これでRe:VIEWでPDF埋め込めるようになった。