Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Strings are UTF8 encoded in drawText.
[graphlib.git] / DrawingWindow.cpp
index 2ad01de..554e7fb 100644 (file)
@@ -345,6 +345,24 @@ void DrawingWindow::setBgColor(float red, float green, float blue)
     setBgColor(QColor::fromRgbF(red, green, blue));
 }
 
+//! Retourne la fonte courante utilisée pour dessiner du texte.
+/*!
+ * \see QFont, setFont
+ */
+const QFont& DrawingWindow::getFont() const
+{
+    return painter->font();
+}
+
+//! Applique une nouvelle font pour dessiner du texte.
+/*!
+ * \see QFont, getFont
+ */
+void DrawingWindow::setFont(const QFont& font)
+{
+    painter->setFont(font);
+}
+
 //! Efface la fenêtre.
 /*!
  * La fenêtre est effacée avec la couleur de fond courante.
@@ -495,7 +513,7 @@ void DrawingWindow::drawTriangle(int x1, int y1, int x2, int y2, int x3, int y3)
     safeUnlock(imageMutex);
 }
 
-//! Dessine un trianle plein.
+//! Dessine un triangle plein.
 /*!
  * Dessine un triangle plein défini par les coordonnées de ses
  * sommets: (x1, y1), (x2, y2) et (x3, y3).  Utilise la couleur de
@@ -1016,7 +1034,7 @@ void DrawingWindow::realDrawText(int x, int y, const char *text, int flags)
         r.setTop(y);
     }
     syncMutex.lock();
-    painter->drawText(r, flags, text, &r);
+    painter->drawText(r, flags, QString::fromUtf8(text), &r);
     dirty(r);
     syncCondition.wakeAll();
     syncMutex.unlock();