Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Rely on OS-level tools for building the font cache #10932

Open
Labels
keepItems to be ignored by the “Stale” Github Actiontopic: text/fonts
@anntzer

Description

@anntzer

The root issue of#10201 appears to be that in some OSX systems, /FontCollections is included in the font paths searched by the system, but not listed in the hardcoded paths in font_manager.py. While this could be fixed in a piecemeal fashion, I would like to propose instead to strictly rely on OS-level tools to list fonts instead.

This means:

  • on Linux,fc-list --format='%{file}\n'
  • on OSX,system_profiler SPFontsDataType (whose output can trivially be parsed by the stdlib plistlib module) (and fc-list too, if it is present).

On Linux, Xorg relies on fontconfig for font selection since at least X11R6.9 (2005;https://www.x.org/archive/X11R6.9.0/doc/html/fonts2.html#3 -- oldest doc on x.org). On OSX, system_profiler appears to be available since at least OSX 10.0 (2001;https://en.wikipedia.org/wiki/System_Information_(Mac)).

On Windows, we are already reading the fonts and font paths from the registry, which appears to be the "correct" place where the info is stored (https://msdn.microsoft.com/en-us/library/windows/desktop/dd144833(v=vs.85).aspx).

This means that on (rare) systems where fontconfig is not present, we'll only find the fonts shipped with Matplotlib (dejavu, etc.). To work around this, we can allow the user to runpython -mmatplotlib.font_manager recache --add-font-path foo --add-font-path bar, with the expected effect (in fact there's already the (undocumented)TTFPATH andAFMPATH environment variables which have the same effect).

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    keepItems to be ignored by the “Stale” Github Actiontopic: text/fonts

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp