Skip to content

Remove "experimental" fontconfig font_manager backend. #10933

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
Oct 25, 2018

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Apr 1, 2018

The "experimental" fontconfig backend for font_manager was never
publicly accessible: even if one does
matplotlib.font_manager.USE_FONTCONFIG = True, that didn't change the
already existing findfont. The only way to access it was to edit the
source, or use reload(), neither of which really count as public
API...

Note that our "use" of "fontconfig-like" patterns actually has subtly
different semantics from actual fontconfig patterns, so it's not as if
that backend was correctly working anyways. (per #10249)

We don't need to set fontManager.default_size when loading it as
we already check that fontManager has the correct __version__
(and thus must have a correct default_size; moreover the only
use of default_size is in sizeval1 = self.default_size * font_scalings[size1] so it's not as if a value of None (if it had
somehow been missing) was going to be helpful anyways...

get_cachedir() always returns a real directory (creating a temporary
one if necessary), so we can drop the code paths handling
get_cachedir() == None.

Note that we still rely on fontconfig to list fonts; the backend only
added an (non-publicly-accessible, per above) option to match fonts
using fontconfig.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 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

@tacaswell tacaswell added this to the v3.0 milestone Apr 1, 2018
@anntzer anntzer force-pushed the font_manager-fontconfig branch from 03bf3e6 to bcba233 Compare April 12, 2018 22:24
@anntzer
Copy link
Contributor Author

anntzer commented May 2, 2018

rebased

@anntzer anntzer force-pushed the font_manager-fontconfig branch from bcba233 to 9c3c386 Compare May 2, 2018 22:58
@QuLogic
Copy link
Member

QuLogic commented Jun 24, 2018

Fedora used to enable this when unbundling fonts, but the guidelines were relaxed a bit and it was not possible to even do so with 1.4.2+. So while the build instructions still exist, they've been disabled since then.

@tacaswell tacaswell modified the milestones: v3.0, v3.1 Jul 7, 2018
@anntzer anntzer force-pushed the font_manager-fontconfig branch 2 times, most recently from ce1ec7a to 54161f1 Compare July 16, 2018 09:39
@anntzer anntzer force-pushed the font_manager-fontconfig branch from 54161f1 to a815ea0 Compare August 19, 2018 19:37
@anntzer anntzer force-pushed the font_manager-fontconfig branch from a815ea0 to a955cbb Compare October 5, 2018 13:21
The "experimental" fontconfig backend for font_manager was never
publicly accessible: even if one does
`matplotlib.font_manager.USE_FONTCONFIG = True`, that didn't change the
already existing `findfont`.  The only way to access it was to edit the
source, or use `reload()`, neither of which really count as public
API...

Note that our "use" of "fontconfig-like" patterns actually has subtly
different semantics from actual fontconfig patterns, so it's not as if
that backend was correctly working anyways.

We don't need to set `fontManager.default_size` when loading it as
we already check that fontManager has the correct `__version__`
(and thus must have a correct `default_size`; moreover the only
use of `default_size` is in `sizeval1 = self.default_size *
font_scalings[size1]` so it's not as if a value of `None` (if it had
somehow been missing) was going to be helpful anyways...

`get_cachedir()` always returns a real directory (creating a temporary
one if necessary), so we can drop the code paths handling
`get_cachedir() == None`.

Note that we still rely on fontconfig to *list* fonts; the backend only
added an (non-publicly-accessible, per above) option to *match* fonts
using fontconfig.
@anntzer
Copy link
Contributor Author

anntzer commented Oct 25, 2018

@jklymak @timhoffm Can either of you merge this? Thanks.

@jklymak jklymak merged commit e4ba4f2 into matplotlib:master Oct 25, 2018
@jklymak
Copy link
Member

jklymak commented Oct 25, 2018

Thanks for the ping

@anntzer anntzer deleted the font_manager-fontconfig branch October 25, 2018 19:50
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.

5 participants