You are not logged in.

#1 2012-02-14 15:36:19

tuvistavie
Member
From: London
Registered: 2012-02-12
Posts: 15
Website

Problem dvips, xdvi and Japanese fonts

Hi,
I'm new to ArchLinux and I'm trying to configure a LaTeX environment to make documents in Japanese but I'm having some troubles to get my documents in postscript.
I didn't have any problems with the compiler pLaTeX so I did manage to compile my tex files in dvi, but I am having problems with reading my dvi files with xdvi and transforming my files from dvi to ps with dvips. In both cases it seems that the fonts are not properly configured and I get this error :

$ dvips test.dvi
This is dvips(k) 5.991 Copyright 2011 Radical Eye Software (www.radicaleye.com)
' TeX output 2012.02.15:0008' -> test.ps

kpathsea: Running mktexpk --mfmode ljfour --bdpi 600 --mag 1+8/600 --dpi 608 rml
mktexpk: don't know how to create bitmap font for rml.
mktexpk: perhaps rml is missing from the map file.
kpathsea: Appending font creation commands to missfont.log.
dvips: Font rml not found; using cmr10
</usr/share/texmf-dist/fonts/pk/ljfour/public/cm/dpi600/cmr10.pk>
dvips: ! invalid char 9542 from font rml

$ xdvi test.dvi
Warning: Cannot convert string "-*-helvetica-medium-r-*-*-12-*-*-*-*-*-*" to type FontStruct
Warning: Missing charsets in String to FontSet conversion
Warning: Cannot convert string "-*-helvetica-medium-r-*-*-10-*-*-*-*-*-*" to type FontStruct

kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+8/600 --dpi 608 rml
mktexpk: don't know how to create bitmap font for rml.
mktexpk: perhaps rml is missing from the map file.
kpathsea: Appending font creation commands to missfont.log.
xdvi-xaw: Warning: Character 9542 not defined in font cmr10
xdvi-xaw: Warning: Character 9544 not defined in font cmr10

I did look up for that and tried some solutions which seemed to have worked for other persons, such as adding a kanji.map file to map rml and adding this file with updmap --edit or updmap-sys --edit, but no way to get this to work properly.
I have the following fonts installed :

$ pacman -Qs ttf
local/ttf-dejavu 2.33-1
    Font family based on the Bitstream Vera Fonts with a wider range of
    characters
local/ttf-ipa-mona 1.0.8-1
    extended Japanese mona font
local/ttf-kochi-substitute 20030809-4
    High quality Japanese TrueType fonts
local/ttf-monapo 20090423-4
    A Japanese font for viewing Japanese ascii arts properly
local/ttf-sazanami 20040629-7
    Japanese fonts
local/ttf-vlgothic 20120130-1
    Japanese TrueType fonts from Vine Linux

which I guess should be enough so I think it's only a problem of mapping, but I can't find any solution.
By the way, I did manage to make dvipdfmx work by adding the following lines to /etc/texmf/dvipdfmx/dvipdfmx.cfg

f ptex-noEmbed
f otf-noEmbed

and I'm getting a proper pdf output with that, but I haven't find anything working yet for xdvi and dvips.

If anyone had an idea of how to fix that it would be great.

Thank you for your help.

Offline

#2 2012-02-14 23:30:39

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,143

Re: Problem dvips, xdvi and Japanese fonts

Please do not be offended, but how much experience do you have working with TeX? I'm asking because it looks to me as if you are looking at the wrong things.

I don't have any experience with pLaTeX and I have very little with dvips. I usually use pdfLaTeX.

Basically, TeX is failing to find the font which you've asked for (rml). When it fails to find it ready-made, it assumes it might be in metafont format and looks for rules for creating a usable form. Those don't exist so, as a last resort, it falls back to a default font (Computer Modern Roman). But cmr won't work for Japanese because the characters just aren't there.

Something must be setup or I don't think either the dvi itself of the output from dvipdfmx would look OK.

When I say you are looking at the wrong thing, you are looking at what fonts your *system* has installed. But TeX can't use system fonts - certainly not if you need the tex -> dvi -> ps route. It also cannot use truetype fonts this way. (Unless pLaTeX somehow enables all this.) So the question is, what fonts do you have installed for TeX to use?

Given what is working, it seems as if you might have the tex font metric files for the font installed correctly but that either the type 1 (or other) fonts aren't set up correctly or they aren't installed at all. The reason the dvipdfmx mode works is, I think, because you are not embedding fonts in the pdf. That means it is up to the system/viewer to supply the actual shapes of the characters. And apparently your set up is able to do this. (Either rml is installed and it recognises this or it is substituting an acceptable default.) However, the pdf file you produce in this way is not safe to send to another machine unless you know that machine also has suitable fonts available. So don't, for example, email somebody a job application with this set up because the pdf will not necessarily display correctly on their machine!

OK. So, I don't know anything about typesetting Japanese but:
- do you need the tex -> dvi -> ps route? Or would tex -> pdf with pdfLaTeX or something like XeLaTeX be a possibility? If XeLaTeX, say, is an option, you can avoid the entire mess which is TeX font set up and use system fonts directly, including truetype, opentype... whatever. If pdfLaTeX is an option, you need to deal with TeX font set up but you have a bit more flexibility e.g. support for truetype.
- what is rml?
- can you provide a minimal .tex file demonstrating the problem?
- how did you install your TeX system? If you used Arch packages, which packages do you have installed, especially font packages?

You are probably going to need to delete ~/.texlive2011 but that on its own won't solve the problem so I wouldn't bother yet. What commands did you run with updmap, updmap-sys precisely and exactly what changes did you make, if any, in the mapping file? Did you keep backups? Did you get any errors reported? Did you execute the commands as yourself, root or another user?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#3 2012-02-17 16:18:17

tuvistavie
Member
From: London
Registered: 2012-02-12
Posts: 15
Website

Re: Problem dvips, xdvi and Japanese fonts

Hi and thank you very much for your answer.
Actually I've always been using TeX as a complete end user so I never really think of what was really going on when compiling and so on.
By reading your answer I did understand what was really the problem but though I tried a little harder to fix that I still wasn't able to get it to work.
However I think that this time dvipdfmx should be working properly (with embarked fonts).
For Japanese, I have the following fonts :

~$ ls /usr/share/fonts/japanese-otf/
HiraKakuProN-W3.otf  HiraKakuStdN-W8.otf  HiraMinProN-W3.otf
HiraKakuProN-W6.otf  HiraKakuStd-W8.otf   HiraMinProN-W6.otf
HiraKakuPro-W3.otf   HiraMaruProN-W4.otf  HiraMinPro-W3.otf
HiraKakuPro-W6.otf   HiraMaruPro-W4.otf   HiraMinPro-W6.otf

and after checking my TeX installation, it appeared that a map file provided by the texlive-langcjk package mapped rml the following way :

~$ head -n 8 /usr/share/texmf-dist/fonts/map/dvipdfmx/ptex/ptex-hiragino.map
%%
%% ASCII pTeX
%%

rml       H               HiraMinPro-W3.otf
rmlv      V               HiraMinPro-W3.otf
gbm       H               HiraKakuPro-W3.otf
gbmv      V               HiraKakuPro-W3.otf

so by adding

f ptex-hiragino.map

in my dvipdfmx.cfg file I managed to compile properly.
However, I did try to add the ptex-hiragino map file for dvips by adding

p +ptex-hiragino.map

to my /etc/texmf/dvips/config/config.ps, after what dvips compiled but didn't use the proper fonts.

tmp$ dvips test.dvi
This is dvips(k) 5.991 Copyright 2011 Radical Eye Software (www.radicaleye.com)
' TeX output 2012.02.16:0729' -> test.ps
</usr/share/texmf/dvips/base/tex.pro></usr/share/texmf/dvips/base/texps.pro>
. </usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb>[1]

Of course this didn't give a proper output. I also tried to add

dvipsmap ptex-hiragino.map

in my /usr/share/texmf/xdvi/xdvi.cfg file but it didn't work either so I suppose this is not the right way to do it.

To answer your questions, I would not mind using something else than dvi -> ps -> pdf, but is it possible to get the TikZ package (which seems to rely on pstricks) to work with pdfLaTeX or XeLaTeX ?
As far as I could look up for, rml is the name of a TFM file for Japanese fonts and by extension the name of this font.
For a minimal file, anything with Japanese will do, right now I'm just trying to compile :

\documentclass{jsarticle}
\begin{document}
テスト
\end{document}

(The jsarticle class is in the texlive-langcjk package.)

I installed TeX with pacman, by installing the group texlive-most (which contains texlive-fontsextra), and the packages texlive-langcjk and texlive-langextra. Finally, I installed the fonts showned above in /usr/share/fonts/japanese-otf manually.

The changes I tried to make were all global changes, but as it just didn't seem to work I restored the original configuration, so the only difference there should be between my installation and the basic one should be what I appended in dvipdfmx.cfg, and the fonts that I manually installed.

If you need any other information, please ask.

Thanks a lot for your help.

Offline

#4 2012-02-18 04:00:28

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,143

Re: Problem dvips, xdvi and Japanese fonts

tuvistavie wrote:

Hi and thank you very much for your answer.
Actually I've always been using TeX as a complete end user so I never really think of what was really going on when compiling and so on.

Apologies.

To answer your questions, I would not mind using something else than dvi -> ps -> pdf, but is it possible to get the TikZ package (which seems to rely on pstricks) to work with pdfLaTeX or XeLaTeX ?

Why do you think it relies on pstricks? I don't know much about it (though I've used pgf a little) but an admittedly quick look at the documentation didn't suggest it was required. I think it probably depends on just which parts of the package you are using though and that pstricks may be essential for some features but not others. So you'd need to read the manual files for the specific packages you're using and/or experiment to figure out if it is a dependency for you. There doesn't seem to be that much mention of pstricks in the source of the documentation but that might not mean much.

As far as I could look up for, rml is the name of a TFM file for Japanese fonts and by extension the name of this font.
For a minimal file, anything with Japanese will do, right now I'm just trying to compile :

\documentclass{jsarticle}
\begin{document}
テスト
\end{document}

Thanks. "Anything with Japanese" is not trivial for me!

If I compile this with platex, I get an empty dvi. If I convert to ps with dvips, I get something which is obviously not Japanese and if I convert that to pdf, I get something which is obviously not Japanese. I'm not getting the errors you're seeing but I'm also not getting a dvi which looks anything like OK. But this is presumably because I don't have Japanese fonts installed for my system generally.

Thanks a lot for your help.

I wouldn't thank me yet...

I also tried compiling sample.tex from the documentation directory for platex. I don't get errors but I get a blank dvi and non-Japanese output in the final ps/pdf. The pre-compiled sample.pdf which comes with the package looks fine. But that was compiled with dvipdfmx. I assume that you would expect this to work i.e. that it works on other TeX setups you've used? Just with platex -> dvips -> ps2pdf ?

The map file you're trying to use is likely dvipdfmx specific, though I'm not sure. (Just its location suggests this.)

I would try avoiding the system fonts for now and using ones which come with texlive, if possible. I have a map file at texmf-dist/fonts/map/dvipdfmx/ptex/morisawa.map which gives a different mapping for rml. There are tfm and vf files corresponding to this map on my installation. Note that I did not install texlive through pacman and I don't know how the packagers have split the packages or exactly where they are located on your system.

Do you know if the standard tools for working with .vf and .tfm files should work for Japanese fonts? I ask because I get errors if I try to convert these files to readable format and file doesn't recognise the tfm files, at least, as tfm files. These commands work fine on e.g. a random tfm I picked under adobe/palantino. I was trying to figure out which fonts these were pointing to. Unfortunately, I know nothing about Japanese fonts but I'd have expected the tools to work if they are regular tfm files.

I'm not an expert at this, at all, unfortunately. Maybe somebody else here is?

Do you need the dvips route to work if you've got dvipdfmx working? (Or is that only working if you don't embed fonts - that wouldn't be good.)

Try searching for CTAN resources. The following looks useful:
http://www.physics.wustl.edu/~alford/te … latex.html

Last edited by cfr (2012-02-18 04:17:04)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#5 2012-02-20 22:06:49

tuvistavie
Member
From: London
Registered: 2012-02-12
Posts: 15
Website

Re: Problem dvips, xdvi and Japanese fonts

Hi,

cfr wrote:

Why do you think it relies on pstricks?

Oh, my bad, it was another package I'm using (vaucanson-g) that relied on pstricks, but tikz package still seems to use ps, as when I try to compile with dvipdfmx I get warnings like

** WARNING ** Interpreting PS code failed!!! Output might be broken!!!
** WARNING ** Interpreting special command ps: (ps:) failed.
** WARNING ** >> at page="1" position="(511.652, 601.43)" (in PDF)
** WARNING ** >> xxx "ps:: pgfc"

and the output is completely broken.
Anyway, the situation improved a little, but I'm now having troubles with Ghostcript.
Finally, I downloaded a Japanese latex installation which was supposed to work from this site, compiled everything and put the texmf-var in my home directory. I appended ptex-hiragino to my dvipdfmx.cfg file, and that was ok for dvipdfmx to work properly.  When running pdffonts on the pdf produced by dvipdfmx I got

tmp$ pdffonts test.pdf
name                                 type              emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
OYPKSF+HiraMinPro-W3-Identity-H      CID Type 0C       yes yes no       5  0
ZTJQNI+CMR10                         Type 1C           yes yes no       6  0

so I think that the fonts are embarked without any problem.
dvips already seemed to be working properly, to check that I tried to compile the ps file to pdf on an other installation and I did not have any problem with that.
The only problem left now is to configure Ghostscript.
The error message is pretty clear, but I coudn't get gs to find the fonts it is looking for :

tmp$ xdvi test.dvi

kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+8/600 --dpi 608 rml
mktexpk: Running gsftopk rml 608
gsftopk(k) version 1.19.2
render.ps: font Ryumin-Light-H is not defined.
GPL Ghostscript 9.05: Unrecoverable error, exit code 1
/905
gs terminated abnormally with status 1

grep: rml.log: No such file or directory
mktexpk: `gsftopk rml 608' failed to make rml.608pk.
kpathsea: Appending font creation commands to missfont.log.
xdvi-xaw: Warning: Character 9542 not defined in font cmr10
xdvi-xaw: Warning: Character 9529 not defined in font cmr10
xdvi-xaw: Warning: Character 9544 not defined in font cmr10

I do have this font in my TeX installation :

tmp$ locate -i ryumin-light-h
/home/daniel/.texlive/texmf-var/fonts/tfm/ptex/Ryumin-Light-H.tfm
/home/daniel/.texlive/texmf-var/fonts/vf/ptex/Ryumin-Light-H.vf
/usr/share/texmf-dist/fonts/tfm/ptex/morisawa/Ryumin-Light-H.tfm
/usr/share/texmf-dist/fonts/vf/ptex/morisawa/Ryumin-Light-H.vf

but I didn't manage to make them available to gs.
I installed gs with pacman by installing the two following packages:

tmp$ pacman -Qs ghostscript
local/ghostscript 9.05-1
    An interpreter for the PostScript language
local/gsfonts 1.0.7pre44-3
    Standard Ghostscript Type1 fonts from URW

If you had any idea of how to fix that it would be really great.

Thanks in advance.

Last edited by tuvistavie (2012-02-20 22:09:06)

Offline

#6 2012-02-21 00:38:06

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,143

Re: Problem dvips, xdvi and Japanese fonts

Yes, the fonts are being subsetted and embedded when you generate the pdf. That's good. I think it means that tex is finding the fonts OK now. (I'm not quite sure what complications you may have from having two texlive installations, though, if that's what you've done. But if it works,,,)

As I say, I think tikz can use pstricks - it depends what you are using from it. The few bits I've used don't but you may well need something which does.

From the README:

Vaucanson-G : A LaTeX package for drawing automata and graphs

Vaucanson-G is based on PSTricks and PSTricks does not generate dvi instructions but instead
directly generate postscript commands. As a result, the drawings composed by Vaucanson-G
are not correctly visible under a dvi previewer. A very common outcome is an unscaled drawing and
all the labels are written at the origin.

So I'm not sure you should expect it to display in a dvi previewer or to work correctly via that route? I don't know much about generating postscript, though. And if this is true of pstricks generally, I'm not sure any document using it will display via xdvi...

Try gs -h and read the man page for gs - you may need to e.g. set GS_FONTPATH since the fonts in your home texlive directory won't be in gs's default search path. From memory, you may need to issue a setup command to get the fonts to work properly, too, but it is a while since I configured gs. (I'm just using pacman's default install right now, as I'm assuming you are.)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#7 2012-03-02 12:39:12

iishikawa
Member
Registered: 2010-08-22
Posts: 5

Re: Problem dvips, xdvi and Japanese fonts

Hi, tuvistavie. I managed to run Ghostscript (gs) on my Japanese environment by following the guide found at TeX Wiki

The older versions of Ghostscript require GS_LIB is set to ghostscript lib and Init directory. If gs still does not work, add the following code to your .bashrc.

GS_LIB=/usr/share/ghostscript/9.05/lib:/usr/share/ghostscript/9.05/Resource/Init

Last edited by iishikawa (2012-09-16 15:42:22)

Offline

Board footer

Powered by FluxBB