Loading ...
Sorry, an error occurred while loading the content.

741Re: add multibyte support for hardcopy

Expand Messages
  • Yasuhiro Matsumoto
    Nov 6, 2002
    • 0 Attachment
      >Hi.
      >
      >:hardcopy doesn't support multibyte characters,
      >so I wrote a patch to support it.
      >
      >Currently this patch (can apply from 6.0 to 6.1.247) enables
      >
      >Japanese EUC-JP
      >Japanese SJIS
      >Korean EUC-KR
      >Chinese Big5
      >Chinese GB2312
      >
      >codeset to print PS file. (PS fontnames are hardcoded yet.)
      >
      >some screenshots (output ps file using :hardcopy and view with gv) are
      >available at

      Hello Ichimura.

      I tried your patch, it's great!.
      It is coincidence, I was just talking about this problem
      with Mike Williams and Bram at last month.

      I guess that it need bit's change. :-)
      I could output ps file on win32 with this patch.
      (I made this patch against your patch.)

      BTW)
      As bram said, there is a problem about
      "How to select the printer fonts."
      I think, it is very difficult for vim to select a CMap.
      Maybe, most users has the other way to output ps like a2ps.
      I think, vim don't need to change more after this patch.

      Thanks.

      *** ex_cmds2.c~ Thu Nov 07 11:42:14 2002
      --- ex_cmds2.c Thu Nov 07 11:39:51 2002
      ***************
      *** 2632,2637 ****
      --- 2632,2638 ----
      #ifdef FEAT_MBYTE
      static void prt_set_mfont __ARGS((int bold, int italic, int underline));
      static void prt_mfont_init __ARGS((void));
      + void mch_print_set_mfont __ARGS((int, int, int));
      #endif
      static void prt_line_number __ARGS((prt_settings_T *psettings, int
      page_line, linenr_T lnum));
      static void prt_header __ARGS((prt_settings_T *psettings, int pagenum,
      linenr_T lnum));
      ***************
      *** 3465,3471 ****
      -250, 805,
      {"Ryumin-Light-RKSJ-H", "GothicBBB-Medium-RKSJ-H",
      "Ryumin-Light-RKSJ-H", "GothicBBB-Medium-RKSJ-H"},
      ! "sjis"
      },
      {
      /* Korean EUC-KR */
      --- 3466,3472 ----
      -250, 805,
      {"Ryumin-Light-RKSJ-H", "GothicBBB-Medium-RKSJ-H",
      "Ryumin-Light-RKSJ-H", "GothicBBB-Medium-RKSJ-H"},
      ! "sjis,shift_jis,cp932"
      },
      {
      /* Korean EUC-KR */
      ***************
      *** 3716,3727 ****
      }
      for (i = 0; i < SUPPORTED_ENCODINGS; i++)
      {
      ! if (!STRICMP(p_enc,prt_ps_mfonts[i].encoding))
      {
      ! prt_ps_mfont = prt_ps_mfonts[i];
      ! prt_has_mfont = TRUE;
      return;
      }
      }
      prt_has_mfont = FALSE;
      }
      --- 3717,3744 ----
      }
      for (i = 0; i < SUPPORTED_ENCODINGS; i++)
      {
      ! char_u *name;
      ! char_u *ptr = vim_strsave(prt_ps_mfonts[i].encoding);
      ! char_u *old = ptr;
      ! if (!ptr)
      {
      ! prt_has_mfont = FALSE;
      return;
      }
      + while(*ptr)
      + {
      + name = ptr;
      + while(*ptr != ',' && *ptr != '\0')
      + ptr++;
      + *ptr++ = 0;
      + if (!STRICMP(p_enc, name))
      + {
      + prt_ps_mfont = prt_ps_mfonts[i];
      + prt_has_mfont = TRUE;
      + return;
      + }
      + }
      + vim_free(old);
      }
      prt_has_mfont = FALSE;
      }
      ***************
      *** 4801,4807 ****
      if (len > 1) {
      int i;
      for (i = 0; i < len ; i++) {
      ! ga_append (&prt_ps_buffer, p[i]);
      }
      goto done;
      }
      --- 4818,4827 ----
      if (len > 1) {
      int i;
      for (i = 0; i < len ; i++) {
      ! ch = p[i];
      ! if (ch == '(' || ch == ')' || ch == '\\')
      ! ga_append(&prt_ps_buffer, IF_EB('\\', 0134));
      ! ga_append(&prt_ps_buffer, ch);
      }
      goto done;
      }
      --

      - Yasuhiro


      _________________________________________________________________
      Add photos to your e-mail with MSN 8. Get 2 months FREE*.
      http://join.msn.com/?page=features/featuredemail
    • Show all 9 messages in this topic