[wadalabfont-kit] / java / MinchoRenderer.java  

View of /java/MinchoRenderer.java

Parent Directory | Revision Log
Revision: 1.4 - (download) (as text) (annotate)
Sun Jan 7 12:20:20 2001 UTC (23 years, 3 months ago) by ktanaka
Branch: MAIN
CVS Tags: SNAP-20030702, SNAP-20030624, SNAP-20030630, SNAP-20040518, HEAD
Changes since 1.3: +37 -0 lines
$B72GO$G$N:n6H(B
public class MinchoRenderer extends Renderer{
  // $B=DK@$NI}(B
  double width;
  // $B=DK@$KBP$9$k2#K@$NHfN((B
  double ratio;
  // $B$R$i$,$J$NI}(B
  double hiraWidth;
  // $B=DK@$N;OE@$N>~$j(B
  double tateSerif;
  // $B=DK@$H2#K@$N8rE@$N>~$j(B
  double tateYokoSerif;
  // $B2#@~$N;_$a$N=D@~$KBP$9$kHf(B
  double yokoSerif;
  public static MinchoRenderer hosoMincho=
    new MinchoRenderer(8.0,0.2,0.35,1.8,1.8,2.4);
  public static MinchoRenderer chuuMincho=
    new MinchoRenderer(12.0,0.4,0.6,1.5,1.4,1.8);
  public MinchoRenderer(double w,double r,double hw,
                        double ts,double tys, double ys){
    width=w; ratio=r; hiraWidth=hw;
    tateSerif=ts; tateYokoSerif=tys; yokoSerif=ys;
  }
  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)))
    };
  // $BE@$NIA2h(B
  public Outline[] ten(Point[] points,ElementAnnotation[] annotations){
    // temSample$B$r(B p0,p1$B$K(Bfit$B$9$k(B
    double len=points[0].distance(points[1]);
    double w=width;
    if(3*w<len) w=w/20.0;
    else w=len/60.0;
    return fitSample(tenSample,points[0],points[1],w);
  }
  // $B=DK@$NIA2h(B
  public Outline[] tate(Point[] points,ElementAnnotation[] annotations){
    return line2(points[0],points[1],width);
  }
  // $B2#K@$NIA2h(B
  public Outline[] yoko(Point[] points,ElementAnnotation[] annotations){
    return line2(points[0],points[1],width*ratio);
  }
  // $B1&>e(B
  public Outline[] migiue(Point[] points,ElementAnnotation[] annotations){
    return curve2(points[0],points[1],points[2],
                 0.6,0.6,
                 width,0.7*width,0.3*width,0.0);
  }
  // $B:8J'$$(B
  public Outline[] hidari(Point[] points,ElementAnnotation[] annotations){
    Point p0=points[0],p1=points[1],p2=points[2];
    double w=Math.min(width,0.35*p0.distance(p2));
    double len01=p0.distance(p1),len12=p1.distance(p2);
    double ratio=len01/(len01+len12);
    double theta=p1.minus(p0).theta(p2.minus(p1));
    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));

    return curve2(points[0],points[1],points[2],
                 0.6,0.6,
                 width,0.7*width,0.3*width,0.0);
  }
  // $B=DK@:8J'$$(B
  // $BK\J*$O0c$&(B
  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;
  }
  // $B1&J'$$(B
  public Outline[] migi(Point[] points,ElementAnnotation[] annotations){
    return curve2(points[0],points[1],points[2],
                 0.6,0.6,
                 0.5*width,0.68*width,1.03*width,1.2*width);
  }
  // $B$3$6$H(B
  public Outline[] kozato(Point[] points, ElementAnnotation[] annotations){
    
  }
  // 
  public Outline[] tatehane(Point[] points, ElementAnnotation[] annotations){
    
  }
  //
  public Outline[] tsukurihane(Point[] points, ElementAnnotation[] annotations){
    
  }
  //
  public Outline[] sanzui(Point[] points, ElementAnnotation[] annotations){
    
  }
  //
  public Outline[] kokoro(Point[] points, ElementAnnotation[] annotations){
    
  }
  public Outline[] tasuki(Point[] points, ElementAnnotation[] annotations){
    
  }
  public Outline[] magaritate(Point[] points, ElementAnnotation[] annotations){
    
  }
  public Outline[] kagi(Point[] points, ElementAnnotation[] annotations){
    
  }
  public Outline[] shin_nyuu(Point[] points, ElementAnnotation[] annotations){
    
  }
  public Outline[] hira_long(Point[] points, ElementAnnotation[] annotations){
    
  }
  public Outline[] hira_circle(Point[] points, ElementAnnotation[] annotations){
    
  }
}

ktanaka

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help