freetype-commit
[Top][All Lists]
Advanced

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

[freetype2-demos] gsoc-2022-chariri-3 a1c3e64 14/36: [ftinspect] Move "w


From: Werner Lemberg
Subject: [freetype2-demos] gsoc-2022-chariri-3 a1c3e64 14/36: [ftinspect] Move "waterfall" out as a separate option.
Date: Wed, 27 Jul 2022 06:32:45 -0400 (EDT)

branch: gsoc-2022-chariri-3
commit a1c3e64a0e1033b56395d2f3ab2482b291c651a8
Author: Charlie Jiang <w@chariri.moe>
Commit: Charlie Jiang <w@chariri.moe>

    [ftinspect] Move "waterfall" out as a separate option.
    
    "Waterfall" rendering is rather a pattern applied for the whole view instead
    of individual characters. Therefore it shouldn't be placed into "Render
    Mode" where Fancy/Stroked are placed.
    
    Also squeezes out some horizontal space by rewording labels.
    
    * src/ftinspect/panels/continuous.cpp, src/ftinspect/panels/continuous.hpp:
      As described.
    
    * src/ftinspect/rendering/glyphcontinuous.cpp:
      Make "waterfall" a separate property instead a value in the mode enum.
---
 src/ftinspect/panels/continuous.cpp         | 17 ++++++++++-------
 src/ftinspect/panels/continuous.hpp         |  1 +
 src/ftinspect/rendering/glyphcontinuous.cpp |  2 --
 src/ftinspect/rendering/glyphcontinuous.hpp |  6 +++---
 4 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/src/ftinspect/panels/continuous.cpp 
b/src/ftinspect/panels/continuous.cpp
index ebb7ceb..c48edb3 100644
--- a/src/ftinspect/panels/continuous.cpp
+++ b/src/ftinspect/panels/continuous.cpp
@@ -62,6 +62,7 @@ ContinuousTab::syncSettings()
                           slantSpinBox_->value());
   canvas_->setStrokeRadius(strokeRadiusSpinBox_->value());
   canvas_->setRotation(rotationSpinBox_->value());
+  canvas_->setWaterfall(waterfallCheckBox_->isChecked());
   canvas_->setVertical(verticalCheckBox_->isChecked());
 }
 
@@ -253,10 +254,8 @@ ContinuousTab::createLayout()
 
   // Note: in sync with the enum!!
   modeSelector_->insertItem(GlyphContinuous::M_Normal, tr("Normal"));
-  modeSelector_->insertItem(GlyphContinuous::M_Fancy,
-                            tr("Fancy (Embolding & Slanting)"));
+  modeSelector_->insertItem(GlyphContinuous::M_Fancy, tr("Fancy"));
   modeSelector_->insertItem(GlyphContinuous::M_Stroked, tr("Stroked"));
-  modeSelector_->insertItem(GlyphContinuous::M_Waterfall, tr("Waterfall"));
   modeSelector_->setCurrentIndex(GlyphContinuous::M_Normal);
 
   // Note: in sync with the enum!!
@@ -268,12 +267,13 @@ ContinuousTab::createLayout()
                               tr("Text String (Repeated)"));
 
   verticalCheckBox_ = new QCheckBox(tr("Vertical Layout"), this);
+  waterfallCheckBox_ = new QCheckBox(tr("Waterfall"), this);
 
   modeLabel_ = new QLabel(tr("Mode:"), this);
   sourceLabel_ = new QLabel(tr("Text Source:"), this);
   charMapLabel_ = new QLabel(tr("Char Map:"), this);
-  xEmboldeningLabel_ = new QLabel(tr("Hori. Embolding:"), this);
-  yEmboldeningLabel_ = new QLabel(tr("Vert. Embolding:"), this);
+  xEmboldeningLabel_ = new QLabel(tr("Horz. Emb.:"), this);
+  yEmboldeningLabel_ = new QLabel(tr("Vert. Emb.:"), this);
   slantLabel_ = new QLabel(tr("Slanting:"), this);
   strokeRadiusLabel_ = new QLabel(tr("Stroke Radius:"), this);
   rotationLabel_ = new QLabel(tr("Rotation:"), this);
@@ -321,8 +321,9 @@ ContinuousTab::createLayout()
   bottomLayout_->addWidget(rotationSpinBox_, 0, 3);
 
   bottomLayout_->addWidget(indexSelector_, 0, 4, 1, 1);
-  bottomLayout_->addWidget(sourceTextEdit_, 1, 4, 3, 2);
-  bottomLayout_->addWidget(verticalCheckBox_, 0, 5);
+  bottomLayout_->addWidget(sourceTextEdit_, 1, 4, 3, 3);
+  bottomLayout_->addWidget(waterfallCheckBox_, 0, 5);
+  bottomLayout_->addWidget(verticalCheckBox_, 0, 6);
 
   bottomLayout_->setColumnStretch(4, 1);
 
@@ -373,6 +374,8 @@ ContinuousTab::createConnections()
           QOverload<double>::of(&QDoubleSpinBox::valueChanged),
           this, &ContinuousTab::repaintGlyph);
 
+  connect(waterfallCheckBox_, &QCheckBox::clicked,
+          this, &ContinuousTab::repaintGlyph);
   connect(verticalCheckBox_, &QCheckBox::clicked,
           this, &ContinuousTab::repaintGlyph);
   connect(sourceTextEdit_, &QPlainTextEdit::textChanged,
diff --git a/src/ftinspect/panels/continuous.hpp 
b/src/ftinspect/panels/continuous.hpp
index 373b4fe..abd1c3f 100644
--- a/src/ftinspect/panels/continuous.hpp
+++ b/src/ftinspect/panels/continuous.hpp
@@ -83,6 +83,7 @@ private:
   QDoubleSpinBox* rotationSpinBox_;
 
   QCheckBox* verticalCheckBox_;
+  QCheckBox* waterfallCheckBox_;
 
   GlyphIndexSelector* indexSelector_;
   QPlainTextEdit* sourceTextEdit_;
diff --git a/src/ftinspect/rendering/glyphcontinuous.cpp 
b/src/ftinspect/rendering/glyphcontinuous.cpp
index faea765..a0e236b 100644
--- a/src/ftinspect/rendering/glyphcontinuous.cpp
+++ b/src/ftinspect/rendering/glyphcontinuous.cpp
@@ -51,8 +51,6 @@ GlyphContinuous::paintEvent(QPaintEvent* event)
       case M_Stroked:
         paintAG(&painter);
         break;
-      case M_Waterfall:
-        break;
       }
       break;
     case SRC_TextString:
diff --git a/src/ftinspect/rendering/glyphcontinuous.hpp 
b/src/ftinspect/rendering/glyphcontinuous.hpp
index eca2f00..cd4855f 100644
--- a/src/ftinspect/rendering/glyphcontinuous.hpp
+++ b/src/ftinspect/rendering/glyphcontinuous.hpp
@@ -36,8 +36,7 @@ public:
   {
     M_Normal,
     M_Fancy,
-    M_Stroked,
-    M_Waterfall
+    M_Stroked
   };
 
   int displayingCount() { return displayingCount_; }
@@ -57,9 +56,9 @@ public:
   void setStrokeRadius(double radius) { strokeRadius_ = radius; }
   void setRotation(double rotation) { rotation_ = rotation; }
   void setVertical(bool vertical) { vertical_ = vertical; }
+  void setWaterfall(bool waterfall) { waterfall_ = waterfall; }
   void setSourceText(QString text) { text_ = std::move(text); }
 
-
 signals:
   void wheelNavigate(int steps);
   void wheelResize(int steps);
@@ -82,6 +81,7 @@ private:
   double strokeRadius_;
   double rotation_;
   bool vertical_;
+  bool waterfall_;
   QString text_;
 
   int displayingCount_ = 0;



reply via email to

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