I've been trying to get the Meiryo font to work with LaTeX CJK for quite a while now, but for some reason or other it's always refused to work. I gave it another go today, and managed to actually get some output, but it wasn't really what I expected.

For some reason, processing Hiragana results in characters that I've never seen before being produced in the PDF. A few of the Kanji that I've written are unscathed, but many are replaced by unexpected characters.

I've successfully used the guide at http://www-alg.ist.hokudai.ac.jp/~jan/japfonts.html to allow CJK to use the IPA fonts, but having followed the same tutorial with Meiryo doesn't result in anything usable. My suspicion is that the Unicode glyphs are in the wrong places, or something along those lines.

I've got the .tfm files produced by running ttf2tfm on meiryo.ttc in /usr/share/texmf-texlive/fonts/tfm/meiryo, and the .td files in /usr/share/texmf-texlive/tex/latex/CJK fonts.

The contents of the relevant .td and .map files are as follows:


\DeclareFontFamily{C70}{meiryo}{\hyphenchar \font\m@ne}
\DeclareFontShape{C70}{meiryo}{m}{n}{<-> CJK * meiryo}{}
\DeclareFontShape{C70}{meiryo}{bx}{n}{<-> CJKb * meiryo}{\CJKbold}

ttfonts.map (only relevant bits)

ipam@UJIS@ ipam.ttf
ipam-uni@Unicode@ ipam.ttf
meiryo@Unicode@ meiryo.ttc
msjh@Unicode@ unicode msjh.ttf

Also, here's a part of the document that I'm trying to make with this font - I'm using the flashcards package, but I feel that it's unlikely that that has much of an impact on the font problem. I'm using an a4 paper size for the cards, and there's no default .cfg file for that, so if necessary you can either change the paper type to avery5371 in the documentclass, or make a file a4paper.cfg in your flashcards directory (mine is /usr/share/texmf-texlive/tex/latex/flashcards), and put in the following:



A LaTeX document to use for any testing, if required (it throws up some other errors that I haven't worked around yet). Currently uses meiryo encoding. Default for CJK is min, I think:




\newcommand{\df}[3]{#1 -- #2 -- #3}
\newcommand{\rdf}[3]{\ruby{#1}{#2} -- #3}
\newcommand{\md}{\fontsize{18pt} \selectfont}


    \fontsize{12pt} \selectfont
      \rdf{上映}{じょうえい}{Show a movie}\\


Here are some pictures of what I'm talking about:

Compiling the above using meiryo as the font:

with ipam as the font:

Any ideas as to what the problem may be, and how I should go about fixing it?

  • I think this problem is likely to have been caused by the way that I had installed the font. I had converted it to .enc and .tfm, rather than purely .tfm. Once I converted to just tfm, the font displayed properly. Jan 29, 2011 at 21:46

1 Answer 1


I don't suppose you could consider using XeTeX or LuaTeX instead to compile your document? For example, here's a modified version of your minimal example (which for some reason seems to have lots of errors in it):

\setmainfont[Ligatures=TeX]{Hiragino Mincho Pro}
\newcommand{\rdf}[3]{\ruby{#1}{#2} -- #3}
      \rdf{上映}{じょうえい}{Show a movie}\\
  • I've tried compiling your example with LuaTeX and XeTeX. Both of them just give me a ton of undefined control sequence errors. Is it possible to use LaTeX packages in either of those, because this document has effectively no use without that package. Dec 10, 2010 at 10:30
  • @heuristicus — almost all LaTeX packages work fine with xelatex and lualatex. You'll have to be more specific about the errors you're facing. Jan 1, 2011 at 16:40
  • Here's the output I get when attempting to compile the example with XeTeX:pastebin.com/rXwmu1YS. LuaTeX gives me almost exactly the same errors. Jan 9, 2011 at 15:59
  • @heuristicus use xelatex not xetex. Jan 9, 2011 at 22:23
  • @heuristicus using xelatex and saving the file as utf-8.
    – Ma Ming
    Mar 29, 2011 at 21:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.