Skip to content

Fix rendering bug for small Chinese characters by adding FT_LOAD_NO_B…#32072

Open
mohit-sharma-001 wants to merge 3 commits into
matplotlib:mainfrom
mohit-sharma-001:main
Open

Fix rendering bug for small Chinese characters by adding FT_LOAD_NO_B…#32072
mohit-sharma-001 wants to merge 3 commits into
matplotlib:mainfrom
mohit-sharma-001:main

Conversation

@mohit-sharma-001

@mohit-sharma-001 mohit-sharma-001 commented Jul 19, 2026

Copy link
Copy Markdown

PR summary

  • Why is this change necessary? / What problem does it solve?
    Fixes a rendering issue where small Chinese characters were loaded as pixelated embedded bitmaps instead of smooth vector outlines.
  • What is the reasoning for this implementation?
    Adding the FT_LOAD_NO_BITMAP flag to FT_Load_Glyph forces the FreeType engine to ignore embedded bitmaps and use vector outlines, ensuring high-quality rendering at small font sizes.
  • Closes [Bug]: Font fallback bugs #32063

AI Disclosure

Yes, generative AI was used to assist in troubleshooting the FreeType flag and setting up the local build environment.

PR checklist

  • "closes [Bug]: Font fallback bugs #32063" is in the body of the PR description to link the related issue
  • new and changed code is tested
  • [N/A] Plotting related features are demonstrated in an example
  • [N/A] New Features and API Changes are noted with a directive and release note
  • Documentation complies with general and docstring guidelines

@github-actions

Copy link
Copy Markdown

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks. We also ask that you please finish addressing any review comments on this PR and wait for it to be merged (or closed) before opening a new one, as it can be a valuable learning experience to go through the review process.

You can also join us on discourse chat for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide.
Please let us know if (and how) you use AI, it will help us give you better feedback on your PR.

We strive to be a welcoming and open project. Please follow our Code of Conduct.

@scottshambaugh

scottshambaugh commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Thanks for the PR. Please add a test, change the language of your comment to English, and update your PR description to use our PR template.

@mohit-sharma-001

Copy link
Copy Markdown
Author

Thanks for the PR. Please add a test, change the language of your comment to English, and update your PR description to use our PR template.

@scottshambaugh
I have updated the PR description using the template, changed the code comment to English, and added a test for small character rendering. Please let me know if any further changes are needed. Thank you!

@scottshambaugh

scottshambaugh commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Please iterate on your code until the automated checks pass. There seems to be real linting (formatting) and test failures on your newly added test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Font fallback bugs

2 participants