我正在尝试使用 Platex 编译一份文档,但某些汉字根本没有显示在生成的 pdf 中。
\documentclass{jsarticle}
% unless I have this line, I get ascii mojibake for some reason
\usepackage[jis2004]{otf}
\begin{document}
こんにちは!
桔梗の模様の鞄があるけど、その鞄の字は見えない。
「虔む」も同じだ。他の字はオーケーなのに。おっかしいなー。
じゃあ、スタック交換に訊いてみよう。
\end{document}
编译使用:
platex hoge.tex && dvipdf hoge.dvi
最终结果:
预期的:
根据要求,终端输出:
$ dvips hoge -o
This is dvips(k) 5.994 Copyright 2014 Radical Eye Software (www.radicaleye.com)
' TeX output 2015.10.01:1542' -> hoge.ps
</usr/share/texlive/texmf-dist/dvips/base/tex.pro>
</usr/share/texlive/texmf-dist/dvips/base/texps.pro>.
</usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb>[1]
$ gs -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=hoge.pdf hoge.ps
GPL Ghostscript 9.06 (2012-08-08)
Copyright (C) 2012 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Can't find (or can't open) font file /usr/share/ghostscript/9.06/Resource/Font/HiraMinProN-W3.
Can't find (or can't open) font file HiraMinProN-W3.
Querying operating system for font files...
Loading HiraMinProN-W3 font from /usr/share/fonts/truetype/apple/ヒラギノ明朝 ProN W3.otf... 2932428 1603756 23747972 13461862 1 done.
Loading HiraMinProN-W3 font failed.
Can't find (or can't open) font file /usr/share/ghostscript/9.06/Resource/Font/HiraMinProN-W3.
Can't find (or can't open) font file HiraMinProN-W3.
Didn't find this font on the system!
Substituting font Courier for HiraMinProN-W3.
Loading NimbusMonL-Regu font from /usr/share/fonts/type1/gsfonts/n022003l.pfb... 3069668 1728253 23747972 13469851 1 done.
答案1
TeX Live 中的字体 ipaexm.ttf 包含示例中的所有字形。尝试
platex hoge
dvipdfmx -f otf-ipaex.map hoge
如果你有 Hiragino 字体,请尝试
dvipdfmx -f otf-hiragino.map hoge
或者
dvipdfmx -f otf-hiragino-pron.map hoge
如果您想使用 dvips + Ghostscript,请尝试将以下 6 行添加到 hoge.ps:
--- hoge.ps.orig Thu Oct 01 23:46:40 2015
+++ hoge.ps Thu Oct 01 23:47:31 2015
@@ -6,6 +6,12 @@
%%PageOrder: Ascend
%%BoundingBox: 0 0 596 842
%%DocumentFonts: HiraMinProN-W3-H HiraMinProN-W3-Identity-H CMR10
+%%BeginFont: HiraMinProN-W3-H
+/HiraMinProN-W3-H
+/H /CMap findresource
+[/HiraMinProN-W3 /CIDFont findresource]
+composefont pop
+%%EndFont
%%DocumentPaperSizes: a4
%%EndComments
%DVIPSWebPage: (www.radicaleye.com)
此外,复制你的字体(符号链接也可以)
/usr/share/fonts/truetype/apple/ヒラギノ明朝 ProN W3.otf
进入
/usr/share/ghostscript/9.06/Resource/Font/
使用 PostScript 名称
HiraMinProN-W3