}
// 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());
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;
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();
}
}
- f.close();
+ file.close();
loaded = true;
RS_DEBUG->print("RS_Font::loadFont OK");