freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2-demos] master aea44c1 1/2: [ftinspect] Provide some drawing c


From: Werner LEMBERG
Subject: [freetype2-demos] master aea44c1 1/2: [ftinspect] Provide some drawing colors.
Date: Sun, 8 May 2016 14:25:45 +0000 (UTC)

branch: master
commit aea44c1a993a40133027129fbc4cab622a3fd133
Author: Werner Lemberg <address@hidden>
Commit: Werner Lemberg <address@hidden>

    [ftinspect] Provide some drawing colors.
    
    * src/ftinspect.h (MainGUI): Provide colors for axes, blue zones,
    grid lines, on and off points, outlines, and segment lines.
    
    * src/ftinspect.cpp (MainGUI::setGraphicsDefaults): New method.
    (MainGUI::MainGUI): Updated.
---
 ChangeLog         |   10 ++++++++++
 src/ftinspect.cpp |   28 ++++++++++++++++++++++++----
 src/ftinspect.h   |   11 +++++++++++
 3 files changed, 45 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5c662f5..c3894e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2016-05-08  Werner Lemberg  <address@hidden>
+
+       [ftinspect] Provide some drawing colors.
+
+       * src/ftinspect.h (MainGUI): Provide colors for axes, blue zones,
+       grid lines, on and off points, outlines, and segment lines.
+
+       * src/ftinspect.cpp (MainGUI::setGraphicsDefaults): New method.
+       (MainGUI::MainGUI): Updated.
+
 2016-05-07  Werner Lemberg  <address@hidden>
 
        [ftinspect] Make glyph navigation work.
diff --git a/src/ftinspect.cpp b/src/ftinspect.cpp
index 312edf6..2b219e9 100644
--- a/src/ftinspect.cpp
+++ b/src/ftinspect.cpp
@@ -449,6 +449,7 @@ Engine::update()
 
 MainGUI::MainGUI()
 {
+  setGraphicsDefaults();
   createLayout();
   createConnections();
   createActions();
@@ -968,6 +969,25 @@ MainGUI::nextInstance()
 }
 
 
+void
+MainGUI::setGraphicsDefaults()
+{
+  // XXX make this user-configurable
+
+  axisPen.setColor(QColor(0, 0, 0, 255));        // black
+  axisPen.setWidth(0);
+  blueZonePen.setColor(QColor(64, 64, 255, 64)); // light blue
+  blueZonePen.setWidth(0);
+  gridPen.setColor(QColor(192, 192, 192, 255));  // gray
+  gridPen.setWidth(0);
+  offPen.setColor(QColor(0, 128, 0, 255));       // dark green
+  onPen.setColor(QColor(255, 0, 0, 255));        // red
+  outlinePen.setColor(QColor(255, 0, 0, 255));   // red
+  segmentPen.setColor(QColor(64, 255, 128, 64)); // light green
+  segmentPen.setWidth(0);
+}
+
+
 // XXX distances are specified in pixels,
 //     making the layout dependent on the output device resolution
 void
@@ -1394,10 +1414,6 @@ MainGUI::clearStatusBar()
 void
 MainGUI::setDefaults()
 {
-  // starting value 0 for a cache's face ID
-  // only works with FreeType 2.6.4 or newer
-  faceCounter = 1;
-
   // set up mappings between property values and combo box indices
   hintingModesTrueTypeHash[TT_INTERPRETER_VERSION_35] = 
HintingMode_TrueType_v35;
   hintingModesTrueTypeHash[TT_INTERPRETER_VERSION_38] = 
HintingMode_TrueType_v38;
@@ -1435,6 +1451,10 @@ MainGUI::setDefaults()
     hintingModeComboBoxx->setItemEnabled(hintingModesAlwaysDisabled[i],
                                          false);
 
+  // starting value 0 for a cache's face ID
+  // only works with FreeType 2.6.4 or newer
+  faceCounter = 1;
+
   currentFontIndex = -1;
   currentFaceIndex = -1;
   currentInstanceIndex = -1;
diff --git a/src/ftinspect.h b/src/ftinspect.h
index 57a2c0f..8f14f6f 100644
--- a/src/ftinspect.h
+++ b/src/ftinspect.h
@@ -16,6 +16,7 @@
 #include <QButtonGroup>
 #include <QCheckBox>
 #include <QCloseEvent>
+#include <QColor>
 #include <QComboBox>
 #include <QDesktopWidget>
 #include <QDir>
@@ -31,6 +32,7 @@
 #include <QMenu>
 #include <QMenuBar>
 #include <QMessageBox>
+#include <QPen>
 #include <QPushButton>
 #include <QSettings>
 #include <QSignalMapper>
@@ -294,6 +296,14 @@ private:
   QMenu *menuFile;
   QMenu *menuHelp;
 
+  QPen axisPen;
+  QPen blueZonePen;
+  QPen gridPen;
+  QPen offPen;
+  QPen onPen;
+  QPen outlinePen;
+  QPen segmentPen;
+
   QPushButton *nextFaceButton;
   QPushButton *nextFontButton;
   QPushButton *nextInstanceButton;
@@ -370,6 +380,7 @@ private:
   void clearStatusBar();
   void createStatusBar();
   void readSettings();
+  void setGraphicsDefaults();
   void showFont();
   void writeSettings();
 };



reply via email to

[Prev in Thread] Current Thread [Next in Thread]