Thursday, 3 March 2022

Programmatically produce image with custom text

How can I programmatically produce an image containing custom text (in Kotlin)?

The following picture is an example:

enter image description here

All text here should be editable programmatically - In other words, I'd like a programmatically editable template that can be saved as an image.

I'd also like to be able to set the width of the image (while maintaining quality and aspect ratio).

I explored many answers to similar questions on SO but they are outdated/deprecated or are not elegant enough, so please do not mark this question as duplicate. I'm open to using libraries from GitHub.

I tried drawing my text to a Bitmap-backed Canvas, but the text's position slightly differs depending on the device, which is not good.



from Programmatically produce image with custom text

No comments:

Post a Comment