textToBitmap

open fun textToBitmap(@NonNull text: String, @NonNull font: Font, @ColorInt color: Int, @FloatRange(from = 0) scaleFactor: Float, @NonNull displayMetrics: DisplayMetrics): Bitmap

Creates a bitmap from text that the user typed and a font the user chose.

Return

a bitmap from text that the user typed and a font the user chose.

Parameters

text

The text to be displayed.

font

The font to use to show the text.

color

The color to render the text.

scaleFactor

A factor, always positive, by which to scale the bitmap size.

displayMetrics

DisplayMetrics instance.