~ubuntu-branches/ubuntu/utopic/texlive-bin/utopic

« back to all changes in this revision

Viewing changes to texk/web2c/pmplibdir/jmppsw.ch

  • Committer: Package Import Robot
  • Author(s): Norbert Preining
  • Date: 2012-05-07 10:47:49 UTC
  • mfrom: (1.2.4)
  • Revision ID: package-import@ubuntu.com-20120507104749-p00ot5sajjbkp1hp
Tags: 2011.20120507-1
* new upstream checkout: uptex 1.10
* drop patches for config file inclusion in (x)dvipdfmx, included upstream
* add man page for etex
* include pmpost patches and build it
* adapt/unfuzzify patches for current sources
* disable mtx building, we have prepmx package in Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%
 
2
%
 
3
% change file of psout.w for jMetaPost (CWEB version)
 
4
% Akira Kakuto (translated the WEB version)
 
5
%
 
6
% rewrited for TeX Live 2011
 
7
% Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
 
8
%
 
9
 
 
10
@x
 
11
#include "pmppsout.h" /* internal header */
 
12
#include "pmpmath.h" /* internal header */
 
13
@y
 
14
#include "pmppsout.h" /* internal header */
 
15
#include "pmpmath.h" /* internal header */
 
16
#include <ptexenc/ptexenc.h>
 
17
@z
 
18
 
 
19
% Treat all Kanji fonts as used
 
20
@x
 
21
    if ( mp->font_info[p].qqqq.b3==mp_used ) 
 
22
@y
 
23
    if ( mp->font_info[p].qqqq.b3==mp_used || mp->font_id[f]!=0)
 
24
@z
 
25
 
 
26
%
 
27
% Kanji string output
 
28
@x
 
29
static void mp_print_initial_comment(MP mp,mp_edge_object *hh, int prologues);
 
30
@y
 
31
static void mp_print_initial_comment(MP mp,mp_edge_object *hh, int prologues);
 
32
void mp_ps_kanji_string_out (MP mp, string s);
 
33
 
 
34
#define Hi(x) (((x) >> 8) & 0xff)
 
35
#define Lo(x) ((x) & 0xff)
 
36
 
 
37
@ @c
 
38
void mp_ps_kanji_string_out (MP mp, string s)
 
39
{
 
40
int i, len;
 
41
int c;
 
42
 
 
43
len = strlen(s);
 
44
i=0;
 
45
mp_ps_print(mp, "<");
 
46
while (i<len)
 
47
  { if ( mp->ps->ps_offset+5>mp->max_print_line ) mp_ps_print_ln(mp);
 
48
  c=toDVI(fromBUFF(s, i+2, i));
 
49
  i=i+2;
 
50
  mp_hex_digit_out(mp, Hi(c) / 16);
 
51
  mp_hex_digit_out(mp, Hi(c) % 16);
 
52
  mp_hex_digit_out(mp, Lo(c) / 16);
 
53
  mp_hex_digit_out(mp, Lo(c) % 16);
 
54
  };
 
55
mp_ps_print(mp, ">");
 
56
};
 
57
@z
 
58
 
 
59
@x
 
60
  mp_ps_print_nl(mp, "%%Creator: MetaPost ");
 
61
@y
 
62
  mp_ps_print_nl(mp, "%%Creator: MetaPost (Japanese version) ");
 
63
@z
 
64
 
 
65
%
 
66
% Call Kanji string output routine if the font is JFM.
 
67
@x
 
68
        mp_ps_string_out(mp, gr_text_p(p),gr_text_l(p));
 
69
        mp_ps_name_out(mp, mp->font_name[gr_font_n(p)],false);
 
70
@y
 
71
        if (mp->font_id[gr_font_n(p)]!=0)
 
72
           mp_ps_kanji_string_out(mp, gr_text_p(p));
 
73
        else
 
74
           mp_ps_string_out(mp, gr_text_p(p),gr_text_l(p));
 
75
        mp_ps_name_out(mp, mp->font_name[gr_font_n(p)],false);
 
76
@z