Class TextMetricsItem


  • @JsType(isNative=true,
            name="TextMetrics",
            namespace="<global>")
    public final class TextMetricsItem
    extends Object
    Represents the dimensions of a piece of text in the canvas, as created by the Context2dItem.measureText(String) method.
    Author:
    Andrea "Stock" Stocchero
    • Method Detail

      • getWidth

        @JsProperty
        public double getWidth()
        Return the value giving the calculated width of a segment of inline text in CSS pixels.
        It takes in the account the current font of the context..
        Returns:
        the value giving the calculated width of a segment of inline text in CSS pixels