-1
The method getoffset()
class PIL.ImageFont.FreeTypeFont
returns a tuple. What exactly are these measurements?
I use the Pillow in the version 6.1.0.
-1
The method getoffset()
class PIL.ImageFont.FreeTypeFont
returns a tuple. What exactly are these measurements?
I use the Pillow in the version 6.1.0.
0
"offset" means "offset" -
The method .getoffset
of objects of type "Font" inside the module ImageFont
requires a text string - and returns the position, in pixels, from which it would begin to draw text if that text were to be drawn in an image.
For almost all strings the return is "0.0" - if you are not creating a typesetting script, and using very strange special characters, you will not find any case where the return of .getoffset
will be different from 0.0 -
and, anyway, it is designed to be used internally by the functions that will actually draw the text in the images (using, in general, the method text
of an object ImageDraw.Draw
- you pass the source as parameter to it, and, the internal use of this method is that you will use .getoffset
, .getmask
, etc... at the source).
In short:
Thank you very much, jsbueno!
Browser other questions tagged python image-processing
You are not signed in. Login or sign up in order to post.
What version of Pillow you refer to?
– Woss
He came to see in documentation?
– fernandosavio
@fernandosavio This is not class
PIL.ImageFont.FreeTypeFont
?– Woss
Yep, this documentation made me more confused than deaf in bingo... Ignore my previous comment..
– fernandosavio
Look I do not know, Pillow, but for me such values concern the coordinates x,y in the Cartesian plane of the object in question.
– Vinicius Dutra
Yes, I went to the forum because I also found the documentation very confusing. I refer to version 6.1.0.
– Sérgio Renhe
Anderson, yes class is PIL.ImageFont.Freetypefont. Thanks for the fix, I will edit.
– Sérgio Renhe