Fix return value of FreeTypeFont.textsize() does not include font offsets #784

Merged
merged 1 commit into from Jul 8, 2014

Conversation

Projects
None yet
4 participants
@tk0miya
Contributor

tk0miya commented Jul 7, 2014

Fixes #644

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Jul 7, 2014

Coverage Status

Coverage increased (+0.0%) when pulling 60628c7 on tk0miya:master into 6c0fcef on python-pillow:master.

Coverage Status

Coverage increased (+0.0%) when pulling 60628c7 on tk0miya:master into 6c0fcef on python-pillow:master.

@wiredfool

This comment has been minimized.

Show comment
Hide comment
@wiredfool

wiredfool Jul 7, 2014

Member

This is going to change the rendering for anyone who's got code that uses textsize. We should be very reluctant to break peoples code like that, especially since it's a silent break that changes the behavior.

Member

wiredfool commented Jul 7, 2014

This is going to change the rendering for anyone who's got code that uses textsize. We should be very reluctant to break peoples code like that, especially since it's a silent break that changes the behavior.

@aclark4life

This comment has been minimized.

Show comment
Hide comment
@aclark4life

aclark4life Jul 7, 2014

Member

True, I would deprecate in the next release & fix in the next next release. So this PR should add a deprecation warning… and nothing else. Maybe.

Member

aclark4life commented Jul 7, 2014

True, I would deprecate in the next release & fix in the next next release. So this PR should add a deprecation warning… and nothing else. Maybe.

@wiredfool

This comment has been minimized.

Show comment
Hide comment
@wiredfool

wiredfool Jul 7, 2014

Member

Perhaps getBoundingBox as a new api?

We should also be thinking about incorporating some of the metrics in a decent api, so that people can place the text accurately. That had come up in an issue or two before. (a: size is lost once youmake the font, and b: metrics are very ill defined from the various methods).

Member

wiredfool commented Jul 7, 2014

Perhaps getBoundingBox as a new api?

We should also be thinking about incorporating some of the metrics in a decent api, so that people can place the text accurately. That had come up in an issue or two before. (a: size is lost once youmake the font, and b: metrics are very ill defined from the various methods).

@tk0miya

This comment has been minimized.

Show comment
Hide comment
@tk0miya

tk0miya Jul 8, 2014

Contributor

In PIL-1.1.7 and Pillow-2.1.0, ImageDraw#textsize() and ImageFont.textsize() return size of bounding box for text.
but after Pillow-2.2.0, these methods return size of text (without offset).

This change came from #185 and #333.
but it seems that these pull requests do not attempt to change behavior of the methods.

So I think this is a bug fix, not a breaking change.

of course, decent APIs are welcome.
I want standard method for getting bounding box to all ImageFont subclasses.

Contributor

tk0miya commented Jul 8, 2014

In PIL-1.1.7 and Pillow-2.1.0, ImageDraw#textsize() and ImageFont.textsize() return size of bounding box for text.
but after Pillow-2.2.0, these methods return size of text (without offset).

This change came from #185 and #333.
but it seems that these pull requests do not attempt to change behavior of the methods.

So I think this is a bug fix, not a breaking change.

of course, decent APIs are welcome.
I want standard method for getting bounding box to all ImageFont subclasses.

aclark4life added a commit that referenced this pull request Jul 8, 2014

Merge pull request #784 from tk0miya/master
Fix return value of FreeTypeFont.textsize() does not include font offsets

@aclark4life aclark4life merged commit 962f1b4 into python-pillow:master Jul 8, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
@aclark4life

This comment has been minimized.

Show comment
Hide comment
@aclark4life

aclark4life Jul 8, 2014

Member

Thanks

Member

aclark4life commented Jul 8, 2014

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment