TypefaceEmojiRasterizer


@AnyThread
class TypefaceEmojiRasterizer


Information about a single emoji. To draw this emoji on a canvas using use draw. To draw this emoji using custom code, use getCodepointAt and getTypeface to access the underlying emoji font and look up the glyph.

Summary

Public functions

Unit
draw(canvas: Canvas, x: Float, y: Float, paint: Paint)

Draws the emoji onto a canvas with origin at (x,y), using the specified paint.

Int
Int
Int
Typeface
Int
Boolean
Boolean

If the platform requested that this emoji not be rendered using emojicompat.

String

Public functions

draw

Added in 1.3.0
fun draw(canvas: Canvas, x: Float, y: Float, paint: Paint): Unit

Draws the emoji onto a canvas with origin at (x,y), using the specified paint.

Parameters
canvas: Canvas

Canvas to be drawn

x: Float

x-coordinate of the origin of the emoji being drawn

y: Float

y-coordinate of the baseline of the emoji being drawn

paint: Paint

Paint used for the text (e.g. color, size, style)

getCodepointAt

Added in 1.3.0
fun getCodepointAt(index: Int): Int
Parameters
index: Int

index of the codepoint

Returns
Int

the codepoint at index

getCodepointsLength

Added in 1.3.0
fun getCodepointsLength(): Int
Returns
Int

the length of the codepoints for this emoji

getHeight

Added in 1.3.0
fun getHeight(): Int
Returns
Int

height of the emoji image

getTypeface

Added in 1.3.0
fun getTypeface(): Typeface
Returns
Typeface

return typeface to be used to render

getWidth

Added in 1.3.0
fun getWidth(): Int
Returns
Int

width of the emoji image

isDefaultEmoji

Added in 1.3.0
fun isDefaultEmoji(): Boolean
Returns
Boolean

whether the emoji is in Emoji Presentation by default (without emoji style selector 0xFE0F)

isPreferredSystemRender

Added in 1.3.0
fun isPreferredSystemRender(): Boolean

If the platform requested that this emoji not be rendered using emojicompat.

Returns
Boolean

true if this emoji should be drawn by the system instead of this renderer

toString

fun toString(): String