Examples of DistanceField


Examples of ae.math.DistanceField

    return fontCharacter;
  }
 
  public static FontCharacter getDistanceFieldChar(FontCharacter fontCharacter, Font font, int newPtSize, float smoothAmount) {
   
    DistanceField distanceField = DistanceField.calculate(
        fontCharacter.getBytes(),
        fontCharacter.getWidth(),
        fontCharacter.getHeight(),
        (int) Math.ceil(smoothAmount*font.getSize2D()*0.336f), // smooth pixels length
        newPtSize / font.getSize2D() // new font size
        );
   
    float resizedPerc = (distanceField.getHeight() - 2 * distanceField.getBorder()) / (float) fontCharacter.getHeight();
   
    return new FontCharacter(
        distanceField.getBytes(),
        distanceField.getWidth(),
        distanceField.getHeight(),
        fontCharacter.getBaseline() * resizedPerc - distanceField.getBorder(),
        fontCharacter.getAdvanceBefore() * resizedPerc + distanceField.getBorder(),
        fontCharacter.getAdvanceAfter() * resizedPerc - distanceField.getBorder()
        );
  }
View Full Code Here

Examples of org.springframework.data.solr.core.query.DistanceField

    solrTemplate.saveBeans(Arrays.asList(bean1, bean2));
    solrTemplate.commit();

    Query q = new SimpleQuery("*:*");
    q.addProjectionOnField(new DistanceField("distance", "store", new Point(45.15, -93.85)));
    Page<ExampleSolrBean> result = solrTemplate.queryForPage(q, ExampleSolrBean.class);
    for (ExampleSolrBean bean : result) {
      Assert.assertThat(bean.getDistance(), IsNull.notNullValue());
    }

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.