How to customize font in Java Method Imgproc.putText

Hello, I’m using the version 4.5.0 of OpenCV Java library now. Also, I’m using the method Imgproc.putText to create text on the image. But it seems this method only allow predefined fonts, what I need to do to allow customized fonts?

putText uses very simple built-in fonts.

if you want to specify a “regular” font (e.g. truetype), you will need to use the freetype module from opencv_contrib. that requires the freetype and harfbuzz libraries (not related to OpenCV).

I don’t know if the java bindings will include this API. another thread discusses this issue.