[wadalabfont-kit] / java / MinchoRenderer.java  

Diff of /java/MinchoRenderer.java

Parent Directory | Revision Log

version 1.2, Wed Jan 3 02:46:31 2001 UTC version 1.3, Thu Jan 4 10:23:56 2001 UTC
Line 20 
Line 20 
     width=w; ratio=r; hiraWidth=hw;      width=w; ratio=r; hiraWidth=hw;
     tateSerif=ts; tateYokoSerif=tys; yokoSerif=ys;      tateSerif=ts; tateYokoSerif=tys; yokoSerif=ys;
   }    }
   static Outline[] tenSample;    static Outline[] tenSample={
       new Outline(new Bezier(new Point(80,171),new Point(119,214),
                          new Point(104,256),new Point(136,255))),
       new Outline(new Bezier(new Point(80,171),new Point(155,204),
                          new Point(173,251),new Point(136,255)))
       };
   // 点の描画    // 点の描画
   public Outline[] ten(Point[] points,ElementAnnotation[] annotations){    public Outline[] ten(Point[] points,ElementAnnotation[] annotations){
     if(tenSample==null){      // temSampleを p0,p1にfitする
       tenSample=new Outline[2];      double len=points[0].distance(points[1]);
       OutlineComponent[] lc=new OutlineComponent[1];      double w=width;
       lc[0]=new Bezier(new Point(80,171),new Point(119,214),      if(3*w<len) w=w/20.0;
                        new Point(104,256),new Point(136,255));      else w=len/60.0;
       tenSample[0]=new Outline(lc);      return fitSample(tenSample,points[0],points[1],w);
       lc=new OutlineComponent[1];  
       lc[0]=new Bezier(new Point(80,171),new Point(155,204),  
                        new Point(173,251),new Point(136,255));  
       tenSample[1]=new Outline(lc);  
     }  
     // これを p0,p1にfitする  
     return line2(points[0],points[1],width);  
   }    }
   // 縦棒の描画    // 縦棒の描画
   public Outline[] tate(Point[] points,ElementAnnotation[] annotations){    public Outline[] tate(Point[] points,ElementAnnotation[] annotations){
Line 66 
Line 64 
                  0.6,0.6,                   0.6,0.6,
                  width,0.7*width,0.3*width,0.0);                   width,0.7*width,0.3*width,0.0);
   }    }
     // 縦棒左払い
     // 本物は違う瘢雹
     public Outline[] tatehidari(Point[] points,ElementAnnotation[] annotations){
       Point p0=points[0],p1=points[1],p2=points[2],p3=points[3];
       double w=Math.min(width,0.35*p0.distance(p3));
       double len12=p1.distance(p2),len23=p2.distance(p3);
       double ratio=len12/(len12+len23);
       double theta=p2.minus(p1).theta(p3.minus(p2));
       double s=Math.min(1.0,theta*0.7);
       double w1=(1-s)*ratio*w+s*w;
       double r0=Math.max(0.66666,1.0+0.5*(1.0-1.0/ratio));
       Outline[] o0=line2(points[0],points[1],width);
       Outline[] o1=curve2(points[1],points[2],points[3],
                    0.6,0.6,
                    width,width,0.3*width,0.0);
       o0[0]=o0[0].append(o1[0]);
       o0[1]=o0[1].append(o1[1]);
       return o0;
     }
   // 右瘢雹払い    // 右瘢雹払い
   public Outline[] migi(Point[] points,ElementAnnotation[] annotations){    public Outline[] migi(Point[] points,ElementAnnotation[] annotations){
     return curve2(points[0],points[1],points[2],      return curve2(points[0],points[1],points[2],
                  0.6,0.6,                   0.6,0.6,
                  0.5*width,0.68*width,1.03*width,1.2*width);                   0.5*width,0.68*width,1.03*width,1.2*width);
   }    }
     //
 }  }


Generate output suitable for use with a patch program
Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

ktanaka

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help