Skip to content

Graph output does not handle Unicode on Windows #2639

Description

@cjee21

Graph output currently does not render non-ASCII text on Windows unlike on Linux. On Windows, the default font selection of Graphviz/Pango/Cairo does not fallback to other fonts when the default font does not have the required character and just renders a 'tofu' instead.

One solution is to add the following before call to gvContext();

#ifdef _WIN32
    // Make PangoCairo use FontConfig so that non-ASCII text can fallback to other fonts and render properly on Windows
    SetEnvironmentVariableW(L"PANGOCAIRO_BACKEND", L"fc");
#endif // _WIN32

However, this causes one line to be printed to stderr:

Fontconfig error: Cannot load default config file: No such file: (null)

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