public interface UIFontDrawing
This interface can be fully implemented by a dedicated class in front panel project. This allows to draw and decode fonts with a custom format.
| Modifier and Type | Method and Description |
|---|---|
default void |
draw(MicroUIGraphicsContext gc,
char[] string,
MicroUIFont font,
int x,
int y)
Draws a string.
|
default void |
draw(MicroUIGraphicsContext gc,
char c,
MicroUIFont font,
int x,
int y)
Draws a character.
|
default void |
drawCharWithRotationBilinear(MicroUIGraphicsContext gc,
char c,
MicroUIFont font,
int destX,
int destY,
int xRotation,
int yRotation,
float angle,
int alpha)
Draws a string applying a rotation and an alpha value.
|
default void |
drawCharWithRotationNearestNeighbor(MicroUIGraphicsContext gc,
char c,
MicroUIFont font,
int destX,
int destY,
int xRotation,
int yRotation,
float angle,
int alpha)
Draws a string applying a rotation and an alpha value.
|
default void |
drawRenderableString(MicroUIGraphicsContext gc,
char[] string,
MicroUIFont font,
int charsWidth,
MicroUIRenderableString renderableString,
int x,
int y)
Draws a renderable string.
|
default void |
drawScaledRenderableStringBilinear(MicroUIGraphicsContext gc,
char[] string,
MicroUIFont font,
int charsWidth,
MicroUIRenderableString renderableString,
int x,
int y,
float xRatio,
float yRatio)
Draws a renderable string applying a scaling.
|
default void |
drawScaledStringBilinear(MicroUIGraphicsContext gc,
char[] string,
MicroUIFont font,
int x,
int y,
float xRatio,
float yRatio)
Draws a string applying a scaling.
|
MicroUIFontFormat |
handledFormat()
Gets the supported custom font format.
|
default int |
initializeRenderableStringSNIContext(char[] string,
MicroUIFont font,
MicroUIRenderableString renderableString)
Computes the rendered width of a string and fills the SNI context.
|
default int |
stringWidth(char[] string,
MicroUIFont font)
Computes the rendered width of a string.
|
MicroUIFontFormat handledFormat()
default int stringWidth(char[] string,
MicroUIFont font)
string - a string of charactersfont - the MicroUI Font to usedefault void draw(MicroUIGraphicsContext gc, char[] string, MicroUIFont font, int x, int y)
gc - the targeted MicroUI GraphicsContextstring - a string of charactersfont - the MicroUI Font to usex - the left coordinatey - the top coordinatedefault void draw(MicroUIGraphicsContext gc, char c, MicroUIFont font, int x, int y)
gc - the targeted MicroUI GraphicsContextc - a characterfont - the MicroUI Font to usex - the left coordinatey - the top coordinatedefault int initializeRenderableStringSNIContext(char[] string,
MicroUIFont font,
MicroUIRenderableString renderableString)
string - a string of charactersfont - the MicroUI Font to userenderableString - the renderable stringdefault void drawRenderableString(MicroUIGraphicsContext gc, char[] string, MicroUIFont font, int charsWidth, MicroUIRenderableString renderableString, int x, int y)
gc - the targeted MicroUI GraphicsContextstring - a string of charactersfont - the MicroUI Font to usecharsWidth - the string widthrenderableString - the renderable stringx - the left coordinatey - the top coordinatedefault void drawCharWithRotationBilinear(MicroUIGraphicsContext gc, char c, MicroUIFont font, int destX, int destY, int xRotation, int yRotation, float angle, int alpha)
gc - the targeted MicroUI GraphicsContextc - a characterfont - the MicroUI Font to usedestX - the left coordinatedestY - the top coordinatexRotation - the horizontal coordinate of the rotation centeryRotation - the vertical coordinate of the rotation centerangle - the rotation angle, in degreesalpha - the alpha value to usefontData - the MicroUI font to usedefault void drawCharWithRotationNearestNeighbor(MicroUIGraphicsContext gc, char c, MicroUIFont font, int destX, int destY, int xRotation, int yRotation, float angle, int alpha)
gc - the targeted MicroUI GraphicsContextc - a characterfont - the MicroUI Font to usedestX - the left coordinatedestY - the top coordinatexRotation - the horizontal coordinate of the rotation centeryRotation - the vertical coordinate of the rotation centerangle - the rotation angle, in degreesalpha - the alpha value to usefontData - the MicroUI font to usedefault void drawScaledStringBilinear(MicroUIGraphicsContext gc, char[] string, MicroUIFont font, int x, int y, float xRatio, float yRatio)
gc - the targeted MicroUI GraphicsContextstring - a string of charactersfont - the MicroUI Font to usex - the left coordinatey - the top coordinatexRatio - the horizontal scaling ratio (1.0f meaning no scaling)yRatio - the vertical scaling ratio (1.0f meaning no scaling)default void drawScaledRenderableStringBilinear(MicroUIGraphicsContext gc, char[] string, MicroUIFont font, int charsWidth, MicroUIRenderableString renderableString, int x, int y, float xRatio, float yRatio)
gc - the targeted MicroUI GraphicsContextstring - a string of charactersfont - the MicroUI Font to usecharsWidth - the string widthrenderableString - the renderable stringx - the left coordinatey - the top coordinatexRatio - the horizontal scaling ratio (1.0f meaning no scaling)yRatio - the vertical scaling ratio (1.0f meaning no scaling)