Well, I think I got it. First, I added a print line to texmf-dist/tex/luatex/luatexja/ltj-rmlgbm.lua:90:
local function open_cmap_file(name, inc, cid_dec, mke)
print("open_cmap_file: name " .. name) -- added
fh = io.open(kpse.find_file(name, 'cmap files'), "r")
....
... and realized it prints out: open_cmap_file: name UniJIS2004-UTF32-H. So I looked up:
$ tlmgr search --global --file UniJIS2004
...
adobemapping:
texmf-dist/fonts/cmap/adobemapping/aj16/CMap/UniJIS2004-UTF16-H
texmf-dist/fonts/cmap/adobemapping/aj16/CMap/UniJIS2004-UTF16-V
texmf-dist/fonts/cmap/adobemapping/aj16/CMap/UniJIS2004-UTF32-H
texmf-dist/fonts/cmap/adobemapping/aj16/CMap/UniJIS2004-UTF32-V
texmf-dist/fonts/cmap/adobemapping/aj16/CMap/UniJIS2004-UTF8-H
texmf-dist/fonts/cmap/adobemapping/aj16/CMap/UniJIS2004-UTF8-V
texworks:
tlpkg/texworks/share/poppler/cMap/Adobe-Japan1/UniJIS2004-UTF16-H
tlpkg/texworks/share/poppler/cMap/Adobe-Japan1/UniJIS2004-UTF16-V
tlpkg/texworks/share/poppler/cMap/Adobe-Japan1/UniJIS2004-UTF32-H
tlpkg/texworks/share/poppler/cMap/Adobe-Japan1/UniJIS2004-UTF32-V
tlpkg/texworks/share/poppler/cMap/Adobe-Japan1/UniJIS2004-UTF8-H
tlpkg/texworks/share/poppler/cMap/Adobe-Japan1/UniJIS2004-UTF8-V
... so I installed adobemapping with: tlmgr install adobemapping.
Now with this, compilation fails with:
luaotfload | db : Reload initiated (formats: otf,ttf,ttc,dfont); reason: "Font IPAExMincho not found.".
! Font \JY3/mc/m/n/10=IPAExMincho:jfm=ujis at 9.62219pt not loadable: metric dat
a not found or bad.
<to be read again>
relax
l.34 \kanjiencoding{JY3}\selectfont
\adjustbaseline
... so I have a font problem now. I'm on Ubuntu 11.04, and have no idea which specifically Chinese fonts I'd have. Via texdoc luatexja, I realized the default for this package is indeed \def\ltj@stdmcfont{IPAExMincho} - but also, that one could include a luatexja.cfg file in the same directory as the .tex file; these contents are recommended in the manual:
\def\ltj@stdmcfont{psft:Ryumin-Light}
\def\ltj@stdgtfont{psft:GothicBBB-Medium}
... and with this - and without a \setmainjfont statement - the example compiles, although it seems some characters may be missing.
I had worked with simsun.ttc font before, so I wanted to try it. Note, if the font name is simsun.ttc, and it is not installed system-wide, but merely present (even as a symlink) in the same directory as the .tex file, then it can not be read in with a \setmainjfont{SimSun}, only with \setmainjfont{simsun}. However, for my particular version of simsun.ttc, I get this compile error:
luaotfload | db : Reload initiated (formats: otf,ttf,ttc,dfont); reason:
"Font simsun not found.".(compiling luc: /media/texlive/2014/texmf-var/luatex
-cache/generic/fonts/otf/simsun.luc)(compiling luc: /home/user/.texlive
2014/texmf-var/luatex-cache/generic/fonts/otf/simsun.luc)(save: /media/
texlive/2014/texmf-var/luatex-cache/generic/fonts/otf/simsun.lua)(save: /media
/texlive/2014/texmf-var/luatex-cache/generic/fonts/otf/simsun.luc)
...
LaTeX Font Warning: Font shape `JY3/simsun(0)/bx/n' undefined
(Font) using `JY3/simsun(0)/m/n' instead on input line 8.
[1{/media/texlive/2014/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./testb.aux)
...
</media/texlive/2014/texmf-dist/fonts/opentype/public/lm/lmroman10-re
gular.otf><./simsun.ttc(bad-fontname-simsun:-1)Invalid TTC index number
So, even if I had no problem with this font with pdflatex/{CJKutf8}, here simsun.ttc fails with Invalid TTC index number. Wish I knew a fix for this (maybe it's this bug: [NTG-context] Latest beta stops loading some ttc fonts)...
Then I found SimSun.ttf somewhere for download; removed simsun.ttc from the directory, and downloaded SimSun.ttf in the same directory (as the .tex file). Then I used \setmainjfont{SimSun} in the code instead -- and the example finally compiled, and all characters were apparently present in the PDF.
Not sure if this was all of it, but it looks like it so far...
\listfilesand show the result? – egreg May 07 '15 at 23:03