示例#1
0
    public BiggerFirst(List<FontSymbolLookup> list) {
      maxSize = 0;

      for (FontSymbolLookup l : list) {
        maxSize = Math.max(maxSize, l.size());
      }

      maxSize2 = maxSize / 2;
    }
示例#2
0
    @Override
    public int compare(FontSymbolLookup arg0, FontSymbolLookup arg1) {
      int r = LessCompare.compareBigFirst(arg0.size(), arg1.size(), maxSize2);

      // better quality goes first
      if (r == 0) r = LessCompare.compareBigFirst(arg0.g, arg1.g);

      // bigger items goes first
      if (r == 0) r = LessCompare.compareBigFirst(arg0.size(), arg1.size());

      return r;
    }
示例#3
0
    @Override
    public int compare(FontSymbolLookup arg0, FontSymbolLookup arg1) {
      int r = 0;

      if (r == 0) {
        if (!arg0.yCross(arg1)) r = LessCompare.compareSmallFirst(arg0.y, arg1.y);
      }

      if (r == 0) r = LessCompare.compareSmallFirst(arg0.x, arg1.x);

      if (r == 0) r = LessCompare.compareSmallFirst(arg0.y, arg1.y);

      return r;
    }