3
% change file of psout.w for jMetaPost (CWEB version)
4
% Akira Kakuto (translated the WEB version)
6
% rewrited for TeX Live 2011
7
% Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
11
#include "pmppsout.h" /* internal header */
12
#include "pmpmath.h" /* internal header */
14
#include "pmppsout.h" /* internal header */
15
#include "pmpmath.h" /* internal header */
16
#include <ptexenc/ptexenc.h>
19
% Treat all Kanji fonts as used
21
if ( mp->font_info[p].qqqq.b3==mp_used )
23
if ( mp->font_info[p].qqqq.b3==mp_used || mp->font_id[f]!=0)
29
static void mp_print_initial_comment(MP mp,mp_edge_object *hh, int prologues);
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);
34
#define Hi(x) (((x) >> 8) & 0xff)
35
#define Lo(x) ((x) & 0xff)
38
void mp_ps_kanji_string_out (MP mp, string s)
47
{ if ( mp->ps->ps_offset+5>mp->max_print_line ) mp_ps_print_ln(mp);
48
c=toDVI(fromBUFF(s, i+2, i));
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);
60
mp_ps_print_nl(mp, "%%Creator: MetaPost ");
62
mp_ps_print_nl(mp, "%%Creator: MetaPost (Japanese version) ");
66
% Call Kanji string output routine if the font is JFM.
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);
71
if (mp->font_id[gr_font_n(p)]!=0)
72
mp_ps_kanji_string_out(mp, gr_text_p(p));
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);