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

Improve font weight guessing.#14483

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
QuLogic merged 1 commit intomatplotlib:masterfromanntzer:timesnewroman
Jun 8, 2019

Conversation

anntzer
Copy link
Contributor

Previously, we would guess that "Times New Roman Bold" is a regular
weight font because its name contains the substring "Roman", even though
the font correctly sets the BOLD flag (FT_STYLE_FLAG_BOLD). Invert the
logic to give priority to the flag, as its presence is clearly more
robust than a substring check.

s.find(w) >= 0 is just an obfuscated way to writew in s, so change
that.

Obviously font properties extraction could be improved in a lot of ways, but this shouldclose#5574.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code isFlake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@dstansby
Copy link
Member

Should probably get a short API change note.

Previously, we would guess that "Times New Roman Bold" is a regularweight font because its name contains the substring "Roman", even thoughthe font correctly sets the BOLD flag (FT_STYLE_FLAG_BOLD).  Invert thelogic to give priority to the flag, as its presence is clearly morerobust than a substring check.`s.find(w) >= 0` is just an obfuscated way to write `w in s`, so changethat.
@anntzer
Copy link
ContributorAuthor

sure, done

@dstansbydstansby added this to thev3.2.0 milestoneJun 7, 2019
@QuLogicQuLogic merged commit0e53685 intomatplotlib:masterJun 8, 2019
@anntzeranntzer deleted the timesnewroman branchJune 8, 2019 08:56
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic approved these changes

@dstansbydstansbydstansby approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.2.0
Development

Successfully merging this pull request may close these issues.

Incorrect selection of Times New Roman Bold
3 participants
@anntzer@dstansby@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp