Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions lib/matplotlib/tests/test_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -1317,3 +1317,8 @@
_test_complex_shaping(subfig[0])
_test_text_features(subfig[1])
_test_text_language(subfig[2])
def test_small_chinese_character_rendering():

Check warning on line 1320 in lib/matplotlib/tests/test_text.py

View workflow job for this annotation

GitHub Actions / ruff

[rdjson] reported by reviewdog 🐶 Expected 2 blank lines, found 0 Raw Output: message:"Expected 2 blank lines, found 0" location:{path:"/home/runner/work/matplotlib/matplotlib/lib/matplotlib/tests/test_text.py" range:{start:{line:1320 column:1} end:{line:1320 column:4}}} severity:WARNING source:{name:"ruff" url:"https://docs.astral.sh/ruff"} code:{value:"blank-lines-top-level" url:"https://docs.astral.sh/ruff/rules/blank-lines-top-level"} suggestions:{range:{start:{line:1320 column:1} end:{line:1320 column:1}} text:"\n\n"}
fig, ax = plt.subplots()
ax.text(0.5, 0.5, '字体', fontsize=6)
# Smoke test to ensure it renders without crashing
fig.canvas.draw()

Check warning on line 1324 in lib/matplotlib/tests/test_text.py

View workflow job for this annotation

GitHub Actions / ruff

[rdjson] reported by reviewdog 🐶 No newline at end of file Raw Output: message:"No newline at end of file" location:{path:"/home/runner/work/matplotlib/matplotlib/lib/matplotlib/tests/test_text.py" range:{start:{line:1324 column:22} end:{line:1324 column:22}}} severity:WARNING source:{name:"ruff" url:"https://docs.astral.sh/ruff"} code:{value:"missing-newline-at-end-of-file" url:"https://docs.astral.sh/ruff/rules/missing-newline-at-end-of-file"} suggestions:{range:{start:{line:1324 column:22} end:{line:1324 column:22}} text:"\n"}
3 changes: 2 additions & 1 deletion src/ft2font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,8 @@ bool FT2Font::load_char_with_fallback(FT2Font *&ft_object_with_glyph,

void FT2Font::load_glyph(FT_UInt glyph_index, FT_Int32 flags)
{
FT_CHECK(FT_Load_Glyph, face, glyph_index, flags);
// Force vector outlines by ignoring embedded bitmaps to fix small character rendering
FT_CHECK(FT_Load_Glyph, face, glyph_index, flags | FT_LOAD_NO_BITMAP);
FT_Glyph thisGlyph;
FT_CHECK(FT_Get_Glyph, face->glyph, &thisGlyph);
glyphs.push_back(thisGlyph);
Expand Down
Loading