Package com.myscript.iink.text
Interface IFontMetricsProvider
public interface IFontMetricsProvider
Interface providing fontified text typesetting operations.
-
Method Summary
Modifier and TypeMethodDescription@NotNull Rectangle[]
getCharacterBoundingBoxes
(@NotNull Text text, @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.float
getFontSizePx
(@NotNull Style style) Returns the size of the specified font in pixels.@NotNull GlyphMetrics[]
getGlyphMetrics
(@NotNull Text text, @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.boolean
Determine whether implementation supports `getGlyphMetrics()`.
-
Method Details
-
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
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, otherwisefalse
.- 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
-