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

printing Japanese without freetype (was: dia 0.90: printingJapanese using --enable-freetype ?)



Akira TAGOH <tagoh@gnome.gr.jp> writes:

>>>>>> On Wed, 05 Jun 2002 19:02:42 +0200,
>>>>>> "MF" == Mike Fabian <mfabian@suse.de> wrote:
>
> MF> Here I attach my current tentative patch against dia-0.90.
>>>>>> On Wed, 05 Jun 2002 19:02:42 +0200,
>>>>>> "MF" == Mike Fabian <mfabian@suse.de> wrote:
>
> MF> diff -ru dia-0.90/app/render_eps.c dia-0.90.new/app/render_eps.c
> MF> --- dia-0.90/app/render_eps.c	Tue May  7 22:52:58 2002
> MF> +++ dia-0.90.new/app/render_eps.c	Mon Jun  3 12:45:23 2002
> MF> @@ -499,7 +499,12 @@
> MF>  #ifndef HAVE_UNICODE
> MF>    /* Don't reencode the Symbol font, as it doesn't work in latin1 encoding.
> MF>     * Instead, just define Symbol-latin1 to be the same as Symbol. */
> MF> -  if (!strcmp(fontname, "Symbol"))
> MF> +  /* Don't do that for the Dingbats and the Japanese fonts either! */
> MF> +  /* Sat Mar  2 02:08:34 2002  Mike Fabian  <mfabian@suse.de> */
> MF> +  if (strcasestr(fontname, "Symbol") ||
> MF> +      strcasestr(fontname, "Dingbats") ||
> MF> +      strcasestr(fontname, "Ryumin") ||
> MF> +      strcasestr(fontname, "GothicBBB"))
> MF>      fprintf(file,
> MF>  	    "/%s-latin1\n"
> MF>  	    "    /%s findfont\n"
>
> I'm sure it's l10n, not i18n. but I have no idea to fix this
> now.

This was necessary for dia-0.88.1 to avoide reencoding the Japanese
fonts, but for dia-0.90 this code has become irrelevant because
HAVE_UNICODE seems to be defined always, i.e. this hack
doesn't work anymore for dia-0.90.

> MF>    { "GothicBBB-Medium",
> MF> -	"GothicBBB-Medium",
> MF> -	{ "-*-gothic-medium-r-normal-*-%d-*-*-*-*-*-*-*",
> MF> -	  NULL
> MF> -	}
> MF> +    "GothicBBB-Medium-EUC-H",
> MF> +    { "-kochi-gothic-medium-r-normal-*-%d-*-*-*-*-*-*-*",
> MF> +      NULL,
> MF> +      NULL
> MF> +    },
> MF> +    "Kochi Gothic", "Regular"
> MF>    },
>
> No, this is wrong. if dia supports the vertical writing, do
> you intend to add -EUC-V entry too? and that patch is
> meaningless because right now correctly PostScript dia
> outputs doesn't depend on Ghostscript.

I don't understand that. If you compile dia-0.90 without using
'--enable-freetype' the PostScript output does depend on Ghostscript.
I just tried again. Without '--enable-freetype', dia does not embed
fonts into the PostScript output. It just write font names into
the PostScript output and relies on the existence of these fonts
in the Printer or Ghostscript.

In the Ghostscript Fontmap there is:

    /goth (goth.gsf) ;
    /goth-RKSJ (goth.gsf) ;
    /goth-EUC (goth.gsf) ;
    /goth-V (goth.gsf) ;

    /GothicBBB-Medium		/goth ;
    /GothicBBB-Medium-H		/goth ;
    /GothicBBB-Medium-RKSJ		/goth-RKSJ ;
    /GothicBBB-Medium-RKSJ-H	/goth-RKSJ ;
    /GothicBBB-Medium-EUC		/goth-EUC ;
    /GothicBBB-Medium-EUC-H		/goth-EUC ;
    /GothicBBB-Medium-V		/goth-V ;

I.e. GothicBBB-Medium and GothicBBB-Medium-EUC-H are aliased to the
same font.

Unfortunately I can't get dia-0.90 to print Japanese anymore
using Ghostscript. Here is a simple example file created
with dia-0.90 with freetype disabled:

<?xml version="1.0" encoding="UTF-8"?>
<dia:diagram xmlns:dia="http://www.lysator.liu.se/~alla/dia/">
  <dia:diagramdata>
    <dia:attribute name="background">
      <dia:color val="#ffffff"/>
    </dia:attribute>
    <dia:attribute name="paper">
      <dia:composite type="paper">
        <dia:attribute name="name">
          <dia:string>#A4#</dia:string>
        </dia:attribute>
        <dia:attribute name="tmargin">
          <dia:real val="2.8222"/>
        </dia:attribute>
        <dia:attribute name="bmargin">
          <dia:real val="2.8222"/>
        </dia:attribute>
        <dia:attribute name="lmargin">
          <dia:real val="2.8222"/>
        </dia:attribute>
        <dia:attribute name="rmargin">
          <dia:real val="2.8222"/>
        </dia:attribute>
        <dia:attribute name="is_portrait">
          <dia:boolean val="true"/>
        </dia:attribute>
        <dia:attribute name="scaling">
          <dia:real val="1"/>
        </dia:attribute>
        <dia:attribute name="fitto">
          <dia:boolean val="false"/>
        </dia:attribute>
      </dia:composite>
    </dia:attribute>
    <dia:attribute name="grid">
      <dia:composite type="grid">
        <dia:attribute name="width_x">
          <dia:real val="1"/>
        </dia:attribute>
        <dia:attribute name="width_y">
          <dia:real val="1"/>
        </dia:attribute>
        <dia:attribute name="visible_x">
          <dia:int val="1"/>
        </dia:attribute>
        <dia:attribute name="visible_y">
          <dia:int val="1"/>
        </dia:attribute>
      </dia:composite>
    </dia:attribute>
    <dia:attribute name="guides">
      <dia:composite type="guides">
        <dia:attribute name="hguides"/>
        <dia:attribute name="vguides"/>
      </dia:composite>
    </dia:attribute>
  </dia:diagramdata>
  <dia:layer name="$BGX7J(B" visible="true">
    <dia:object type="Standard - Text" version="0" id="O0">
      <dia:attribute name="obj_pos">
        <dia:point val="3,4"/>
      </dia:attribute>
      <dia:attribute name="obj_bb">
        <dia:rectangle val="3,2.23;19.44,4.38"/>
      </dia:attribute>
      <dia:attribute name="text">
        <dia:composite type="text">
          <dia:attribute name="string">
            <dia:string>#Japanese $BF|K\8l(B#</dia:string>
          </dia:attribute>
          <dia:attribute name="font">
            <dia:font name="Ryumin-Light"/>
          </dia:attribute>
          <dia:attribute name="height">
            <dia:real val="2"/>
          </dia:attribute>
          <dia:attribute name="pos">
            <dia:point val="3,4"/>
          </dia:attribute>
          <dia:attribute name="color">
            <dia:color val="#000000"/>
          </dia:attribute>
          <dia:attribute name="alignment">
            <dia:enum val="0"/>
          </dia:attribute>
        </dia:composite>
      </dia:attribute>
    </dia:object>
  </dia:layer>
</dia:diagram>

The PostScript output is:

japanese-test-dia-0.90-no-freetype.dia.ps

And Ghostscript gives the following output:

    mfabian@gregory:/tmp$ gs japanese-test-dia-0.90-no-freetype.dia.ps
    GNU Ghostscript 6.53 (2002-02-13)
    Copyright (C) 2002 artofcode LLC, Benicia, CA. All rights reserved.
    This software comes with NO WARRANTY: see the file COPYING for details.
    Loading min font from /usr/share/ghostscript/fonts/min.gsf... Can't find (or can't open) font file /Resource/Font/NotDefFont.
    Can't find (or can't open) font file NotDefFont.
    Substituting font Courier for NotDefFont.
    Loading NimbusMonL-Regu font from /usr/share/ghostscript/fonts/n022003l.pfb... 2278032 829084 2587032 926502 0 done.
    Can't find (or can't open) font file /Resource/Font/NotDefFont.
    Can't find (or can't open) font file NotDefFont.
    Substituting font Courier for NotDefFont.
    2278032 834155 2928664 1114626 0 done.
    Error: /invalidfont in -dict-
    Operand stack:
       Ryumin-Light_e0   --dict:7/8(L)--   Font   Ryumin-Light_e0   --dict:7/8(L)--   Ryumin-Light_e0
    Execution stack:
       %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1%stopped_push   1   3   %oparray_pop   1   3   %oparray_pop   1   3   %oparray_pop.runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push --nostringval--   2   3   %oparray_pop   3   3   %oparray_pop   --nostringval--   --nostringval--   --nostringval--   7   4   %oparray_pop   --nostringval--   7   4   %oparray_pop   --nostringval--   --nostringval--
    Dictionary stack:
       --dict:1040/1241(ro)(G)--   --dict:0/20(G)--   --dict:99/200(L)--   --dict:17/17(ro)(G)--
    Current allocation mode is local
    Last OS error: 2
    Current file position is 2881
    GNU Ghostscript 6.53: Unrecoverable error, exit code 1
    mfabian@gregory:/tmp$

You can see that it loads the Ryumin-Light font, but then fails
because of the reencoding.

How do you get Japanese printing to work with dia 0.90?

-- 
Mike Fabian   <mfabian@suse.de>   http://www.suse.de/~mfabian
$B?gL2ITB-$O$$$$;E;v$NE($@!#(B


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] Mail converted by Mofo Magic and the Flying D

 
All trademarks and copyrights are the property of their respective owners.

Other Directory Sites: SeekWonder | Directory Owners Forum

GuideSMACK