diff --git a/src/os/unix/font_unix.cpp b/src/os/unix/font_unix.cpp index 548fd410cc..6ab1d99823 100644 --- a/src/os/unix/font_unix.cpp +++ b/src/os/unix/font_unix.cpp @@ -55,8 +55,9 @@ FT_Error GetFontByFaceName(const char *font_name, FT_Face *face) auto [font_family, font_style] = SplitFontFamilyAndStyle(font_name); /* Resolve the name and populate the information structure */ - FcPattern *pat = FcNameParse((FcChar8 *)font_family.data()); - if (!font_style.empty()) FcPatternAddString(pat, FC_STYLE, (FcChar8 *)font_style.data()); + FcPattern *pat = FcPatternCreate(); + if (!font_family.empty()) FcPatternAddString(pat, FC_FAMILY, reinterpret_cast(font_family.c_str())); + if (!font_style.empty()) FcPatternAddString(pat, FC_STYLE, reinterpret_cast(font_style.c_str())); FcConfigSubstitute(nullptr, pat, FcMatchPattern); FcDefaultSubstitute(pat); FcFontSet *fs = FcFontSetCreate();