Skip to content

Backport PR #10431 on branch v2.2.x #10472

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
Feb 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
28 changes: 22 additions & 6 deletions lib/matplotlib/font_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,18 @@ def __repr__(self):

def ttfFontProperty(font):
"""
A function for populating the :class:`FontKey` by extracting
information from the TrueType font file.
Extract information from a TrueType font file.

Parameters
----------
font : `.FT2Font`
The TrueType font file from which information will be extracted.

Returns
-------
`FontEntry`
The extracted font properties.

*font* is a :class:`FT2Font` instance.
"""
name = font.family_name

Expand Down Expand Up @@ -474,10 +482,18 @@ def ttfFontProperty(font):

def afmFontProperty(fontpath, font):
"""
A function for populating a :class:`FontKey` instance by
extracting information from the AFM font file.
Extract information from an AFM font file.

Parameters
----------
font : `.AFM`
The AFM font file from which information will be extracted.

Returns
-------
`FontEntry`
The extracted font properties.

*font* is a class:`AFM` instance.
"""

name = font.get_familyname()
Expand Down
13 changes: 7 additions & 6 deletions lib/matplotlib/type1font.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,15 @@ class Type1Font(object):
"""
A class representing a Type-1 font, for use by backends.

.. attribute:: parts
Attributes
----------
parts : tuple
A 3-tuple of the cleartext part, the encrypted part, and the finale of
zeros.

A 3-tuple of the cleartext part, the encrypted part, and the
finale of zeros.
prop : Dict[str, Any]
A dictionary of font properties.

.. attribute:: prop

A dictionary of font properties.
"""
__slots__ = ('parts', 'prop')

Expand Down