dia 0.90: printing Japanese using --enable-freetype ?



I tried to build dia 0.90 using

    --enable-freetype

everything seems to work fine except printing using fonts which have
many characters (e.g. Japanese TrueType fonts like Kochi Mincho or
other big fonts like MS Arial Unicode).

A simple example dia file 'test.dia' is attached (decompressed).

This file contains the string "xyz" two times, once using the Japanese
"Kochi Mincho" font and once more using the Latin1 only "Omega Serif"
font[1].

The "xyz" in from the "Omega Serif" font prints correctly, the "xyz"
from the "Kochi Mincho" prints as three double width yen-signs (¥¥¥)
. This double width yen-sign happens to be the very last character of
kochi-mincho.ttf (I checked that with pfaedit).

Both fonts are embedded completely into the PostScript output:

    %%BeginResource: font OmegaSerif88591
    %!PS-TrueTypeFont
    11 dict begin
    /FontName /OmegaSerif88591 def

    [... snip ...]

    %%BeginResource: font Kochi-Mincho
    %!PS-TrueTypeFont
    11 dict begin
    /FontName /Kochi-Mincho def

    [... snip ...]

    %%EndProlog

Then the fonts are both used in the same way:

    %%BeginSetup
    %%EndSetup
    %%Page: 1 1
    gs

    [... snip ...]

     /xi /xi /xi /xi /xi /xi /xi /xi /xi /xi /xi /xi /xi /xi /xi /xi
    ] /e0 exch def
    /Kochi-Mincho_e0 undefinefont
    /Kochi-Mincho_e0
      /Kochi-Mincho findfont
      dup length dict begin
      {1 index /FID ne {def} {pop pop} ifelse} forall
      /Encoding e0 def
      currentdict end
    definefont pop
    /Kochi-Mincho_e0 ff 2.000000 scf sf
    ( !")
     gs 1 -1 sc sh gr
    5.000000 5.000000 m /OmegaSerif88591_e0 undefinefont
    /OmegaSerif88591_e0
      /OmegaSerif88591 findfont
      dup length dict begin
      {1 index /FID ne {def} {pop pop} ifelse} forall
      /Encoding e0 def
      currentdict end
    definefont pop
    /OmegaSerif88591_e0 ff 2.000000 scf sf
    ( !")
     gs 1 -1 sc sh gr
    gr
    showpage


This works for OmegaSerif88591, but fails for Kochi-Mincho.  I found
that it fails for all fonts which have many characters, i.e. all east
Asian TrueType fonts and also fonts like MS Arial Unicode or Bitstream
Cyberbit which try to cover most of Unicode.

The problem is not only that one cannot print the Asian glyphs, one
cannot print anything correctly when using these fonts, not even a
simple ASCII string like "xyz". If this problem is solved, I guess
printing will work for east Asian languages when '--enable-freetype'
is used.

Looking into the above postscript file, I see that in both cases the
"xyz" is encoded as "( !")", i.e. only one byte is used for each
character. How is this supposed to work for a font which has much more
than 256 characters? Is the font split up in smaller portions? Does
/OmegaSerif88591_e0 specify a subset of the /OmegaSerif88591 font?

Do you have any hints how this can be fixed?

Footnotes: 
[1] both fonts are free, if you don't already have them
you can download them here to reproduce the problem:
http://www.suse.de/~mfabian/misc/kochi-mincho.ttf
http://www.suse.de/~mfabian/misc/lt1-r-omega-serif.ttf

Attachment: test.dia
Description: Binary data




-- 
Mike Fabian   <mfabian suse de>   http://www.suse.de/~mfabian
睡眠不足はいい仕事の敵\xA4 。


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]