--- org/tigris/gef/persistence/PostscriptWriter.java.orig Mon Jan 19 10:52:07 2004 +++ org/tigris/gef/persistence/PostscriptWriter.java Tue Jan 20 01:41:56 2004 @@ -94,8 +94,8 @@ } public PostscriptWriter(OutputStream stream, Rectangle bb) throws IOException { - fontmap.put("Dialog","Helvetica"); - fontmap.put("SansSerif","Helvetica"); + fontmap.put("Dialog","GothicBBB-Medium-RKSJ-H"); + fontmap.put("SansSerif","GothicBBB-Medium-RKSJ-H"); fontmap.put("DialogInput","Monospaced"); p = new PrintWriter(stream); if (bb==null) { @@ -113,7 +113,7 @@ p.print(isolatin1encoding); p.println("%%EndSetup"); p.println("1 setlinewidth"); - setFont(new Font("Helvetica",Font.PLAIN,12)); + setFont(new Font("GothicBBB-Medium-RKSJ-H",Font.PLAIN,12)); setColor(Color.black); if (bb!=null) { translate(0,bb.height+2*bb.y); @@ -181,8 +181,7 @@ name += "Oblique"; } - p.println("isolatin1encoding /_" + name + " /" + name + " RE"); - p.println("/_" + name + " findfont"); + p.println("/" + name + " findfont"); p.println(font.getSize() + " scalefont setfont"); } } @@ -455,19 +454,34 @@ } public void drawString(String text, int x, int y) { - StringBuffer buf = new StringBuffer(text); + StringBuffer buf = new StringBuffer(); + byte bytetext[]; int c; String code; - for (int i = 0; i < buf.length(); ++i) { - c = (int)buf.charAt(i); - if (c >= 192 && c < 256) { - buf.setCharAt(i,'\\'); - code = Integer.toOctalString(c); - buf.insert(i+1,code); - i += code.length(); - } else if (c == '\\' || c == '(' || c == ')') { - buf.insert(i++,'\\'); - } + + try{ + bytetext=text.getBytes("Shift_JIS"); + } + catch(UnsupportedEncodingException e){ + bytetext=text.getBytes(); + } + + for (int i = 0; i < bytetext.length; ++i) { + c = (int)bytetext[i]; + if (c < 32 || c >= 127) { + // + // non-ascii char + // + if(c<0) + c+=256; + code = Integer.toOctalString(c); + buf.append('\\').append(code); + } + else{ + if (c == '\\' || c == '(' || c == ')') + buf.append('\\'); + buf.append(new String(bytetext,i,1)); + } } writeCoords(x, y); p.println("moveto"); p.println("(" + buf.toString() + ") show"); --- org/tigris/gef/base/CmdSaveEPS.java.orig Tue Jan 20 02:52:59 2004 +++ org/tigris/gef/base/CmdSaveEPS.java Tue Jan 20 02:53:38 2004 @@ -51,12 +51,18 @@ protected void saveGraphics(OutputStream s, Editor ce, Rectangle drawingArea) throws IOException { - System.out.println("Writing Encapsulated PostScript..."); - PostscriptWriter ps = new PostscriptWriter(s, drawingArea); - ps.translate(-drawingArea.x,-drawingArea.y); - ce.print(ps); - ps.dispose(); - System.out.println("Wrote Encapsulated PostScript."); + + double scale=ce.getScale(); + int x=(int)(drawingArea.x * scale); + int y=(int)(drawingArea.y * scale); + int h=(int)(drawingArea.height * scale); + int w=(int)(drawingArea.width * scale); + drawingArea = new Rectangle(x,y,w,h); + + PostscriptWriter ps = new PostscriptWriter(s, drawingArea); + ps.scale(scale,scale); + ce.print(ps); + ps.dispose(); } } /* end class CmdSaveEPS */