Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Deprecated afm, fontconfig_pattern, and type1font #22133

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 2 commits into from
Jan 17, 2022

Conversation

oscargus
Copy link
Member

@oscargus oscargus commented Jan 6, 2022

PR Summary

Related to #16181.

Will update with release notes once the tests pass (and I get a PR-number...)

PR Checklist

Tests and Styling

  • [N/A] Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • [N/A] New features are documented, with examples if plot related.
  • [N/A] New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).

@oscargus oscargus marked this pull request as draft January 6, 2022 17:20
@oscargus oscargus force-pushed the deprecate_type1font branch 3 times, most recently from 392b49d to 7ed5b69 Compare January 6, 2022 18:31
@oscargus oscargus changed the title Deprecated type1font Deprecated afm, fontconfig_pattern, and type1font Jan 6, 2022
@oscargus
Copy link
Member Author

oscargus commented Jan 6, 2022

How should one deal with these issues:

/home/circleci/project/lib/matplotlib/font_manager.py:docstring of matplotlib.font_manager.afmFontProperty:8: WARNING: py:obj reference target not found: AFM
/home/circleci/project/doc/api/next_api_changes/behavior/20715-JKS.rst:4: WARNING: py:obj reference target not found: type1font.Type1Font.prop
/home/circleci/project/doc/api/next_api_changes/behavior/20715-JKS.rst:4: WARNING: py:obj reference target not found: type1font.Type1Font.transform
/home/circleci/project/doc/api/prev_api_changes/api_changes_0.91.0.rst:39: WARNING: py:class reference target not found: AFM
/home/circleci/project/doc/api/prev_api_changes/api_changes_0.98.x.rst:66: WARNING: py:meth reference target not found: matplotlib.afm.AFM.get_fullname
/home/circleci/project/doc/api/prev_api_changes/api_changes_0.98.x.rst:66: WARNING: py:meth reference target not found: matplotlib.afm.AFM.get_familyname
api/prev_api_changes/api_changes_3.5.0/behaviour.rst:230: WARNING: py:obj reference target not found: type1font.Type1Font

Should one change the previous links to point to the new one? Reformat them to not be a link? Import the required classes/functions explicitly in the to-be-removed file?

Especially: there is a PR #20715 that changes the now deprecated methods/classes. Should this be dealt with in a special way? Since it is now deprecated/private.

@oscargus oscargus force-pushed the deprecate_type1font branch from 7ed5b69 to 045121b Compare January 6, 2022 19:26
@timhoffm
Copy link
Member

timhoffm commented Jan 6, 2022

Please change the links in API changes to code literals using fully qualified names, e.g.

`~.type1font.Type1Font`

to

``matplotlib.type1font.Type1Font``

The API changes are historic documents for that point in time and we should not change their meaning. We can't reference with links in the current docs so the best option is literals. This is also true for the unreleased next_api_changes.

Concerning the first one, change `.AFM` to plain text for now. We currently don't build the docs for the new private modules. - I still have to decide if we want that. There are pros and cons for building docs for private parts. Anyway, for now there is nothing to link to. It might well be that font_manager.afmFontProperty() will become private as well. At least, it requires AFM as input, which is now private. But I have to have a closer look at this.

@oscargus
Copy link
Member Author

oscargus commented Jan 7, 2022

It might well be that font_manager.afmFontProperty() will become private as well.

It is only used (in the matplotlib codebase) in FontManager.addfont(), so would probably make sense. Let me know and I can do it here.

For consistency, one may also consider making ttfFontProperty private. However, that is directly used in both the cairo and svg backends, so may indicate that it maybe should stay.

@oscargus oscargus force-pushed the deprecate_type1font branch 2 times, most recently from 08c4ed7 to fd6b5b9 Compare January 7, 2022 18:18
@oscargus oscargus marked this pull request as ready for review January 7, 2022 19:44
@tacaswell tacaswell added this to the v3.6.0 milestone Jan 7, 2022
Copy link
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

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

Please switch to the two-commit solution as described in #22134 (review) to preserve history here as well.

@oscargus oscargus force-pushed the deprecate_type1font branch from fd6b5b9 to 406cd41 Compare January 8, 2022 11:12
@oscargus oscargus force-pushed the deprecate_type1font branch from 406cd41 to 1885e46 Compare January 16, 2022 22:39
@oscargus
Copy link
Member Author

Imports are slightly improved here as well.

@jklymak jklymak merged commit 76012ae into matplotlib:main Jan 17, 2022
@oscargus oscargus deleted the deprecate_type1font branch January 17, 2022 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants