Wrong size when creating a text layer with a size in points
GIMP version: 2.10.12
Operating System: Linux
Package: flatpak
Description of the bug
In the python-fu console:
Make sure the image is at 72PPI
>>> image=gimp.image_list()[0]
>>> pdb.gimp_image_set_resolution(image, 72.,72.)
>>> pdb.gimp_image_get_resolution(image)
(72.0, 72.0)
At 72PPI, since there are 72 points in a inch, a point and a pixel should be equiavalent
Create a text layer with a size in pixels
>>> layer = pdb.gimp_text_layer_new(image,'ABC','Sans',100.,0)
>>> layer.height
117
117 pixels for a 100px font is OK, because the layer height includes line spacing
Create a text layer with a size in points
>>> layer = pdb.gimp_text_layer_new(image,'ABC','Sans',100.,1)
>>> layer.height
8383
The size is not the same at all. If we divide this size by 72, we get close to the size in pixels, which is also the size in points (116.43). So in all likelihood the size we passed was understood as inches and not as points.
Problem is not dependent on font.
Reproduction
Is the bug reproducible? Always
Additional information
In case it matters, on my system:
- Pango is 1.38.1
- Cairo is 1.14.6
See also this problem on StackOverflow which could indicate that the problem is platform dependent.