0

please,
is it possible to print out every style that each of the listed typefaces has? So I know that for example Arial has Bold, Regular, Italic and whatever else. Thanks! Or would you recommend some other tool for doing this? I am on Windows 7.

import matplotlib.font_manager
#help(matplotlib.font_manager)
fonts = [f.name for f in matplotlib.font_manager.fontManager.ttflist]
print(len(fonts))
for i in fonts:
    print(i)

1 Answer 1

1

Yes.

The get_style() and get_variant() methods let you explore some of the font space.

You may want to iterate over several possibilities, calling score_style() to determine if a style is available. Or just iterate and look at the result of findfont(), letting it work out which styles are locally available. If you post your iterating code along with its results, we may be able to offer additional font hints.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.