Skip to content

Commit

Permalink
fix:fix windows QString to string
Browse files Browse the repository at this point in the history
Signed-off-by: xiaoming <[email protected]>
  • Loading branch information
QQxiaoming committed Jul 6, 2022
1 parent eda6c7c commit 6b7528c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/TTFdecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,9 @@ QList<SvgInfo> TTF2RGB::ttf(QString ttffilename,int W, int H, int codepoint)
QList<SvgInfo> TTF2RGB::ttf_verbose(QString ttffilename,int W, int H, int codepoint)
{
QList<SvgInfo> rgbImglist;
QByteArray naBA = ttffilename.toLatin1();

if(codepoint == -1) {
font2svg::ttf_file tfile(std::string(naBA.constData()));
font2svg::ttf_file tfile(ttffilename.toStdString());
for(int index = 0;index<=0x10FFFF;index++) {
font2svg::glyph g(tfile, index);
if(g.glyph_index != 0) {
Expand Down Expand Up @@ -107,7 +106,7 @@ QList<SvgInfo> TTF2RGB::ttf_verbose(QString ttffilename,int W, int H, int codepo
}
else
{
font2svg::glyph g(naBA.constData(), codepoint );
font2svg::glyph g(ttffilename.toStdString(), codepoint );
SvgInfo info;
info.src = new QString(
QString::fromStdString(
Expand Down
6 changes: 6 additions & 0 deletions src/font_to_svg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,12 @@ class glyph
init( unicode );
}

glyph( std::string fname, int unicode )
{
this->file = ttf_file( fname );
init( unicode );
}

void free()
{
file.free();
Expand Down

0 comments on commit 6b7528c

Please sign in to comment.