8000 Mrg animation merge by tacaswell · Pull Request #7622 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Mrg animation merge #7622

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 29 commits into from
Dec 13, 2016
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
80d8dd8
DOC: partially numpydoc-ify animation module
tacaswell Dec 7, 2016
24c7aad
DOC: use auto summary in animation_api.rst
tacaswell Dec 8, 2016
e465fb7
DOC: start to add animation prose
tacaswell Dec 8, 2016
ff1e71e
DOC: address comments
tacaswell Dec 11, 2016
55017cd
DOC: re-work MovieWriter section a bit
tacaswell Dec 11, 2016
437386b
MNT: tweak MovieWriter.saving to be more cautious
tacaswell Dec 11, 2016
1a6c61c
DOC: address the rest of the comments
tacaswell Dec 11, 2016
8e8291c
DOC: Fix more typos and minor errors
tacaswell Dec 11, 2016
e3de3be
BUG: fix minpos handling and other log ticker problems
efiring Dec 9, 2016
8bdabcd
refactor LogFormatter classes for consistency, readability
efiring Dec 10, 2016
a8e7575
api_changes: add note about LogFormatter linthresh kwarg.
efiring Dec 10, 2016
aa36ec3
test for shared log axes
efiring Dec 10, 2016
93d09be
Merge pull request #7596 from anntzer/delay-fc-list-warning
QuLogic Dec 12, 2016
1a21bea
Merge pull request #7618 from samuelstjean/patch-1
tacaswell Dec 12, 2016
4c4779b
DOC: minor tweaks
tacaswell Dec 12, 2016
4177725
Merge pull request #7589 from tacaswell/doc_animation
dopplershift Dec 12, 2016
4d59447
Merge pull request #7598 from efiring/minpos_initial
tacaswell Dec 12, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
STY: some whitespace cleanups
  • Loading branch information
tacaswell committed Dec 12, 2016
commit 98e9fb20623645ae414e875bc8ce4c88ce16eb57
24 changes: 16 additions & 8 deletions lib/matplotlib/font_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,13 @@
MSFolders = \
r'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders'

MSFontDirectories = [

MSFontDirectories = [
r'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts',
r'SOFTWARE\Microsoft\Windows\CurrentVersion\Fonts']

X11FontDirectories = [

X11FontDirectories = [
# an old standard installation point
"/usr/X11R6/lib/X11/fonts/TTF/",
"/usr/X11/lib/X11/fonts",
Expand Down Expand Up @@ -156,6 +158,7 @@
path = os.path.join(home, '.fonts')
X11FontDirectories.append(path)


def get_fontext_synonyms(fontext):
"""
Return a list of file extensions extensions that are synonyms for
Expand All @@ -165,6 +168,7 @@ def get_fontext_synonyms(fontext):
'otf': ('ttf', 'otf'),
'afm': ('afm',)}[fontext]


def list_fonts(directory, extensions):
"""
Return a list of all fonts matching any of the extensions,
Expand All @@ -174,6 +178,7 @@ def list_fonts(directory, extensions):
for ext in extensions])
return cbook.listFiles(directory, pattern)


def win32FontDirectory():
"""
Return the user-specified font directory for Win32. This is
Expand All @@ -186,21 +191,22 @@ def win32FontDirectory():
try:
from six.moves import winreg
except ImportError:
pass # Fall through to default
pass # Fall through to default
else:
try:
user = winreg.OpenKey(winreg.HKEY_CURRENT_USER, MSFolders)
try:
try:
return winreg.QueryValueEx(user, 'Fonts')[0]
except OSError:
pass # Fall through to default
pass # Fall through to default
finally:
winreg.CloseKey(user)
except OSError:
pass # Fall through to default
pass # Fall through to default
return os.path.join(os.environ['WINDIR'], 'Fonts')


def win32InstalledFonts(directory=None, fontext='ttf'):
"""
Search for fonts in the specified font directory, or use the
Expand Down Expand Up @@ -246,6 +252,7 @@ def win32InstalledFonts(directory=None, fontext='ttf'):
winreg.CloseKey(local)
return None


def OSXInstalledFonts(directories=None, fontext='ttf'):
"""
Get list of font files on OS X - ignores font suffix by default.
Expand Down Expand Up @@ -297,6 +304,7 @@ def get_fontconfig_fonts(fontext='ttf'):
if os.path.splitext(fname)[1][1:] in fontext]



def findSystemFonts(fontpaths=None, fontext='ttf'):
"""
Search for fonts in the specified font paths. If no paths are
Expand Down Expand Up @@ -338,6 +346,7 @@ def findSystemFonts(fontpaths=None, fontext='ttf'):

return [fname for fname in fontfiles if os.path.exists(fname)]


def weight_as_number(weight):
"""
Return the weight property as a numeric value. String values
Expand Down Expand Up @@ -419,7 +428,6 @@ def ttfFontProperty(font):
else:
style = 'normal'


# Variants are: small-caps and normal (default)

# !!!! Untested
Expand Down Expand Up @@ -451,8 +459,8 @@ def ttfFontProperty(font):
# Relative stretches are: wider, narrower
# Child value is: inherit

if sfnt4.find('narrow') >= 0 or sfnt4.find('condensed') >= 0 or \
sfnt4.find('cond') >= 0:
if (sfnt4.find('narrow') >= 0 or sfnt4.find('condensed') >= 0 or
sfnt4.find('cond') >= 0):
stretch = 'condensed'
elif sfnt4.find('demi cond') >= 0:
stretch = 'semi-condensed'
Expand Down
0