Skip to content

Deprecate some FT2Image methods. #14906

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 10, 2019
Merged

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Jul 28, 2019

FT2Image is a class in ft2font that's basically a numpy array (... but
predates Matplotlib's use of numpy...). We can't completely remove it
yet because that requires adapating some methods implemented in C to
take a numpy array (technically, a Python buffer) rather than an
FT2Image, but we can start by deprecating some methods which should not
be specific to FT2Image, but just be normal operators working on
ndarrays.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@QuLogic QuLogic added this to the v3.2.0 milestone Aug 2, 2019
@@ -249,7 +249,7 @@ def get_label_width(self, lev, fmt, fsize):
self._mathtext_parser = mathtext.MathTextParser('bitmap')
img, _ = self._mathtext_parser.parse(lev, dpi=72,
prop=self.labelFontProps)
lw = img.get_width() # at dpi=72, the units are PostScript points
lw, _ = np.shape(img) # at dpi=72, the units are PostScript points
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't really follow the image definition, but are you sure the width is the number of rows (not columns)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, fixed

FT2Image is a class in ft2font that's basically a numpy array (... but
predates Matplotlib's use of numpy...).  We can't completely remove it
yet because that requires adapating some methods implemented in C to
take a numpy array (technically, a Python buffer) rather than an
FT2Image, but we can start by deprecating some methods which should not
be specific to FT2Image, but just be normal operators working on
ndarrays.
@timhoffm timhoffm merged commit 05c9fb5 into matplotlib:master Aug 10, 2019
@anntzer anntzer deleted the ft2image branch August 10, 2019 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants