Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Dealing (gracefully?) with problematic fonts #3903

Closed
@HubertHolin

Description

@HubertHolin

[Reposted from matplotlib-devel, as it seems it never got out, and updated]

The transition to MacOS X 10.10 (and more precisely 10.10.1) is proving quite problematic. One problem I am currently stuck with prevents me from using matplotlib.

Whether using matplotlib 1.4.2 and freetype 2.3.12 (combination A), matplotlib 59eda22 and freetype 2.5.3 (combination B), or matplotlib 543a222 and freetype 2.5.4 (combination C) importing matplotlib.pylab results in a crash. I have not tried other combinations…

In the case of combination A, the crash occurs because FT_Set_Char_Size (ft2font.cpp, line 909) returns an error because of the font “/System/Library/Fonts/Apple Color Emoji.ttf” and an uncaught exception is then thrown on line 916.

In the case of combination B and combination C, the crash occurs because FT_Set_Char_Size (ft2font.cpp, line 508) returns an error because of an unidentified font (I could not quickly find a way, in this version of the file, to access the name of the font being tested…) and an uncaught exception is then thrown on line 510.

As the font “/System/Library/Fonts/Apple Color Emoji.ttf” is a system font, and therefore off-limits to most users, it would be unadvisable to mess with it (including removing it from the system), and even though I would personally be quite unlikely to use it in conjunction with matplotlib, our Japanese colleagues might see things differently. At any rate, it does not seem to be corrupt (it may be complex, though, as TypeTool displays it differently from Font Book, which is hardly surprising as it is a color font…).

Note that in the case of combination C, removing the font “/System/Library/Fonts/Apple Color Emoji.ttf” still results in a crash, at the same place, but after a more lengthy processing, which likely implies that at least another (unidentified) font is problematic.

Barring a more sophisticated treatment of such fonts, could it be possible to catch the exception, just not take these fonts into account, and move on to the rest of the work? I have not grasped the organisation of the source that well to know where to propose a patch. Any hint welcome!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions