8000 Remove call to nonexistent FT2Font.get_fontsize. by anntzer · Pull Request #9806 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Remove call to nonexistent FT2Font.get_fontsize. #9806

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
Nov 21, 2017
Merged
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
17 changes: 4 additions & 13 deletions lib/matplotlib/font_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
- font variant is untested
- font stretch is incomplete
- font size is incomplete
- font size_adjust is incomplete
- default font algorithm needs improvement and testing
- setWeights function needs improvement
- 'light' is an invalid weight value, remove it.
Expand Down Expand Up @@ -469,14 +468,9 @@ def ttfFontProperty(font):
# Length value is an absolute font size, e.g., 12pt
# Percentage values are in 'em's. Most robust specification.

# !!!! Incomplete
if font.scalable:
size = 'scalable'
else:
size = str(float(font.get_fontsize()))

# !!!! Incomplete
size_adjust = None
if not font.scalable:
raise NotImplementedError("Non-scalable fonts are not supported")
size = 'scalable'

return FontEntry(font.fname, name, style, variant, weight, stretch, size)

Expand Down Expand Up @@ -538,9 +532,6 @@ def afmFontProperty(fontpath, font):

size = 'scalable'

# !!!! Incomplete
size_adjust = None

return FontEntry(fontpath, name, style, variant, weight, stretch, size)


Expand Down Expand Up @@ -592,7 +583,7 @@ def createFontList(fontfiles, fontext='ttf'):
continue
try:
prop = ttfFontProperty(font)
except (KeyError, RuntimeError, ValueError):
except (KeyError, RuntimeError, ValueError, NotImplementedError):
Copy link
Member

Choose a reason for hiding this comment

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

Maybe print to logging about it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We already silently drop a bunch of fonts that we don't know how to handle...

continue

fontlist.append(prop)
Expand Down
0