X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fbase%2Frs_font.cpp;h=b8a3e6cc1c19b8b7621db9bdbc6061016b39139f;hb=97d3cdae07ec9788cf80e7905abfdb5d67a7747c;hp=cd81bb939a9520730242a51ef4b3dfb29fcff2b0;hpb=16ce54abf01ca3032e42a5bb11a4afcf9014dcca;p=architektonas diff --git a/src/base/rs_font.cpp b/src/base/rs_font.cpp index cd81bb9..b8a3e6c 100644 --- a/src/base/rs_font.cpp +++ b/src/base/rs_font.cpp @@ -119,9 +119,9 @@ bool RS_Font::loadFont() } // Open cxf file: - QFile f(path); + QFile file(path); - if (!f.open(QIODevice::ReadOnly)) + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { RS_DEBUG->print(RS_Debug::D_WARNING, "RS_Font::loadFont: Cannot open font file: %s", path.toLatin1().data()); @@ -132,14 +132,17 @@ bool RS_Font::loadFont() RS_DEBUG->print("RS_Font::loadFont: Successfully opened font file: %s", path.toLatin1().data()); } - QTextStream ts(&f); + QTextStream ts(&file); QString line; // Read line by line until we find a new letter: - while (!f.atEnd()) +//I think this is wrong... We're mixing classes here... +//AND THAT WAS THE PROBLEM!!! +// while (!file.atEnd()) + while (!ts.atEnd()) { line = ts.readLine(); - +//printf("\"%s\"\n", line.toAscii().data()); if (line.isEmpty()) continue; @@ -168,6 +171,7 @@ bool RS_Font::loadFont() if (list.size() >= 2) value = list[1].simplified();//.toLower(); #endif +//printf("--> identifier=\"%s\", value=\"%s\"\n", identifier.toAscii().data(), value.toAscii().data()); if (identifier == "letterspacing") letterSpacing = value.toDouble(); @@ -268,7 +272,7 @@ bool RS_Font::loadFont() } } - f.close(); + file.close(); loaded = true; RS_DEBUG->print("RS_Font::loadFont OK");