Fix freetype font build for windows

This commit is contained in:
Nikita Lisitsa 2024-08-08 00:27:39 +03:00
parent f177f29a60
commit 5141643531

View file

@ -334,7 +334,8 @@ namespace psemek::fonts
std::unique_ptr<font_builder> load_freetype_font(wgpu::device device, std::filesystem::path const & path) std::unique_ptr<font_builder> load_freetype_font(wgpu::device device, std::filesystem::path const & path)
{ {
FT_Face face; FT_Face face;
ft_check_result(FT_New_Face(ft_library(), path.c_str(), 0, &face), "Failed to load font " + path.string() + ": "); auto path_str = path.string();
ft_check_result(FT_New_Face(ft_library(), path_str.data(), 0, &face), "Failed to load font " + path_str + ": ");
auto result = std::make_unique<freetype_font_builder>(std::make_shared<face_shared>(device, face)); auto result = std::make_unique<freetype_font_builder>(std::make_shared<face_shared>(device, face));