]> Shamusworld >> Repos - architektonas/blobdiff - src/base/rs_font.cpp
Fixed problem with dimensions not showing up.
[architektonas] / src / base / rs_font.cpp
index cd81bb939a9520730242a51ef4b3dfb29fcff2b0..b8a3e6cc1c19b8b7621db9bdbc6061016b39139f 100644 (file)
@@ -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");