Ya guarda y lee la configuracion

This commit is contained in:
2022-09-12 19:06:15 +02:00
parent c5aa28d738
commit 6b7769ca3c
8 changed files with 116 additions and 114 deletions

View File

@@ -142,6 +142,8 @@ int Text::lenght(std::string text, int kerning)
void Text::initOffsetFromFile()
{
std::ifstream rfile(file);
printf("Reading file %s\n", file.c_str());
if (rfile.is_open() && rfile.good())
{
std::string buffer;
@@ -168,6 +170,16 @@ void Text::initOffsetFromFile()
buffer.clear();
line_read++;
};
// Cierra el fichero
printf("Closing file %s\n\n", file.c_str());
rfile.close();
}
// El fichero no se puede abrir
else
{
printf("Warning: Unable to open %s file\n", file.c_str());
}
}