Interface IFontMetricsProvider


  • public interface IFontMetricsProvider
    Interface providing fontified text typesetting operations.
    • Method Detail

      • getCharacterBoundingBoxes

        @NotNull
        @NotNull Rectangle[] getCharacterBoundingBoxes​(@NotNull
                                                       @NotNull Text text,
                                                       @NotNull
                                                       @NotNull TextSpan[] spans)
        Returns the bounding box of each glyph of the specified text if it were displayed at 0,0 using the specified styles.
        Parameters:
        text - the text.
        spans - an array of glyph intervals with associated style.
        Returns:
        the bounding boxes.
      • getFontSizePx

        float getFontSizePx​(@NotNull
                            @NotNull Style style)
        Returns the size of the specified font in pixels. On input the font size is expressed in logical units as specified by the platform.
        Parameters:
        style - the style that specifies the font.
        Returns:
        the size of the font in pixels.
      • supportsGlyphMetrics

        boolean supportsGlyphMetrics()
        Determine whether implementation supports `getGlyphMetrics()`.
        Returns:
        true if `getGlyphMetrics()` is implemented, otherwise false.
        Since:
        2.0
      • getGlyphMetrics

        @NotNull
        @NotNull GlyphMetrics[] getGlyphMetrics​(@NotNull
                                                @NotNull Text text,
                                                @NotNull
                                                @NotNull TextSpan[] spans)
        Returns the bounding box and left side bearing of each glyph of the specified text if it were displayed at 0,0 using the specified styles.
        Parameters:
        text - the text.
        spans - an array of glyph intervals with associated style.
        Returns:
        the glyph metrics.
        Since:
        2.0