mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-08 19:09:09 +08:00
Follow-up of 8ea8eb67e4
, utf-8 path conversion moved into nanosvg library
This commit is contained in:
parent
490074a2dd
commit
46eafca0eb
@ -2897,6 +2897,8 @@ NSVGimage* nsvgParse(char* input, const char* units, float dpi)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include <boost/nowide/cstdio.hpp>
|
||||||
|
|
||||||
NSVGimage* nsvgParseFromFile(const char* filename, const char* units, float dpi)
|
NSVGimage* nsvgParseFromFile(const char* filename, const char* units, float dpi)
|
||||||
{
|
{
|
||||||
FILE* fp = NULL;
|
FILE* fp = NULL;
|
||||||
@ -2904,7 +2906,7 @@ NSVGimage* nsvgParseFromFile(const char* filename, const char* units, float dpi)
|
|||||||
char* data = NULL;
|
char* data = NULL;
|
||||||
NSVGimage* image = NULL;
|
NSVGimage* image = NULL;
|
||||||
|
|
||||||
fp = fopen(filename, "rb");
|
fp = boost::nowide::fopen(filename, "rb");
|
||||||
if (!fp) goto error;
|
if (!fp) goto error;
|
||||||
fseek(fp, 0, SEEK_END);
|
fseek(fp, 0, SEEK_END);
|
||||||
size = ftell(fp);
|
size = ftell(fp);
|
||||||
|
@ -108,7 +108,7 @@ bool GLTexture::load_from_svg_files_as_sprites_array(const std::vector<std::stri
|
|||||||
if (!boost::algorithm::iends_with(filename, ".svg"))
|
if (!boost::algorithm::iends_with(filename, ".svg"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
NSVGimage* image = nsvgParseFromFile(encode_path(filename.c_str()).c_str(), "px", 96.0f);
|
NSVGimage* image = nsvgParseFromFile(filename.c_str(), "px", 96.0f);
|
||||||
if (image == nullptr)
|
if (image == nullptr)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -361,7 +361,7 @@ bool GLTexture::load_from_png(const std::string& filename, bool use_mipmaps)
|
|||||||
|
|
||||||
bool GLTexture::load_from_svg(const std::string& filename, bool use_mipmaps, unsigned int max_size_px)
|
bool GLTexture::load_from_svg(const std::string& filename, bool use_mipmaps, unsigned int max_size_px)
|
||||||
{
|
{
|
||||||
NSVGimage* image = nsvgParseFromFile(encode_path(filename.c_str()).c_str(), "px", 96.0f);
|
NSVGimage* image = nsvgParseFromFile(filename.c_str(), "px", 96.0f);
|
||||||
if (image == nullptr)
|
if (image == nullptr)
|
||||||
{
|
{
|
||||||
// printf("Could not open SVG image.\n");
|
// printf("Could not open SVG image.\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user