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

add support for ttc font files#3912

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
luoq wants to merge4 commits intomatplotlib:masterfromluoq:ttc
Closed
Show file tree
Hide file tree
Changes fromall 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
2 changes: 1 addition & 1 deletion.travis.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,7 +24,7 @@ matrix:

install:
- pip install -q --use-mirrors nose python-dateutil $NUMPY pep8 pyparsing pillow
- sudo apt-get update && sudo apt-get -qq install inkscape libav-tools gdb
- sudo apt-get update && sudo apt-get -qq install inkscape libav-tools gdb ttf-wqy-zenhei
# We use --no-install-recommends to avoid pulling in additional large latex docs that we don't need
- if [[ $BUILD_DOCS == true ]]; then sudo apt-get install -qq --no-install-recommends dvipng texlive-latex-base texlive-latex-extra texlive-fonts-recommended graphviz; fi
- if [[ $BUILD_DOCS == true ]]; then pip install sphinx numpydoc linkchecker; fi
Expand Down
2 changes: 1 addition & 1 deletionlib/matplotlib/font_manager.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -156,7 +156,7 @@ def get_fontext_synonyms(fontext):
Return a list of file extensions extensions that are synonyms for
the given file extension *fileext*.
"""
return {'ttf': ('ttf', 'otf'),
return {'ttf': ('ttf', 'ttc', 'otf'),
'otf': ('ttf', 'otf'),
'afm': ('afm',)}[fontext]

Expand Down
11 changes: 11 additions & 0 deletionslib/matplotlib/tests/test_font_manager.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,3 +17,14 @@ def test_font_priority():
font = findfont(
FontProperties(family=["sans-serif"]))
assert_equal(os.path.basename(font), 'cmmi10.ttf')


def test_font_ttc():
# the font should be available(ttf-wqy-zenhei in ubuntu)
font = findfont(
FontProperties(family=["WenQuanYi Zen Hei"]))
assert_equal(os.path.basename(font), 'wqy-zenhei.ttc')

if __name__ == '__main__':
import nose
nose.runmodule(argv=['-s', '--with-doctest'], exit=False)

[8]ページ先頭

©2009-2025 Movatter.jp