This is about Flutter, Dart, Image, specifically drawString function.
First of all, what I am trying to do is watermark the picture taken with the text (product name). I mean not just placing text over the image but actually merge it with picture so that the user can submit the picture and share it while sharing the product.
To do so. I found the right function drawString(), but the problem is it only supports arial48, arial24 and arial14 font sizes. Since I have to write the product name in custom fontsize which I'm extracting by calculating the width and height of the original image. Is there any one who tried this before or any who can make it possible. Anyone who knows?
I've tried this.
import 'package:image/image.dart' as img;
img.drawString(originalImage,'$myProductName($pictureTag)',
x: value,
y: value,
color: img.ColorFloat32.rgb(255,255,255), font: img.arial48,
);
But I need to use custom font size instead of these predefined sizes.
I'm using flutter: 3.19.0 version. and image: ^4.1.7