Package elemental.canvas

Examples of elemental.canvas.CanvasRenderingContext2D.measureText()


  @Override
  public double measureStringWidth(String text) {
    CanvasRenderingContext2D context = (CanvasRenderingContext2D) canvas.getContext("2d");
    context.setFont(calculator.getFont());
    TextMetrics metrics = context.measureText(text);
    return metrics.getWidth();
  }
}
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.