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

Apply hinting factor rcParam in all cases.#9481

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

Merged
anntzer merged 3 commits intomatplotlib:masterfromQuLogic:fix-hinting-factor
Nov 4, 2017
Merged
Show file tree
Hide file tree
Changes from1 commit
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
NextNext commit
Apply hinting factor rcParam in all cases.
This is only explicitly used in Agg, so any other users get the defaultin the C++ code. Thus if you modify this setting and use some otherbackend, you get very weird behaviour. Positioning sometimes breaks andglyphs are shrunk or cropped.
  • Loading branch information
@QuLogic
QuLogic committedOct 19, 2017
commit0f4d99e723eaa253bba7c7b07cd4911152c77d1b
4 changes: 1 addition & 3 deletionslib/matplotlib/backends/backend_agg.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -267,9 +267,7 @@ def _get_agg_font(self, prop):
Get the font for text instance t, cacheing for efficiency
"""
fname = findfont(prop)
font = get_font(
fname,
hinting_factor=rcParams['text.hinting_factor'])
font = get_font(fname)

font.clear()
size = prop.get_size_in_points()
Expand Down
7 changes: 6 additions & 1 deletionlib/matplotlib/font_manager.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1366,7 +1366,12 @@ def is_opentype_cff_font(filename):
_fmcache = None


get_font = lru_cache(64)(ft2font.FT2Font)
_get_font = lru_cache(64)(ft2font.FT2Font)

def get_font(filename, hinting_factor=None):
if hinting_factor is None:
hinting_factor = rcParams['text.hinting_factor']
return _get_font(filename, hinting_factor)
Copy link
Member

Choose a reason for hiding this comment

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

Is not it equals to?

@lru_cache(64)defget_font(filename,hinting_factor=None):ifhinting_factorisNone:hinting_factor=rcParams['text.hinting_factor']returnft2font.FT2Font(filename,hinting_factor)

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

That would cachehinting_factor=None with whatever the value of the rcParam was at first call.



# The experimental fontconfig-based backend.
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp