Bug 178411

Summary: Cannot see Japanese dvi file because of vfontmap description
Product: [Fedora] Fedora Reporter: Mamoru TASAKA <mtasaka>
Component: tetexAssignee: Jindrich Novy <jnovy>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: eng-i18n-bugs, furutaka, pknirsch, tagoh, t.matsuu
Target Milestone: ---Keywords: i18n, Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-04-28 04:45:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
sample Japanese tex file ( in ISO-2022-JP )
none
Screenshot of pxdvi
none
A patch to change some definition in xdvi.h
none
some warning on the background after pxdvi to view the file
none
updated tetex-3.0-pxdvi.patch none

Description Mamoru TASAKA 2006-01-20 09:22:00 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; ja-JP; rv:1.8) Gecko/20060103 Fedora/1.5-4 Firefox/1.5

Description of problem:
I cannot see Japanese dvi file with current rawhide system.

After I create a dvi file from Japanese tex file (usually encoded
with ISO-2022-JP (it successes), the following happens.

[root@dhcp151 TEMP]# platex sample
This is pTeX, Version 3.141592-p3.1.8 (euc) (Web2C 7.5.4)
(./sample.tex
pLaTeX2e <2005/01/04>+0 (based on LaTeX2e <2003/12/01> patch level 0)
(/usr/share/texmf/ptex/platex/base/jarticle.cls
Document Class: jarticle 2002/04/09 v1.4 Standard pLaTeX class
(/usr/share/texmf/ptex/platex/base/jsize12.clo)) (./sample.aux) [1]
(./sample.aux) )
Output written on sample.dvi (1 page, 348 bytes).
Transcript written on sample.log.
[root@dhcp151 TEMP]# pxdvi sample
Warning: Missing charsets in String to FontSet conversion
Warning: Missing charsets in String to FontSet conversion
Warning: Missing charsets in String to FontSet conversion
FT2: Open Font Error. (/usr/share/fonts/japanese/TrueType/kochi-mincho-subst.ttf)
[root@dhcp151 TEMP]# head -n 2 /usr/share/texmf/pxdvi/vfontmap
min     /usr/share/fonts/japanese/TrueType/kochi-mincho-subst.ttf
nmin    /usr/share/fonts/japanese/TrueType/kochi-mincho-subst.ttf
[root@dhcp151 TEMP]# LANG=C rpm -q --changelog fonts-japanese | head -n 20 | tail -n 4
* Wed Aug 17 2005 Akira TAGOH <tagoh> - 0.20050222-7
- Added cidfmap.ja for the latest ghostscript.
- Removed Kochi fonts.

"At lease" changing font series in vfontmap from kochi to sazanami is
needes.


Version-Release number of selected component (if applicable):
tetex-3.0-16 fonts-japanese-0.20050222-11.1 ghostscript-8.15.1-3.1

How reproducible:
Always

Steps to Reproduce:
1. Create Japanese tex file.
2. Make dvi file from tex file by platex
3. See dvi file made with pxdvi
  

Actual Results:  Cannot see dvi file

Expected Results:  Dvi file can be seen...

Additional info:

Note:
Even after I manually change fonts in vfontmap to sazanami font series,
when I see dvi file with pxdvi, Japanese characters are collapsed.
But the created dvi file can be seen correctly with FC4 system; for which
I don't know the further reason.

Comment 1 Mamoru TASAKA 2006-01-20 09:25:37 UTC
Created attachment 123471 [details]
sample Japanese tex file ( in ISO-2022-JP )

Sample Japanese tex file.
It is encoded with ISO-2022-JP.

Comment 2 Jindrich Novy 2006-01-20 10:11:37 UTC
Created attachment 123473 [details]
Screenshot of pxdvi

Could you please confirm this is correct output when viewing the sample file
you attached?

Comment 3 Mamoru TASAKA 2006-01-20 11:49:07 UTC
(In reply to comment #2)
> Created an attachment (id=123473) [edit]
> Screenshot of pxdvi
> 
> Could you please confirm this is correct output when viewing the sample file
> you attached?

Okay. The view of the attachment in the comment 2 is CORRECT.

Comment 4 Jindrich Novy 2006-01-24 13:06:42 UTC
It looks like the rawhide fonts-japanese misses the kochi-mincho-subst font
completely. When I install the fonts manualy from the old fonts-japanese, I'm
able to run pxdvi smoothly, but the japanese fonts aren't correctly displayed.

Comparing the output from pxdvi on my working FC4 and rawhide where it doesn't
work, I see that this warning is displayed prior the other messages:

Warning: Cannot convert string "-*-helvetica-medium-r-*-*-12-*-*-*-*-*-*" to
type FontStruct

I'm trying to figure out what's happening here (suspecting freetype).

Comment 5 Jindrich Novy 2006-01-24 15:14:12 UTC
I tried to comment out the kochi fonts and substitute them with the sazanami
ones in /usr/share/texmf/pxdvi/vfontmap. But with no luck... pxdvi displays the
DVI contents, but japanese characters are displayed like they're missing in the
font (black squares)...

Comment 6 Mamoru TASAKA 2006-01-24 18:10:23 UTC
Yes. I think that changing description in vfontmap from kochi to
sazanami is needed, but I have no idea for further fix for now...

Comment 7 Jindrich Novy 2006-01-26 10:09:54 UTC
Akira, could you please help us here why the fonts are displayed incorrectly
when vfontmap points on the sazanami fonts? Were there some important changes we
are not aware of in fonts-japanese since fonts-japanese-0.20050222-3 that could
affect pxdvi?

Thanks.

Comment 8 Akira TAGOH 2006-01-26 11:06:42 UTC
No idea off hand. Kochi fonts and Sazanami fonts are different TrueType font -
properly which was made by even the same upstream though - I have also no idea
how pxdvi picks the glyphs up from TrueType fonts. so need to investigate this
anyway. let me have a look then.

Comment 9 Akira TAGOH 2006-01-26 11:58:05 UTC
I just tried this out on Rawhide with kochi-{gothic,mincho}-subst.ttf that
copied manually. but it doesn't work for me. what you did try at Comment #2 was
on FC4 box, right? and what you were saying at Comment #4 was on Rawhide box?
I'm wondering if this is related to fonts.  guessing from asking me about font,
you are sure there aren't any changes in pxdvi between FC4 and Rawhide right. so
I suspect it may be freetype or something like rendering library as you did then.

Comment 10 Akira TAGOH 2006-01-26 12:10:31 UTC
Ok, I've also tried this on FC4 box with sazanami-{gothic,mincho}.ttf. it works
fine. so this is apparently rendering issue.

Comment 11 Jindrich Novy 2006-01-26 12:24:54 UTC
To answer your question in Comment #9, yes, pxdvi worked fine under FC4, the
output from Comment #4 was taken from an updated FC4. In Comment #4 is used the
latest rawhide fonts-japanese on rawhide box, right.

Comment 12 Jindrich Novy 2006-03-08 11:16:57 UTC
I applied change to vfontmap suggested by MATSUURA Takanori. Maybe that will fix
your issue.

Comment 13 Mamoru TASAKA 2006-03-09 13:46:59 UTC
Hello, Jindrich.
Which version of rpm(s) do you refer to? I think the current newest rawhide
tetex rpm is tetex-3.0-17 (in 20060307 rawhide) and  I don't see any change  in
vfontmap...

If your change will be applied in 20060310 rawhide, I will wait until then.

Comment 14 Jindrich Novy 2006-03-09 14:34:21 UTC
Hello Mamoru,

the latest tetex rpm version is 3.0-18, where the attempt to fix it is applied.
Maybe it's not on the mirrors yet because of the FC5 freeze, but I built it few
days ago.

In the meantime the srpm is here:
http://people.redhat.com/jnovy/files/tetex-3.0-18.src.rpm



Comment 15 Mamoru TASAKA 2006-03-09 16:15:30 UTC
I just rebuilt rpms from source tetex-3.0-18 and installed them, but it seems to
no purpose...

The change in 3.0-18 is  that vfontmap points to sazanami fonts, right? Then the
attempt is already done as I reported on the Note of the first bug report and
the comments from 1 to 6 says. Can you see the dvi file correctly (as the
attachment in comment 2) created from the original tex file (attached in the
comment 1)  by 3.0-18 ?  

Note: when I create ps file from dvi file by 
pdvips -Ppdf sample.dvi ,
the created ps file can be seen correctly by gs, so I suppose there is no
problem in dvi file itself.

Comment 16 Mamoru TASAKA 2006-03-30 17:33:03 UTC
Created attachment 127061 [details]
A patch to change some definition in xdvi.h

Hello, Jindrich.
Current rawhide rpm tetex-3.0-19 does not work well, however, there is some
news.

A information that "Making it valid the definition that "typedef       
unsigned int	wide_ubyte;" in texk/pxdvik/xdvi.h should work for this issue"
was brought on Japanese Fedora wiki page, and this worked WELL for me!!
Currently, I apply the attached patch for tetex.spec and it works well for now.


I checked that on FC4 system NeedFunctionPrototypes was defined as 1 at the
line 234  of texk/pxdvik/xdvi.h,  but on FC5 system NeedFunctionPrototypes is
not defined at this line, and by the following lines NeedFunctionPrototypes is
defined as 0. So I suppose that this is related to switching to modular X.

Comment 17 Jindrich Novy 2006-03-31 20:48:51 UTC
Hi Mamoru,

yes, modular X seems to be at fault here as far as I can see from
X11/Xfuncproto.h, which is included by X11/Xlib.h in xdvi.h:

<snip>
#ifndef NARROWPROTO
#define NARROWPROTO
#endif
#ifndef FUNCPROTO
#define FUNCPROTO 15
#endif

#ifndef NeedWidePrototypes
#ifdef NARROWPROTO
#define NeedWidePrototypes 0
#else
#define NeedWidePrototypes 1            /* default to make interropt. easier */
#endif
#endif /* NeedWidePrototypes */
</snip>

what causes that NeedWidePrototypes is defined to 0 if previously undefined.

Mike, is it intentional? From the comment above in X11/Xfuncproto.h I'd guess
the default should be #define NeedWidePrototypes 1 ?

Comment 18 Jindrich Novy 2006-04-04 12:02:44 UTC
Ok, I applied the workaround presented by Mamoru. Please reopen if you see any
other problems. The workaround is applied since tetex-3.0-20.

Comment 19 Jindrich Novy 2006-04-04 12:05:16 UTC
*** Bug 187893 has been marked as a duplicate of this bug. ***

Comment 20 Mamoru TASAKA 2006-04-17 16:46:51 UTC
Hello, Jindrich.

tetex-3.0-20 works WELL for me, thanks.
Then would you have a plan to apply these temporary fix (vfontmap change in
3.0-18 and definition of NeedWidePrototypes in 3.0-20) to FC5  updates ?

Comment 21 Jindrich Novy 2006-04-26 15:23:22 UTC
Hi Mamoru,

I modified the vfontmap file once more based on recommendation from Matsuura
Takanori. This should appear soon including more japanese fixes since 3.0-22.
Could you please confirm everything works as expected with this version? If so,
I'll release updates immediatelly.

Comment 22 Mamoru TASAKA 2006-04-26 16:14:05 UTC
Okay, I will check tetex-3.0-22 when it appears on web site.

Comment 23 Mamoru TASAKA 2006-04-27 09:46:50 UTC
Hello, Jindrich.

Now I checked tetex-3.0-22 and it seems to work well.

Comment 24 Fedora Update System 2006-04-27 22:01:45 UTC
tetex-3.0-19.fc5 has been pushed for fc5, which should resolve this issue.  If these problems are still present in this version, then please make note of it in this bug report.

Comment 25 Mamoru TASAKA 2006-04-28 04:45:00 UTC
Okay, I upgraded to tetex-3.0-19.fc5 on FC5 system and it seems to work well.
Thanks!!

Now, I close this bug as CLOSED RAWHIDE. If another bug is found, I will reopen
this bug or create another bug report.


Comment 26 Lawrence Lim 2006-04-28 06:22:46 UTC
Created attachment 128344 [details]
some warning on the background after pxdvi to view the file

I tried with tetex-3.0-22, and it showing fine too. Noticed some warning output
in the background thought. Please let me know if it should be of concern.

Comment 27 Takanori MATSUURA 2006-05-02 03:19:55 UTC
Created attachment 128463 [details]
updated tetex-3.0-pxdvi.patch

(In reply to comment #26)
> some warning on the background after pxdvi to view the file

This patch may fix the last "Warning: Cannot convert string..." warning.

"Warning: Missing charsets in String to FontSet conversion" warnings are from
font detection mechanism in pxdvi GUI and harmless for the pxdvi functions .

xdvi command also output the same warning in my FC5.

Other warnings are not shown in my FC5.

Does your machine have fonts-japanese package required by tetex-xdvi?

Could you open the new bug If more fix is needed?

Comment 28 Lawrence Lim 2006-05-02 03:24:16 UTC
RE Comment #27

Sure. Thanks for your patch.

Comment 29 Fedora Update System 2006-05-26 14:10:00 UTC
tetex-3.0-10.FC4 has been pushed for fc4, which should resolve this issue.  If these problems are still present in this version, then please make note of it in this bug report.

Comment 30 Fedora Update System 2006-06-07 23:36:49 UTC
tetex-3.0-10.FC4 has been pushed for fc4, which should resolve this issue.  If these problems are still present in this version, then please make note of it in this bug report.