Examples of FEPointList


Examples of org.fonteditor.elements.points.FEPointList

public class Slanter {
  public static void slant(FEGlyph glyph, DisplayOptions gdo) {
    int slant_factor = gdo.getSlant();
    if (slant_factor != 0) {
      FEPointList point_list = glyph.getFEPointList(gdo);
      FEPoint point;
     
      int len = point_list.getNumber();
      if (slant_factor > 0) {
        for (int index = len; --index >= 0;) {
          point = point_list.getPoint(index);
          point.setX(point.getX() + ((slant_factor * (0x10000 - point.getY())) >> 8));
        }
      } else if (slant_factor < 0) {
        for (int index = len; --index >= 0;) {
          point = point_list.getPoint(index);
          point.setX(point.getX() - ((slant_factor * point.getY()) >> 8));
        }
      }
    }
  }
View Full Code Here

Examples of org.fonteditor.elements.points.FEPointList

  //    return path_element[i];
  //  }
  // could try caching this...?
  public FEPointList getFEPointList() {
    if (fepl == null) {
      fepl = new FEPointList();
      for (int i = 0; i < number_of_curves; i++) {
        curve[i].simplyAddPoints(fepl);
      }
    }
    return fepl;
View Full Code Here

Examples of org.fonteditor.elements.points.FEPointList

  public boolean contains(FEPoint p) {
    return indexOf(p) >= 0;
  }

  public int indexOf(FEPoint p) {
    FEPointList fepl = getFEPointList();

    return fepl.indexOf(p);
  }
View Full Code Here

Examples of org.fonteditor.elements.points.FEPointList

public class Expander {
  public static void expand(FEGlyph glyph, DisplayOptions gdo) {
    int expand_factor = gdo.getExpand();
    if (expand_factor > 0) {
      FEPointList fepl_of_glyph = glyph.getFEPointList(gdo);
      for (int index = fepl_of_glyph.getNumber(); --index >= 0;) {
        FEPoint point = fepl_of_glyph.getPoint(index);
        point.setX((point.getX() * expand_factor) >> 10);
      }
    }
  }
View Full Code Here

Examples of org.fonteditor.elements.points.FEPointList

    return fepl.indexOf(p);
  }

  public FEPoint safelyGetPoint(int i) {
    FEPointList fepl = getFEPointList();

    return fepl.safelyGetPoint(i);
  }
View Full Code Here

Examples of org.fonteditor.elements.points.FEPointList

  void setUpSlidersInternal(FEPath p)
  {
    // On each path...
    // Go through all the points
    // boolean direction = p.getDirection();// set back to null at the bottom if you use this line...
    FEPointList fepl = p.getFEPointList();

    if (fepl.getNumber() > 1)
    {
      FEPoint current_point;
      FEPoint next_point;
      //      FEPoint[] array = fepl.getPoints();
      int increasing;

      increasing = (fepl.getPoint(fepl.getNumber() - 2).getX() < fepl
          .getPoint(fepl.getNumber() - 1).getX()) ? 1 : -1;
      current_point = fepl.getPoint(fepl.getNumber() - 1);
      for (int i = 0; i < fepl.getNumber(); i++)
      {
        int cpx = current_point.getX();

        next_point = fepl.getPoint(i);
        if (Utils.equalsApprox(current_point.getX(), next_point.getX(),
            TOLERANCE))
        {
          boolean dir = current_point.getY() > next_point.getY();

          slider_manager_vertical.add(new Slider(VERTICAL,
              Slider.PARALLEL, dir, Math.abs(next_point.getY()
                  - current_point.getY()), current_point));
        }
        else
        {
          if (increasing > 0)
          {
            if (cpx > next_point.getX())
            {
              slider_manager_vertical.add(new Slider(VERTICAL,
                  Slider.INFLECTION, true, Math
                      .abs(next_point.getY()
                          - current_point.getY()),
                  current_point));
            }
            // else {
            //  }
          }

          if (increasing < 0)
          {
            if (cpx < next_point.getX())
            {
              slider_manager_vertical.add(new Slider(VERTICAL,
                  Slider.INFLECTION, true, Math
                      .abs(next_point.getY()
                          - current_point.getY()),
                  current_point));
            }
            // else {
            //  }
          }

          if (cpx > next_point.getX())
          {
            increasing = -1;
          }

          if (cpx < next_point.getX())
          {
            increasing = 1;
          }
        }
        current_point = next_point;
      }

      increasing = (fepl.getPoint(fepl.getNumber() - 2).getY() < fepl
          .getPoint(fepl.getNumber() - 1).getY()) ? 1 : -1;
      current_point = fepl.getPoint(fepl.getNumber() - 1);

      for (int i = 0; i < fepl.getNumber(); i++)
      {
        int cpy = current_point.getY();

        next_point = fepl.getPoint(i);
        if (Utils.equalsApprox(current_point.getY(), next_point.getY(),
            TOLERANCE))
        {
          boolean dir = current_point.getX() > next_point.getX();
View Full Code Here

Examples of org.fonteditor.elements.points.FEPointList

      int new_pos = nvg.getNearestValue(gdo, old_pos, s);

      int index_current = -1;

      do {
        FEPointList fepl_of_glyph = glyph.getFEPointList(gdo);
        index_current = getIndexOfNextMatchingPoint(fepl_of_glyph, index_current, old_pos, pvg);
        if (index_current >= 0) {
          FEPath path = glyph.getFEPathList(gdo).getPath(fepl_of_glyph.getPoint(index_current));
          FEPointList fepl = path.getFEPointList();
          FEPoint point = fepl_of_glyph.getPoint(index_current);
          int index_on_path = fepl.getIndexOf(point);
          if (index_on_path >= 0) {

            int min_index = getIndexOfNextSlider(fepl, index_on_path, s_m, -1, pvg);
            int max_index = getIndexOfNextSlider(fepl, index_on_path, s_m, 1, pvg);
View Full Code Here

Examples of org.fonteditor.elements.points.FEPointList

    boolean flipped = false;
    FEPoint p1 = fepointlist.getPoint(idx_p1);
    FEPoint p2 = fepointlist.getPoint(idx_p2);
    int max = p1.squaredDistanceFrom(p2);
    FEPath path = fepathlist.getPath(p2);
    FEPointList fepl = path.getFEPointList();

    idx_p2 = fepl.getIndexOf(p2);
    for (; true;) {
      int new_idx_p2 = idx_p2 + dir;

      if (new_idx_p2 < 0) {
        new_idx_p2 = fepl.getNumber() - 1;
      }
      if (new_idx_p2 >= fepl.getNumber()) {
        new_idx_p2 = 0;
      }
      p2 = fepl.getPoint(new_idx_p2);
      int dist = p1.squaredDistanceFrom(p2);

      if (dist <= max) {
        max = dist;
        idx_p2 = new_idx_p2;
      } else {
        if (flipped) {
          return fepointlist.getIndexOf(fepl.getPoint(idx_p2));
        } else {
          dir = -dir;
          flipped = true;
        }
      }
View Full Code Here

Examples of org.fonteditor.elements.points.FEPointList

    this.dx = dx;
    this.dy = dy;
  }

  public void translate(DisplayOptions gdo) {
    FEPointList fepl = glyph.getFEPointList(gdo);
    fepl.executeOnEachPoint(getCallBackFix());
  }
View Full Code Here

Examples of org.fonteditor.elements.points.FEPointList

  public FEFixer(FEGlyph glyph) {
    this.glyph = glyph;
  }

  public void fix(DisplayOptions gdo) {
    FEPointList fepl = glyph.getFEPointList(gdo);
    fepl.executeOnEachPoint(getCallBackFix());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.