1
Japanese Microsoft Gothic TTF
2
-----------------------------
4
Thanks to Gernot Hassenplug for this HOWTO.
6
### Warning: this HOWTO is unfinished; there seems to be a bug in either
7
### Fontforge or vertical.pe, blocking the build process midway.
8
### I hope this will be fixed at the next upload of latex-cjk-japanese.
10
This HOWTO will guide you through the process of getting Microsoft's Japanese
11
font "Gothic" to work with CJK on TeX (latex, dvipdfmx and pdflatex) in the
12
event that you already have a legal copy of the said font.
14
On a standard Debian or Ubuntu installation, TEXMFLOCAL can be considered
15
the same as /usr/local/share/texmf/.
17
As root, make the directories:
18
$ mkdir -p /usr/local/share/fonts/truetype/microsoft
20
Still as root, make "msgothic.ttf" available both to X11 and TeX:
21
$ cp msgothic.ttf /usr/local/share/fonts/truetype/microsoft/
22
$ cd /usr/local/share/texmf/fonts/truetype
23
$ ln -s ../../../fonts/truetype/microsoft/
25
Linking the font to the TEXMFLOCAL tree will have no effect on latex, dvipdfmx
26
or pdflatex, but it is useful if you plan to use the next generation set of
27
TeX tools such as XeTeX.
30
As a regular user, build the fonts (will take some building time):
33
$ fontforge -script /usr/share/latex-cjk-common/utils/subfonts/subfonts.pe /usr/local/share/fonts/truetype/microsoft/msgothic.ttf msgothic /usr/share/texmf/fonts/sfd/Unicode.sfd
35
Now some vertical fonts:
36
# PROBLEM: fontforge version 20071110 will segment! msgothicv.tfm will not be created,
37
# rendering the third Perl command below impossible to run.
38
$ fontforge -script /usr/share/latex-cjk-common/utils/subfonts/vertical.pe /usr/local/share/fonts/truetype/microsoft/msgothic.ttf msgothicv
39
$ fontforge -script /usr/share/latex-cjk-common/utils/subfonts/vertref.pe /usr/local/share/fonts/truetype/microsoft/msgothic.ttf msgothicvr
40
# Impossible to make with due to a possible bug in Fontforge:
41
$ perl /usr/share/latex-cjk-common/utils/subfonts/clonevf.pl msgothicv msgothv
42
$ perl uni2sfd.pl $(uninamestem) $(sfddir)/$(encoding).sfd $(sfdnamestem) $(codingscheme)
47
Create a map file for the Type1 fontsto be embedded successfully:
48
$ for i in *.tfm; do echo "${i%.tfm} ${i%.tfm} < ${i%.tfm}.pfb" >> msgothic.map
50
Create cXXmsgothic.fd:
51
$ # UNTESTED: perl makefdx.pl $(uninamestem)vr.afm $(sfddir)/$(encoding).sfd c$(nfss_fontencoding) $(namestem)
53
Create c70msgothic.fd:
54
$ # UNTESTED: perl makefdx.pl -u $(uninamestem)vr.afm $(sfddir)/Unicode.sfd c70$ $(namestem)
56
% This is c70msgothic.fd for the CJK package
57
% created by Gernot Hassenpflug based on the tutorial
58
% by Edward G. J. Lee in his blog "LJG Font Notes"
59
\ProvidesFile{c70msgothic.fd}
60
\DeclareFontFamily{C70}{msgothic}{\hyphenchar \font\m@ne}
61
\DeclareFontShape{C70}{msgothic}{m}{n}{<-> CJK * msgothic}{}
62
\DeclareFontShape{C70}{msgothic}{bx}{n}{<-> CJKb * msgothic}{\CJKbold}
65
Local installation: [change ~/ with TEXMFLOCAL to get a user-wide installation]
66
$ mkdir ~/texmf/fonts/map/dvips/microsoft
67
$ cp msgothic.map ~/texmf/fonts/map/dvips/microsoft/
68
$ mkdir ~/texmf/fonts/{tfm,type1}/microsoft
69
$ msgothic*.tfm ~/texmf/fonts/tfm/microsoft/
70
$ msgothic*.pfb ~/texmf/fonts/type/microsoft/
71
$ cp c70msgothic.fd ~/texmf/tex/latex/CJK/UTF8/
75
$ updmap --enable Map msgothic.map # Use updmap-sys if you are root.