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

Appearance settings

[MNT]: Add more tests for FT2Font.load_char #27115

Copy link
Copy link
Open
@story645

Description

@story645
Issue body actions

Summary

In #26989 I could remove the lines warning that a glyph was missing without breaking any tests:

matplotlib/src/ft2font.cpp

Lines 582 to 585 in 112a225

bool was_found = load_char_with_fallback(ft_object_with_glyph, final_glyph_index, glyphs, char_to_font,
glyph_to_font, charcode, flags, charcode_error, glyph_error, true);
if (!was_found) {
ft_glyph_warn(charcode);

matplotlib/src/ft2font.cpp

Lines 594 to 596 in 112a225

} else {
ft_object = this;
FT_UInt glyph_index = ft_get_char_index_or_warn(face, (FT_ULong)charcode);

I didn't remove the warnings cause I don't think we test what Ft2Font.load_char does when given a missing glyph. It's used in three places in the library:

Proposed fix

Minimally, there should be at least two tests of how load_char /the methods calling it handle missing glyphs - mathtext may be a good start. There should be one test for each codepath that triggers a missing glyph error. It would probably also be good to add some more tests for TextPath -> it mostly seems to be tested via gallery examples.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.