freetype-commit
[Top][All Lists]
Advanced

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

[freetype2-demos] master 37db555 1/4: [ftinspect] Add general hinting ch


From: Werner LEMBERG
Subject: [freetype2-demos] master 37db555 1/4: [ftinspect] Add general hinting check button.
Date: Fri, 06 May 2016 21:42:57 +0000

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

    [ftinspect] Add general hinting check button.
    
    * src/ftinspect.cpp (MainGUI::checkHinting): New method.
    (MainGUI::createLayout, MainGUI::createConnections,
    MainGUI::setDefaults): Updated.
    (MainGUI::checkAutoHinting): Also handle `hintingModeLabel'.
    
    * src/ftinspect.h: Updated.
---
 ChangeLog         |   13 ++++++++++++-
 src/ftinspect.cpp |   36 ++++++++++++++++++++++++++++++++++++
 src/ftinspect.h   |    2 ++
 3 files changed, 50 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 8a7c93d..be0379d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2016-05-06  Werner Lemberg  <address@hidden>
 
+       [ftinspect] Add general hinting check button.
+
+       * src/ftinspect.cpp (MainGUI::checkHinting): New method.
+       (MainGUI::createLayout, MainGUI::createConnections,
+       MainGUI::setDefaults): Updated.
+       (MainGUI::checkAutoHinting): Also handle `hintingModeLabel'.
+
+       * src/ftinspect.h: Updated.
+
+2016-05-06  Werner Lemberg  <address@hidden>
+
        [ftinspect] More gamma slider settings.
 
        * src/ftinspect.cpp (MainGUI::createLayout): Set gamma slider tick
@@ -21,7 +32,7 @@
 
 2016-05-06  Werner Lemberg  <address@hidden>
 
-       [ftinspect] Indend `show point indices' check box.
+       [ftinspect] Indent `show point indices' check box.
 
        * src/ftinspect.cpp (MainGUI::createLayout): Implement it.
 
diff --git a/src/ftinspect.cpp b/src/ftinspect.cpp
index b17629a..67c6ccf 100644
--- a/src/ftinspect.cpp
+++ b/src/ftinspect.cpp
@@ -473,6 +473,31 @@ MainGUI::showFont()
 
 
 void
+MainGUI::checkHinting()
+{
+  if (hintingCheckBox->isChecked())
+  {
+    autoHintingCheckBox->setEnabled(true);
+    checkAutoHinting();
+  }
+  else
+  {
+    hintingModeLabel->setEnabled(false);
+    hintingModeComboBoxx->setEnabled(false);
+
+    autoHintingCheckBox->setEnabled(false);
+    horizontalHintingCheckBox->setEnabled(false);
+    verticalHintingCheckBox->setEnabled(false);
+    blueZoneHintingCheckBox->setEnabled(false);
+    segmentDrawingCheckBox->setEnabled(false);
+    warpingCheckBox->setEnabled(false);
+
+    antiAliasingComboBoxx->setItemEnabled(AntiAliasing_Slight, false);
+  }
+}
+
+
+void
 MainGUI::checkHintingMode()
 {
   int index = hintingModeComboBoxx->currentIndex();
@@ -486,6 +511,7 @@ MainGUI::checkAutoHinting()
 {
   if (autoHintingCheckBox->isChecked())
   {
+    hintingModeLabel->setEnabled(false);
     hintingModeComboBoxx->setEnabled(false);
 
     horizontalHintingCheckBox->setEnabled(true);
@@ -499,6 +525,7 @@ MainGUI::checkAutoHinting()
   }
   else
   {
+    hintingModeLabel->setEnabled(true);
     hintingModeComboBoxx->setEnabled(true);
 
     horizontalHintingCheckBox->setEnabled(false);
@@ -752,6 +779,8 @@ void
 MainGUI::createLayout()
 {
   // left side
+  hintingCheckBox = new QCheckBox(tr("Hinting"));
+
   hintingModeLabel = new QLabel(tr("Hinting Mode"));
   hintingModeLabel->setAlignment(Qt::AlignRight);
   hintingModeComboBoxx = new QComboBoxx;
@@ -876,6 +905,7 @@ MainGUI::createLayout()
   pointIndicesLayout->addWidget(showPointIndicesCheckBox);
 
   generalTabLayout = new QVBoxLayout;
+  generalTabLayout->addWidget(hintingCheckBox);
   generalTabLayout->addLayout(hintingModeLayout);
   generalTabLayout->addWidget(autoHintingCheckBox);
   generalTabLayout->addLayout(horizontalHintingLayout);
@@ -1045,6 +1075,9 @@ MainGUI::createLayout()
 void
 MainGUI::createConnections()
 {
+  connect(hintingCheckBox, SIGNAL(clicked()), this,
+          SLOT(checkHinting()));
+
   connect(hintingModeComboBoxx, SIGNAL(currentIndexChanged(int)), this,
           SLOT(checkHintingMode()));
   connect(antiAliasingComboBoxx, SIGNAL(currentIndexChanged(int)), this,
@@ -1171,6 +1204,8 @@ MainGUI::setDefaults()
   currentFaceIndex = -1;
   currentInstanceIndex = -1;
 
+  hintingCheckBox->setChecked(true);
+
   hintingModeComboBoxx->setCurrentIndex(HintingMode_TrueType_v35);
   antiAliasingComboBoxx->setCurrentIndex(AntiAliasing_LCD);
   lcdFilterComboBox->setCurrentIndex(LCDFilter_Light);
@@ -1187,6 +1222,7 @@ MainGUI::setDefaults()
   dpiSpinBox->setValue(96);
   zoomSpinBox->setValue(100);
 
+  checkHinting();
   checkHintingMode();
   checkAutoHinting();
   checkAntiAliasing();
diff --git a/src/ftinspect.h b/src/ftinspect.h
index 6825888..7ca4942 100644
--- a/src/ftinspect.h
+++ b/src/ftinspect.h
@@ -166,6 +166,7 @@ private slots:
   void checkCurrentFaceIndex();
   void checkCurrentFontIndex();
   void checkCurrentInstanceIndex();
+  void checkHinting();
   void checkHintingMode();
   void checkLcdFilter();
   void checkShowPoints();
@@ -196,6 +197,7 @@ private:
 
   QCheckBox *autoHintingCheckBox;
   QCheckBox *blueZoneHintingCheckBox;
+  QCheckBox *hintingCheckBox;
   QCheckBox *horizontalHintingCheckBox;
   QCheckBox *segmentDrawingCheckBox;
   QCheckBox *showBitmapCheckBox;



reply via email to

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