5

I come across this Does Im4Java support adding text to images while specifying font, font-size, and color?

Does im4j places the text as per the resolution of the image? Ex: 16 pts of a font is smaller in high resolution where as it is big in low resolution. If i want to set the size of the font according to the resolution, will Img4 is able to do it. ex:16 pt given should be converted as per the resolution. also font height would differ from font to font.

Thanks

testjava dev
  • 145
  • 5

1 Answers1

2

In im4java documentation for pointsize (which specify the font size) they point you to (see the documentation of GraphicsMagick for details), which states:

The pixel units may be converted to points (the standard resolution-independent measure used by the typesetting industry) via the following equation:

size_points = (size_pixels * 72)/resolution

where resolution is in dots-per-inch (DPI). This means that at the default image resolution, there is one pixel per point.

user16930239
  • 6,319
  • 2
  • 9
  • 33