[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2-demos] master 996dbf2 08/41: [ftinspect] WIP: Rewrite `MainGU
From: |
Werner Lemberg |
Subject: |
[freetype2-demos] master 996dbf2 08/41: [ftinspect] WIP: Rewrite `MainGUI`. |
Date: |
Mon, 3 Oct 2022 11:27:01 -0400 (EDT) |
branch: master
commit 996dbf27a641e4ec2fe4b450470a20d50f258ab1
Author: Charlie Jiang <w@chariri.moe>
Commit: Werner Lemberg <wl@gnu.org>
[ftinspect] WIP: Rewrite `MainGUI`.
Note: This commit doesn't compile. This change is splitted into 2 commits
to avoid a complicated diff.
* src/ftinspect/maingui.cpp, src/ftinspect/maingui.hpp: Old version removed.
---
src/ftinspect/maingui.cpp | 1235 ---------------------------------------------
src/ftinspect/maingui.hpp | 251 ---------
2 files changed, 1486 deletions(-)
diff --git a/src/ftinspect/maingui.cpp b/src/ftinspect/maingui.cpp
deleted file mode 100644
index c5c2f27..0000000
--- a/src/ftinspect/maingui.cpp
+++ /dev/null
@@ -1,1235 +0,0 @@
-// maingui.cpp
-
-// Copyright (C) 2016-2022 by Werner Lemberg.
-
-
-#include "maingui.hpp"
-#include "glyphcomponents/grid.hpp"
-#include "uihelper.hpp"
-
-#include <QApplication>
-#include <QFileDialog>
-#include <QMessageBox>
-#include <QSettings>
-
-#include <freetype/ftdriver.h>
-
-
-MainGUI::MainGUI(Engine* engine)
-: engine_(engine)
-{
- setGraphicsDefaults();
- createLayout();
- createConnections();
- createActions();
- createMenus();
- createStatusBar();
-
- readSettings();
-
- setUnifiedTitleAndToolBarOnMac(true);
-}
-
-
-MainGUI::~MainGUI()
-{
- // empty
-}
-
-
-// overloading
-
-void
-MainGUI::closeEvent(QCloseEvent* event)
-{
- writeSettings();
- event->accept();
-}
-
-
-void
-MainGUI::about()
-{
- QMessageBox::about(
- this,
- tr("About ftinspect"),
- tr("<p>This is <b>ftinspect</b> version %1<br>"
- " Copyright %2 2016-2022<br>"
- " by Werner Lemberg <tt><wl@gnu.org></tt></p>"
- ""
- "<p><b>ftinspect</b> shows how a font gets rendered"
- " by FreeType, allowing control over virtually"
- " all rendering parameters.</p>"
- ""
- "<p>License:"
- " <a
href='https://gitlab.freedesktop.org/freetype/freetype/-/blob/master/docs/FTL.TXT'>FreeType"
- " License (FTL)</a> or"
- " <a
href='https://gitlab.freedesktop.org/freetype/freetype/-/blob/master/docs/GPLv2.TXT'>GNU"
- " GPLv2</a></p>")
- .arg(QApplication::applicationVersion())
- .arg(QChar(0xA9)));
-}
-
-
-void
-MainGUI::aboutQt()
-{
- QApplication::aboutQt();
-}
-
-
-void
-MainGUI::loadFonts()
-{
- int oldSize = engine_->numberOfOpenedFonts();
-
- QStringList files = QFileDialog::getOpenFileNames(
- this,
- tr("Load one or more fonts"),
- QDir::homePath(),
- "",
- NULL,
- QFileDialog::ReadOnly);
-
- engine_->openFonts(files);
-
- // if we have new fonts, set the current index to the first new one
- if (oldSize < engine_->numberOfOpenedFonts())
- currentFontIndex_ = oldSize;
-
- showFont();
-}
-
-
-void
-MainGUI::closeFont()
-{
- if (currentFontIndex_ < engine_->numberOfOpenedFonts())
- {
- engine_->removeFont(currentFontIndex_);
- }
-
- // show next font after deletion, i.e., retain index if possible
- int num = engine_->numberOfOpenedFonts();
- if (num)
- {
- if (currentFontIndex_ >= num)
- currentFontIndex_ = num - 1;
- }
- else
- currentFontIndex_ = 0;
-
- showFont();
-}
-
-
-void
-MainGUI::watchCurrentFont()
-{
- showFont();
-}
-
-
-void
-MainGUI::showFont()
-{
- // we do lazy computation of FT_Face objects
-
- if (currentFontIndex_ < engine_->numberOfOpenedFonts())
- {
- QFileInfo& fileInfo = engine_->fontFileManager()[currentFontIndex_];
- QString fontName = fileInfo.fileName();
-
- engine_->fontFileManager().updateWatching(currentFontIndex_);
- if (fileInfo.isSymLink())
- {
- fontName.prepend("<i>");
- fontName.append("</i>");
- }
-
- if (!fileInfo.exists())
- {
- // On Unix-like systems, the symlink's target gets opened; this
- // implies that deletion of a symlink doesn't make `engine->loadFont'
- // fail since it operates on a file handle pointing to the target.
- // For this reason, we remove the font to enforce a reload.
- // However, we're just removing it from the Engine cache,
- // not deleting the entry in the font file manager
- engine_->removeFont(currentFontIndex_, false);
- }
-
- fontFilenameLabel_->setText(fontName);
- }
- else
- fontFilenameLabel_->clear();
-
- applySettings();
- currentNumberOfFaces_
- = engine_->numberOfFaces(currentFontIndex_);
- currentNumberOfNamedInstances_
- = engine_->numberOfNamedInstances(currentFontIndex_,
- currentFaceIndex_);
- currentNumberOfGlyphs_
- = engine_->loadFont(currentFontIndex_,
- currentFaceIndex_,
- currentNamedInstanceIndex_);
-
- if (currentNumberOfGlyphs_ < 0)
- {
- // there might be various reasons why the current
- // (file, face, instance) triplet is invalid or missing;
- // we thus start our timer to periodically test
- // whether the font starts working
- if (currentFontIndex_ > 0
- && currentFontIndex_ < engine_->numberOfOpenedFonts())
- engine_->fontFileManager().timerStart();
- }
-
- fontNameLabel_->setText(QString("%1 %2")
- .arg(engine_->currentFamilyName())
- .arg(engine_->currentStyleName()));
-
- checkCurrentFontIndex();
- checkCurrentFaceIndex();
- checkCurrentNamedInstanceIndex();
- checkHinting();
- adjustGlyphIndex(0);
-
- drawGlyph();
-}
-
-
-void
-MainGUI::applySettings()
-{
- // Spinbox value cannot become negative
- engine_->setDPI(static_cast<unsigned int>(dpiSpinBox_->value()));
-
- if (unitsComboBox_->currentIndex() == Units_px)
- engine_->setSizeByPixel(sizeDoubleSpinBox_->value());
- else
- engine_->setSizeByPoint(sizeDoubleSpinBox_->value());
-
- engine_->setHinting(hintingCheckBox_->isChecked());
- engine_->setAutoHinting(autoHintingCheckBox_->isChecked());
- engine_->setHorizontalHinting(horizontalHintingCheckBox_->isChecked());
- engine_->setVerticalHinting(verticalHintingCheckBox_->isChecked());
- engine_->setBlueZoneHinting(blueZoneHintingCheckBox_->isChecked());
- engine_->setShowSegments(segmentDrawingCheckBox_->isChecked());
-
- engine_->setGamma(gammaSlider_->value());
-
- engine_->setAntiAliasingTarget(
- antiAliasingComboBoxModel_
- ->indexToValue(antiAliasingComboBox_->currentIndex())
- .loadFlag);
-}
-
-
-void
-MainGUI::clearStatusBar()
-{
- statusBar()->clearMessage();
- statusBar()->setStyleSheet("");
-}
-
-
-void
-MainGUI::checkHinting()
-{
- if (hintingCheckBox_->isChecked())
- {
- if (engine_->currentFontType() == Engine::FontType_CFF)
- {
- hintingModeComboBoxModel_->setCurrentEngineType(
- HintingModeComboBoxModel::HintingEngineType_CFF, false); // XXX tricky
- hintingModeComboBox_->setCurrentIndex(currentCFFHintingMode_);
- }
- else if (engine_->currentFontType() == Engine::FontType_TrueType)
- {
- hintingModeComboBoxModel_->setCurrentEngineType( // XXX tricky
- HintingModeComboBoxModel::HintingEngineType_TrueType, false);
- hintingModeComboBox_->setCurrentIndex(currentTTInterpreterVersion_);
- }
- else
- {
- hintingModeLabel_->setEnabled(false);
- hintingModeComboBox_->setEnabled(false);
- }
-
- autoHintingCheckBox_->setEnabled(true);
- checkAutoHinting();
- }
- else
- {
- hintingModeLabel_->setEnabled(false);
- hintingModeComboBox_->setEnabled(false);
-
- autoHintingCheckBox_->setEnabled(false);
- horizontalHintingCheckBox_->setEnabled(false);
- verticalHintingCheckBox_->setEnabled(false);
- blueZoneHintingCheckBox_->setEnabled(false);
- segmentDrawingCheckBox_->setEnabled(false);
-
- antiAliasingComboBoxModel_->setLightAntiAliasingEnabled(false);
- if (antiAliasingComboBox_->currentIndex()
- == AntiAliasingComboBoxModel::AntiAliasing_Light)
- antiAliasingComboBox_->setCurrentIndex(
- AntiAliasingComboBoxModel::AntiAliasing_Normal);
- }
-
- drawGlyph();
-}
-
-
-void
-MainGUI::checkHintingMode()
-{
- int index = hintingModeComboBox_->currentIndex();
-
- if (engine_->currentFontType() == Engine::FontType_CFF)
- {
- engine_->setCFFHintingMode(
- hintingModeComboBoxModel_->indexToCFFMode(index));
- currentCFFHintingMode_ = index;
- }
- else if (engine_->currentFontType() == Engine::FontType_TrueType)
- {
- engine_->setTTInterpreterVersion(
- hintingModeComboBoxModel_->indexToTTInterpreterVersion(index));
- currentTTInterpreterVersion_ = index;
- }
-
- // this enforces reloading of the font
- showFont();
-}
-
-
-void
-MainGUI::checkAutoHinting()
-{
- if (autoHintingCheckBox_->isChecked())
- {
- hintingModeLabel_->setEnabled(false);
- hintingModeComboBox_->setEnabled(false);
-
- horizontalHintingCheckBox_->setEnabled(true);
- verticalHintingCheckBox_->setEnabled(true);
- blueZoneHintingCheckBox_->setEnabled(true);
- segmentDrawingCheckBox_->setEnabled(true);
-
- antiAliasingComboBoxModel_->setLightAntiAliasingEnabled(true);
- }
- else
- {
- if (engine_->currentFontType() == Engine::FontType_CFF
- || engine_->currentFontType() == Engine::FontType_TrueType)
- {
- hintingModeLabel_->setEnabled(true);
- hintingModeComboBox_->setEnabled(true);
- }
-
- horizontalHintingCheckBox_->setEnabled(false);
- verticalHintingCheckBox_->setEnabled(false);
- blueZoneHintingCheckBox_->setEnabled(false);
- segmentDrawingCheckBox_->setEnabled(false);
-
- antiAliasingComboBoxModel_->setLightAntiAliasingEnabled(false);
-
- if (antiAliasingComboBox_->currentIndex()
- == AntiAliasingComboBoxModel::AntiAliasing_Light)
- antiAliasingComboBox_->setCurrentIndex(
- AntiAliasingComboBoxModel::AntiAliasing_Normal);
- }
-
- drawGlyph();
-}
-
-
-void
-MainGUI::checkAntiAliasing()
-{
- int index = antiAliasingComboBox_->currentIndex();
-
- if (index == AntiAliasingComboBoxModel::AntiAliasing_None
- || index == AntiAliasingComboBoxModel::AntiAliasing_Normal
- || index == AntiAliasingComboBoxModel::AntiAliasing_Light)
- {
- lcdFilterLabel_->setEnabled(false);
- lcdFilterComboBox_->setEnabled(false);
- }
- else
- {
- lcdFilterLabel_->setEnabled(true);
- lcdFilterComboBox_->setEnabled(true);
- }
-
- drawGlyph();
-}
-
-
-void
-MainGUI::checkLcdFilter()
-{
- int index = lcdFilterComboBox_->currentIndex();
- engine_->setLcdFilter(static_cast<FT_LcdFilter>(
- lcdFilterComboboxModel_->indexToValue(index)));
-}
-
-
-void
-MainGUI::checkShowPoints()
-{
- if (showPointsCheckBox_->isChecked())
- showPointNumbersCheckBox_->setEnabled(true);
- else
- showPointNumbersCheckBox_->setEnabled(false);
-
- drawGlyph();
-}
-
-
-void
-MainGUI::checkUnits()
-{
- int index = unitsComboBox_->currentIndex();
-
- if (index == Units_px)
- {
- dpiLabel_->setEnabled(false);
- dpiSpinBox_->setEnabled(false);
- sizeDoubleSpinBox_->setSingleStep(1);
- sizeDoubleSpinBox_->setValue(qRound(sizeDoubleSpinBox_->value()));
- }
- else
- {
- dpiLabel_->setEnabled(true);
- dpiSpinBox_->setEnabled(true);
- sizeDoubleSpinBox_->setSingleStep(0.5);
- }
-
- drawGlyph();
-}
-
-
-void
-MainGUI::adjustGlyphIndex(int delta)
-{
- // only adjust current glyph index if we have a valid font
- if (currentNumberOfGlyphs_ > 0)
- {
- currentGlyphIndex_ += delta;
- currentGlyphIndex_ = qBound(0,
- currentGlyphIndex_,
- currentNumberOfGlyphs_ - 1);
- }
-
- QString upperHex = QString::number(currentGlyphIndex_, 16).toUpper();
- glyphIndexLabel_->setText(QString("%1 (0x%2)")
- .arg(currentGlyphIndex_)
- .arg(upperHex));
- glyphNameLabel_->setText(engine_->glyphName(currentGlyphIndex_));
-
- drawGlyph();
-}
-
-
-void
-MainGUI::checkCurrentFontIndex()
-{
- if (engine_->numberOfOpenedFonts() < 2)
- {
- previousFontButton_->setEnabled(false);
- nextFontButton_->setEnabled(false);
- }
- else if (currentFontIndex_ == 0)
- {
- previousFontButton_->setEnabled(false);
- nextFontButton_->setEnabled(true);
- }
- else if (currentFontIndex_ >= engine_->numberOfOpenedFonts() - 1)
- {
- previousFontButton_->setEnabled(true);
- nextFontButton_->setEnabled(false);
- }
- else
- {
- previousFontButton_->setEnabled(true);
- nextFontButton_->setEnabled(true);
- }
-}
-
-
-void
-MainGUI::checkCurrentFaceIndex()
-{
- if (currentNumberOfFaces_ < 2)
- {
- previousFaceButton_->setEnabled(false);
- nextFaceButton_->setEnabled(false);
- }
- else if (currentFaceIndex_ == 0)
- {
- previousFaceButton_->setEnabled(false);
- nextFaceButton_->setEnabled(true);
- }
- else if (currentFaceIndex_ >= currentNumberOfFaces_ - 1)
- {
- previousFaceButton_->setEnabled(true);
- nextFaceButton_->setEnabled(false);
- }
- else
- {
- previousFaceButton_->setEnabled(true);
- nextFaceButton_->setEnabled(true);
- }
-}
-
-
-void
-MainGUI::checkCurrentNamedInstanceIndex()
-{
- if (currentNumberOfNamedInstances_ < 2)
- {
- previousNamedInstanceButton_->setEnabled(false);
- nextNamedInstanceButton_->setEnabled(false);
- }
- else if (currentNamedInstanceIndex_ == 0)
- {
- previousNamedInstanceButton_->setEnabled(false);
- nextNamedInstanceButton_->setEnabled(true);
- }
- else if (currentNamedInstanceIndex_ >= currentNumberOfNamedInstances_ - 1)
- {
- previousNamedInstanceButton_->setEnabled(true);
- nextNamedInstanceButton_->setEnabled(false);
- }
- else
- {
- previousNamedInstanceButton_->setEnabled(true);
- nextNamedInstanceButton_->setEnabled(true);
- }
-}
-
-
-void
-MainGUI::previousFont()
-{
- if (currentFontIndex_ > 0)
- {
- currentFontIndex_--;
- currentFaceIndex_ = 0;
- currentNamedInstanceIndex_ = 0;
- showFont();
- }
-}
-
-
-void
-MainGUI::nextFont()
-{
- if (currentFontIndex_ < engine_->numberOfOpenedFonts() - 1)
- {
- currentFontIndex_++;
- currentFaceIndex_ = 0;
- currentNamedInstanceIndex_ = 0;
- showFont();
- }
-}
-
-
-void
-MainGUI::previousFace()
-{
- if (currentFaceIndex_ > 0)
- {
- currentFaceIndex_--;
- currentNamedInstanceIndex_ = 0;
- showFont();
- }
-}
-
-
-void
-MainGUI::nextFace()
-{
- if (currentFaceIndex_ < currentNumberOfFaces_ - 1)
- {
- currentFaceIndex_++;
- currentNamedInstanceIndex_ = 0;
- showFont();
- }
-}
-
-
-void
-MainGUI::previousNamedInstance()
-{
- if (currentNamedInstanceIndex_ > 0)
- {
- currentNamedInstanceIndex_--;
- showFont();
- }
-}
-
-
-void
-MainGUI::nextNamedInstance()
-{
- if (currentNamedInstanceIndex_ < currentNumberOfNamedInstances_ - 1)
- {
- currentNamedInstanceIndex_++;
- showFont();
- }
-}
-
-
-void
-MainGUI::zoom()
-{
- int scale = static_cast<int>(zoomSpinBox_->value());
-
- QTransform transform;
- transform.scale(scale, scale);
-
- // we want horizontal and vertical 1px lines displayed with full pixels;
- // we thus have to shift the coordinate system accordingly, using a value
- // that represents 0.5px (i.e., half the 1px line width) after the scaling
- qreal shift = 0.5 / scale;
- transform.translate(shift, shift);
-
- glyphView_->setTransform(transform);
-}
-
-
-void
-MainGUI::setGraphicsDefaults()
-{
- // color tables (with suitable opacity values) for converting
- // FreeType's pixmaps to something Qt understands
- monoColorTable_.append(QColor(Qt::transparent).rgba());
- monoColorTable_.append(QColor(Qt::black).rgba());
-
- for (int i = 0xFF; i >= 0; i--)
- grayColorTable_.append(qRgba(i, i, i, 0xFF - i));
-
- // XXX make this user-configurable
-
- axisPen_.setColor(Qt::black);
- axisPen_.setWidth(0);
- blueZonePen_.setColor(QColor(64, 64, 255, 64)); // light blue
- blueZonePen_.setWidth(0);
- gridPen_.setColor(Qt::lightGray);
- gridPen_.setWidth(0);
- offPen_.setColor(Qt::darkGreen);
- offPen_.setWidth(3);
- onPen_.setColor(Qt::red);
- onPen_.setWidth(3);
- outlinePen_.setColor(Qt::red);
- outlinePen_.setWidth(0);
- segmentPen_.setColor(QColor(64, 255, 128, 64)); // light green
- segmentPen_.setWidth(0);
-}
-
-
-void
-MainGUI::drawGlyph()
-{
- // the call to `engine->loadOutline' updates FreeType's load flags
-
- if (!engine_)
- return;
-
- if (currentGlyphBitmapItem_)
- {
- glyphScene_->removeItem(currentGlyphBitmapItem_);
- delete currentGlyphBitmapItem_;
-
- currentGlyphBitmapItem_ = NULL;
- }
-
- if (currentGlyphOutlineItem_)
- {
- glyphScene_->removeItem(currentGlyphOutlineItem_);
- delete currentGlyphOutlineItem_;
-
- currentGlyphOutlineItem_ = NULL;
- }
-
- if (currentGlyphPointsItem_)
- {
- glyphScene_->removeItem(currentGlyphPointsItem_);
- delete currentGlyphPointsItem_;
-
- currentGlyphPointsItem_ = NULL;
- }
-
- if (currentGlyphPointNumbersItem_)
- {
- glyphScene_->removeItem(currentGlyphPointNumbersItem_);
- delete currentGlyphPointNumbersItem_;
-
- currentGlyphPointNumbersItem_ = NULL;
- }
-
- applySettings();
- FT_Outline* outline = engine_->loadOutline(currentGlyphIndex_);
- if (outline)
- {
- if (showBitmapCheckBox_->isChecked())
- {
- // XXX support LCD
- FT_Pixel_Mode pixelMode = FT_PIXEL_MODE_GRAY;
- if (antiAliasingComboBox_->currentIndex()
- == AntiAliasingComboBoxModel::AntiAliasing_None)
- pixelMode = FT_PIXEL_MODE_MONO;
-
- currentGlyphBitmapItem_ = new GlyphBitmap(outline,
- engine_->ftLibrary(),
- pixelMode,
- monoColorTable_,
- grayColorTable_);
- glyphScene_->addItem(currentGlyphBitmapItem_);
- }
-
- if (showOutlinesCheckBox_->isChecked())
- {
- currentGlyphOutlineItem_ = new GlyphOutline(outlinePen_, outline);
- glyphScene_->addItem(currentGlyphOutlineItem_);
- }
-
- if (showPointsCheckBox_->isChecked())
- {
- currentGlyphPointsItem_ = new GlyphPoints(onPen_, offPen_, outline);
- glyphScene_->addItem(currentGlyphPointsItem_);
-
- if (showPointNumbersCheckBox_->isChecked())
- {
- currentGlyphPointNumbersItem_ = new GlyphPointNumbers(onPen_,
- offPen_,
- outline);
- glyphScene_->addItem(currentGlyphPointNumbersItem_);
- }
- }
- }
-
- glyphScene_->update();
-}
-
-
-// XXX distances are specified in pixels,
-// making the layout dependent on the output device resolution
-void
-MainGUI::createLayout()
-{
- // left side
- fontFilenameLabel_ = new QLabel;
-
- hintingCheckBox_ = new QCheckBox(tr("Hinting"));
-
- hintingModeLabel_ = new QLabel(tr("Hinting Mode"));
- hintingModeLabel_->setAlignment(Qt::AlignRight);
-
- hintingModeComboBoxModel_ = new HintingModeComboBoxModel(this);
- hintingModeComboBox_ = new QComboBox;
- hintingModeComboBox_->setModel(hintingModeComboBoxModel_);
- hintingModeLabel_->setBuddy(hintingModeComboBox_);
-
- autoHintingCheckBox_ = new QCheckBox(tr("Auto-Hinting"));
- horizontalHintingCheckBox_ = new QCheckBox(tr("Horizontal Hinting"));
- verticalHintingCheckBox_ = new QCheckBox(tr("Vertical Hinting"));
- blueZoneHintingCheckBox_ = new QCheckBox(tr("Blue-Zone Hinting"));
- segmentDrawingCheckBox_ = new QCheckBox(tr("Segment Drawing"));
-
- antiAliasingLabel_ = new QLabel(tr("Anti-Aliasing"));
- antiAliasingLabel_->setAlignment(Qt::AlignRight);
-
- antiAliasingComboBoxModel_ = new AntiAliasingComboBoxModel(this);
- antiAliasingComboBox_ = new QComboBox;
- antiAliasingComboBox_->setModel(antiAliasingComboBoxModel_);
- antiAliasingLabel_->setBuddy(antiAliasingComboBox_);
-
- lcdFilterLabel_ = new QLabel(tr("LCD Filter"));
- lcdFilterLabel_->setAlignment(Qt::AlignRight);
-
- lcdFilterComboboxModel_ = new LCDFilterComboBoxModel(this);
- lcdFilterComboBox_ = new QComboBox;
- lcdFilterComboBox_->setModel(lcdFilterComboboxModel_);
- lcdFilterLabel_->setBuddy(lcdFilterComboBox_);
-
- int width;
- // make all labels have the same width
- width = hintingModeLabel_->minimumSizeHint().width();
- width = qMax(antiAliasingLabel_->minimumSizeHint().width(), width);
- width = qMax(lcdFilterLabel_->minimumSizeHint().width(), width);
- hintingModeLabel_->setMinimumWidth(width);
- antiAliasingLabel_->setMinimumWidth(width);
- lcdFilterLabel_->setMinimumWidth(width);
-
- // ensure that all items in combo boxes fit completely;
- // also make all combo boxes have the same width
- width = hintingModeComboBox_->minimumSizeHint().width();
- width = qMax(antiAliasingComboBox_->minimumSizeHint().width(), width);
- width = qMax(lcdFilterComboBox_->minimumSizeHint().width(), width);
- hintingModeComboBox_->setMinimumWidth(width);
- antiAliasingComboBox_->setMinimumWidth(width);
- lcdFilterComboBox_->setMinimumWidth(width);
-
- gammaLabel_ = new QLabel(tr("Gamma"));
- gammaLabel_->setAlignment(Qt::AlignRight);
- gammaSlider_ = new QSlider(Qt::Horizontal);
- gammaSlider_->setRange(0, 30); // in 1/10th
- gammaSlider_->setTickPosition(QSlider::TicksBelow);
- gammaSlider_->setTickInterval(5);
- gammaLabel_->setBuddy(gammaSlider_);
-
- showBitmapCheckBox_ = new QCheckBox(tr("Show Bitmap"));
- showPointsCheckBox_ = new QCheckBox(tr("Show Points"));
- showPointNumbersCheckBox_ = new QCheckBox(tr("Show Point Numbers"));
- showOutlinesCheckBox_ = new QCheckBox(tr("Show Outlines"));
-
- infoLeftLayout_ = new QHBoxLayout;
- infoLeftLayout_->addWidget(fontFilenameLabel_);
-
- hintingModeLayout_ = new QHBoxLayout;
- hintingModeLayout_->addWidget(hintingModeLabel_);
- hintingModeLayout_->addWidget(hintingModeComboBox_);
-
- horizontalHintingLayout_ = new QHBoxLayout;
- horizontalHintingLayout_->addSpacing(20); // XXX px
- horizontalHintingLayout_->addWidget(horizontalHintingCheckBox_);
-
- verticalHintingLayout_ = new QHBoxLayout;
- verticalHintingLayout_->addSpacing(20); // XXX px
- verticalHintingLayout_->addWidget(verticalHintingCheckBox_);
-
- blueZoneHintingLayout_ = new QHBoxLayout;
- blueZoneHintingLayout_->addSpacing(20); // XXX px
- blueZoneHintingLayout_->addWidget(blueZoneHintingCheckBox_);
-
- segmentDrawingLayout_ = new QHBoxLayout;
- segmentDrawingLayout_->addSpacing(20); // XXX px
- segmentDrawingLayout_->addWidget(segmentDrawingCheckBox_);
-
- antiAliasingLayout_ = new QHBoxLayout;
- antiAliasingLayout_->addWidget(antiAliasingLabel_);
- antiAliasingLayout_->addWidget(antiAliasingComboBox_);
-
- lcdFilterLayout_ = new QHBoxLayout;
- lcdFilterLayout_->addWidget(lcdFilterLabel_);
- lcdFilterLayout_->addWidget(lcdFilterComboBox_);
-
- gammaLayout_ = new QHBoxLayout;
- gammaLayout_->addWidget(gammaLabel_);
- gammaLayout_->addWidget(gammaSlider_);
-
- pointNumbersLayout_ = new QHBoxLayout;
- pointNumbersLayout_->addSpacing(20); // XXX px
- pointNumbersLayout_->addWidget(showPointNumbersCheckBox_);
-
- generalTabLayout_ = new QVBoxLayout;
- generalTabLayout_->addWidget(hintingCheckBox_);
- generalTabLayout_->addLayout(hintingModeLayout_);
- generalTabLayout_->addWidget(autoHintingCheckBox_);
- generalTabLayout_->addLayout(horizontalHintingLayout_);
- generalTabLayout_->addLayout(verticalHintingLayout_);
- generalTabLayout_->addLayout(blueZoneHintingLayout_);
- generalTabLayout_->addLayout(segmentDrawingLayout_);
- generalTabLayout_->addSpacing(20); // XXX px
- generalTabLayout_->addStretch(1);
- generalTabLayout_->addLayout(antiAliasingLayout_);
- generalTabLayout_->addLayout(lcdFilterLayout_);
- generalTabLayout_->addSpacing(20); // XXX px
- generalTabLayout_->addStretch(1);
- generalTabLayout_->addLayout(gammaLayout_);
- generalTabLayout_->addSpacing(20); // XXX px
- generalTabLayout_->addStretch(1);
- generalTabLayout_->addWidget(showBitmapCheckBox_);
- generalTabLayout_->addWidget(showPointsCheckBox_);
- generalTabLayout_->addLayout(pointNumbersLayout_);
- generalTabLayout_->addWidget(showOutlinesCheckBox_);
-
- generalTabWidget_ = new QWidget;
- generalTabWidget_->setLayout(generalTabLayout_);
-
- mmgxTabWidget_ = new QWidget;
-
- tabWidget_ = new QTabWidget;
- tabWidget_->addTab(generalTabWidget_, tr("General"));
- tabWidget_->addTab(mmgxTabWidget_, tr("MM/GX"));
-
- leftLayout_ = new QVBoxLayout;
- leftLayout_->addLayout(infoLeftLayout_);
- leftLayout_->addWidget(tabWidget_);
-
- // we don't want to expand the left side horizontally;
- // to change the policy we have to use a widget wrapper
- leftWidget_ = new QWidget;
- leftWidget_->setLayout(leftLayout_);
-
- QSizePolicy leftWidgetPolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
- leftWidgetPolicy.setHorizontalStretch(0);
-
leftWidgetPolicy.setVerticalPolicy(leftWidget_->sizePolicy().verticalPolicy());
-
leftWidgetPolicy.setHeightForWidth(leftWidget_->sizePolicy().hasHeightForWidth());
-
- leftWidget_->setSizePolicy(leftWidgetPolicy);
-
- // right side
- glyphIndexLabel_ = new QLabel;
- glyphNameLabel_ = new QLabel;
- fontNameLabel_ = new QLabel;
-
- glyphScene_ = new QGraphicsScene;
- glyphScene_->addItem(new Grid(gridPen_, axisPen_));
-
- currentGlyphBitmapItem_ = NULL;
- currentGlyphOutlineItem_ = NULL;
- currentGlyphPointsItem_ = NULL;
- currentGlyphPointNumbersItem_ = NULL;
-
- glyphView_ = new QGraphicsViewx(this);
- glyphView_->setRenderHint(QPainter::Antialiasing, true);
- glyphView_->setDragMode(QGraphicsView::ScrollHandDrag);
- glyphView_->setOptimizationFlags(QGraphicsView::DontSavePainterState);
- glyphView_->setViewportUpdateMode(QGraphicsView::SmartViewportUpdate);
- glyphView_->setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
- glyphView_->setScene(glyphScene_);
-
- sizeLabel_ = new QLabel(tr("Size "));
- sizeLabel_->setAlignment(Qt::AlignRight);
- sizeDoubleSpinBox_ = new QDoubleSpinBox;
- sizeDoubleSpinBox_->setAlignment(Qt::AlignRight);
- sizeDoubleSpinBox_->setDecimals(1);
- sizeDoubleSpinBox_->setRange(1, 500);
- sizeLabel_->setBuddy(sizeDoubleSpinBox_);
-
- unitsComboBox_ = new QComboBox;
- unitsComboBox_->insertItem(Units_px, "px");
- unitsComboBox_->insertItem(Units_pt, "pt");
-
- dpiLabel_ = new QLabel(tr("DPI "));
- dpiLabel_->setAlignment(Qt::AlignRight);
- dpiSpinBox_ = new QSpinBox;
- dpiSpinBox_->setAlignment(Qt::AlignRight);
- dpiSpinBox_->setRange(10, 600);
- dpiLabel_->setBuddy(dpiSpinBox_);
-
- toStartButtonx_ = new QPushButton("|<");
- toM1000Buttonx_ = new QPushButton("-1000");
- toM100Buttonx_ = new QPushButton("-100");
- toM10Buttonx_ = new QPushButton("-10");
- toM1Buttonx_ = new QPushButton("-1");
- toP1Buttonx_ = new QPushButton("+1");
- toP10Buttonx_ = new QPushButton("+10");
- toP100Buttonx_ = new QPushButton("+100");
- toP1000Buttonx_ = new QPushButton("+1000");
- toEndButtonx_ = new QPushButton(">|");
-
- setButtonNarrowest(toStartButtonx_);
- setButtonNarrowest(toM1000Buttonx_);
- setButtonNarrowest(toM100Buttonx_ );
- setButtonNarrowest(toM10Buttonx_ );
- setButtonNarrowest(toM1Buttonx_ );
- setButtonNarrowest(toP1Buttonx_ );
- setButtonNarrowest(toP10Buttonx_ );
- setButtonNarrowest(toP100Buttonx_ );
- setButtonNarrowest(toP1000Buttonx_);
- setButtonNarrowest(toEndButtonx_ );
-
- zoomLabel_ = new QLabel(tr("Zoom Factor"));
- zoomLabel_->setAlignment(Qt::AlignRight);
- zoomSpinBox_ = new ZoomSpinBox(this, false);
- zoomSpinBox_->setAlignment(Qt::AlignRight);
- zoomSpinBox_->setRange(1, 1000 - 1000 % 64);
- zoomSpinBox_->setKeyboardTracking(false);
- zoomLabel_->setBuddy(zoomSpinBox_);
-
- previousFontButton_ = new QPushButton(tr("Previous Font"));
- nextFontButton_ = new QPushButton(tr("Next Font"));
- previousFaceButton_ = new QPushButton(tr("Previous Face"));
- nextFaceButton_ = new QPushButton(tr("Next Face"));
- previousNamedInstanceButton_ = new QPushButton(tr("Previous Named
Instance"));
- nextNamedInstanceButton_ = new QPushButton(tr("Next Named Instance"));
-
- infoRightLayout = new QGridLayout;
- infoRightLayout->addWidget(glyphIndexLabel_, 0, 0);
- infoRightLayout->addWidget(glyphNameLabel_, 0, 1);
- infoRightLayout->addWidget(fontNameLabel_, 0, 2);
-
- navigationLayout_ = new QHBoxLayout;
- navigationLayout_->setSpacing(0);
- navigationLayout_->addStretch(1);
- navigationLayout_->addWidget(toStartButtonx_);
- navigationLayout_->addWidget(toM1000Buttonx_);
- navigationLayout_->addWidget(toM100Buttonx_);
- navigationLayout_->addWidget(toM10Buttonx_);
- navigationLayout_->addWidget(toM1Buttonx_);
- navigationLayout_->addWidget(toP1Buttonx_);
- navigationLayout_->addWidget(toP10Buttonx_);
- navigationLayout_->addWidget(toP100Buttonx_);
- navigationLayout_->addWidget(toP1000Buttonx_);
- navigationLayout_->addWidget(toEndButtonx_);
- navigationLayout_->addStretch(1);
-
- sizeLayout_ = new QHBoxLayout;
- sizeLayout_->addStretch(2);
- sizeLayout_->addWidget(sizeLabel_);
- sizeLayout_->addWidget(sizeDoubleSpinBox_);
- sizeLayout_->addWidget(unitsComboBox_);
- sizeLayout_->addStretch(1);
- sizeLayout_->addWidget(dpiLabel_);
- sizeLayout_->addWidget(dpiSpinBox_);
- sizeLayout_->addStretch(1);
- sizeLayout_->addWidget(zoomLabel_);
- sizeLayout_->addWidget(zoomSpinBox_);
- sizeLayout_->addStretch(2);
-
- fontLayout = new QGridLayout;
- fontLayout->setColumnStretch(0, 2);
- fontLayout->addWidget(nextFontButton_, 0, 1);
- fontLayout->addWidget(previousFontButton_, 1, 1);
- fontLayout->setColumnStretch(2, 1);
- fontLayout->addWidget(nextFaceButton_, 0, 3);
- fontLayout->addWidget(previousFaceButton_, 1, 3);
- fontLayout->setColumnStretch(4, 1);
- fontLayout->addWidget(nextNamedInstanceButton_, 0, 5);
- fontLayout->addWidget(previousNamedInstanceButton_, 1, 5);
- fontLayout->setColumnStretch(6, 2);
-
- rightLayout_ = new QVBoxLayout;
- rightLayout_->addLayout(infoRightLayout);
- rightLayout_->addWidget(glyphView_);
- rightLayout_->addLayout(navigationLayout_);
- rightLayout_->addSpacing(10); // XXX px
- rightLayout_->addLayout(sizeLayout_);
- rightLayout_->addSpacing(10); // XXX px
- rightLayout_->addLayout(fontLayout);
-
- // for symmetry with the left side use a widget also
- rightWidget_ = new QWidget;
- rightWidget_->setLayout(rightLayout_);
-
- // the whole thing
- ftinspectLayout_ = new QHBoxLayout;
- ftinspectLayout_->addWidget(leftWidget_);
- ftinspectLayout_->addWidget(rightWidget_);
-
- ftinspectWidget_ = new QWidget;
- ftinspectWidget_->setLayout(ftinspectLayout_);
- setCentralWidget(ftinspectWidget_);
- setWindowTitle("ftinspect");
-}
-
-
-void
-MainGUI::createConnections()
-{
- connect(hintingCheckBox_, SIGNAL(clicked()),
- SLOT(checkHinting()));
-
- connect(hintingModeComboBox_, SIGNAL(currentIndexChanged(int)),
- SLOT(checkHintingMode()));
- connect(antiAliasingComboBox_, SIGNAL(currentIndexChanged(int)),
- SLOT(checkAntiAliasing()));
- connect(lcdFilterComboBox_, SIGNAL(currentIndexChanged(int)),
- SLOT(checkLcdFilter()));
-
- connect(autoHintingCheckBox_, SIGNAL(clicked()),
- SLOT(checkAutoHinting()));
- connect(showBitmapCheckBox_, SIGNAL(clicked()),
- SLOT(drawGlyph()));
- connect(showPointsCheckBox_, SIGNAL(clicked()),
- SLOT(checkShowPoints()));
- connect(showPointNumbersCheckBox_, SIGNAL(clicked()),
- SLOT(drawGlyph()));
- connect(showOutlinesCheckBox_, SIGNAL(clicked()),
- SLOT(drawGlyph()));
-
- connect(sizeDoubleSpinBox_, SIGNAL(valueChanged(double)),
- SLOT(drawGlyph()));
- connect(unitsComboBox_, SIGNAL(currentIndexChanged(int)),
- SLOT(checkUnits()));
- connect(dpiSpinBox_, SIGNAL(valueChanged(int)),
- SLOT(drawGlyph()));
-
- connect(zoomSpinBox_, SIGNAL(valueChanged(double)),
- SLOT(zoom()));
-
- connect(previousFontButton_, SIGNAL(clicked()),
- SLOT(previousFont()));
- connect(nextFontButton_, SIGNAL(clicked()),
- SLOT(nextFont()));
- connect(previousFaceButton_, SIGNAL(clicked()),
- SLOT(previousFace()));
- connect(nextFaceButton_, SIGNAL(clicked()),
- SLOT(nextFace()));
- connect(previousNamedInstanceButton_, SIGNAL(clicked()),
- SLOT(previousNamedInstance()));
- connect(nextNamedInstanceButton_, SIGNAL(clicked()),
- SLOT(nextNamedInstance()));
-
- glyphNavigationMapper_ = new QSignalMapper;
- connect(glyphNavigationMapper_, SIGNAL(mapped(int)),
- SLOT(adjustGlyphIndex(int)));
-
- connect(toStartButtonx_, SIGNAL(clicked()),
- glyphNavigationMapper_, SLOT(map()));
- connect(toM1000Buttonx_, SIGNAL(clicked()),
- glyphNavigationMapper_, SLOT(map()));
- connect(toM100Buttonx_, SIGNAL(clicked()),
- glyphNavigationMapper_, SLOT(map()));
- connect(toM10Buttonx_, SIGNAL(clicked()),
- glyphNavigationMapper_, SLOT(map()));
- connect(toM1Buttonx_, SIGNAL(clicked()),
- glyphNavigationMapper_, SLOT(map()));
- connect(toP1Buttonx_, SIGNAL(clicked()),
- glyphNavigationMapper_, SLOT(map()));
- connect(toP10Buttonx_, SIGNAL(clicked()),
- glyphNavigationMapper_, SLOT(map()));
- connect(toP100Buttonx_, SIGNAL(clicked()),
- glyphNavigationMapper_, SLOT(map()));
- connect(toP1000Buttonx_, SIGNAL(clicked()),
- glyphNavigationMapper_, SLOT(map()));
- connect(toEndButtonx_, SIGNAL(clicked()),
- glyphNavigationMapper_, SLOT(map()));
-
- glyphNavigationMapper_->setMapping(toStartButtonx_, -0x10000);
- glyphNavigationMapper_->setMapping(toM1000Buttonx_, -1000);
- glyphNavigationMapper_->setMapping(toM100Buttonx_, -100);
- glyphNavigationMapper_->setMapping(toM10Buttonx_, -10);
- glyphNavigationMapper_->setMapping(toM1Buttonx_, -1);
- glyphNavigationMapper_->setMapping(toP1Buttonx_, 1);
- glyphNavigationMapper_->setMapping(toP10Buttonx_, 10);
- glyphNavigationMapper_->setMapping(toP100Buttonx_, 100);
- glyphNavigationMapper_->setMapping(toP1000Buttonx_, 1000);
- glyphNavigationMapper_->setMapping(toEndButtonx_, 0x10000);
-
- connect(&engine_->fontFileManager(), &FontFileManager::currentFileChanged,
- this, &MainGUI::watchCurrentFont);
-}
-
-
-void
-MainGUI::createActions()
-{
- loadFontsAct_ = new QAction(tr("&Load Fonts"), this);
- loadFontsAct_->setShortcuts(QKeySequence::Open);
- connect(loadFontsAct_, SIGNAL(triggered()), SLOT(loadFonts()));
-
- closeFontAct_ = new QAction(tr("&Close Font"), this);
- closeFontAct_->setShortcuts(QKeySequence::Close);
- connect(closeFontAct_, SIGNAL(triggered()), SLOT(closeFont()));
-
- exitAct_ = new QAction(tr("E&xit"), this);
- exitAct_->setShortcuts(QKeySequence::Quit);
- connect(exitAct_, SIGNAL(triggered()), SLOT(close()));
-
- aboutAct_ = new QAction(tr("&About"), this);
- connect(aboutAct_, SIGNAL(triggered()), SLOT(about()));
-
- aboutQtAct_ = new QAction(tr("About &Qt"), this);
- connect(aboutQtAct_, SIGNAL(triggered()), SLOT(aboutQt()));
-}
-
-
-void
-MainGUI::createMenus()
-{
- menuFile_ = menuBar()->addMenu(tr("&File"));
- menuFile_->addAction(loadFontsAct_);
- menuFile_->addAction(closeFontAct_);
- menuFile_->addAction(exitAct_);
-
- menuHelp_ = menuBar()->addMenu(tr("&Help"));
- menuHelp_->addAction(aboutAct_);
- menuHelp_->addAction(aboutQtAct_);
-}
-
-
-void
-MainGUI::createStatusBar()
-{
- statusBar()->showMessage("");
-}
-
-
-void
-MainGUI::setDefaults()
-{
- Engine::EngineDefaultValues& defaults = engine_->engineDefaults();
-
- hintingModeComboBoxModel_->setSupportedModes(
- { defaults.ttInterpreterVersionDefault,
- defaults.ttInterpreterVersionOther,
- defaults.ttInterpreterVersionOther1 },
- { defaults.cffHintingEngineDefault,
- defaults.cffHintingEngineOther });
-
- // the next four values always non-negative
- currentFontIndex_ = 0;
- currentFaceIndex_ = 0;
- currentNamedInstanceIndex_ = 0;
- currentGlyphIndex_ = 0;
-
- currentCFFHintingMode_
- = hintingModeComboBoxModel_->cffModeToIndex(
- defaults.cffHintingEngineDefault);
- currentTTInterpreterVersion_
- = hintingModeComboBoxModel_->ttInterpreterVersionToIndex(
- defaults.ttInterpreterVersionDefault);
-
- hintingCheckBox_->setChecked(true);
-
- antiAliasingComboBox_->setCurrentIndex(
- AntiAliasingComboBoxModel::AntiAliasing_Normal);
- lcdFilterComboBox_->setCurrentIndex(
- LCDFilterComboBoxModel::LCDFilter_Light);
-
- horizontalHintingCheckBox_->setChecked(true);
- verticalHintingCheckBox_->setChecked(true);
- blueZoneHintingCheckBox_->setChecked(true);
-
- showBitmapCheckBox_->setChecked(true);
- showOutlinesCheckBox_->setChecked(true);
-
- gammaSlider_->setValue(18); // 1.8
- sizeDoubleSpinBox_->setValue(20);
- dpiSpinBox_->setValue(96);
- zoomSpinBox_->setValue(20);
-
- checkHinting();
- checkHintingMode();
- checkAutoHinting();
- checkAntiAliasing();
- checkLcdFilter();
- checkShowPoints();
- checkUnits();
- checkCurrentFontIndex();
- checkCurrentFaceIndex();
- checkCurrentNamedInstanceIndex();
- adjustGlyphIndex(0);
- zoom();
-}
-
-
-void
-MainGUI::readSettings()
-{
- QSettings settings;
-// QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint();
-// QSize size = settings.value("size", QSize(400, 400)).toSize();
-// resize(size);
-// move(pos);
-}
-
-
-void
-MainGUI::writeSettings()
-{
- QSettings settings;
-// settings.setValue("pos", pos());
-// settings.setValue("size", size());
-}
-
-
-// end of maingui.cpp
diff --git a/src/ftinspect/maingui.hpp b/src/ftinspect/maingui.hpp
deleted file mode 100644
index 97625af..0000000
--- a/src/ftinspect/maingui.hpp
+++ /dev/null
@@ -1,251 +0,0 @@
-// maingui.hpp
-
-// Copyright (C) 2016-2022 by Werner Lemberg.
-
-
-#pragma once
-
-#include "engine/engine.hpp"
-#include "glyphcomponents/glyphbitmap.hpp"
-#include "glyphcomponents/glyphoutline.hpp"
-#include "glyphcomponents/glyphpointnumbers.hpp"
-#include "glyphcomponents/glyphpoints.hpp"
-#include "widgets/customwidgets.hpp"
-#include "models/customcomboboxmodels.hpp"
-
-#include <QAction>
-#include <QCheckBox>
-#include <QCloseEvent>
-#include <QComboBox>
-#include <QDoubleSpinBox>
-#include <QFileSystemWatcher>
-#include <QGridLayout>
-#include <QHash>
-#include <QHBoxLayout>
-#include <QLabel>
-#include <QList>
-#include <QMainWindow>
-#include <QMap>
-#include <QMenu>
-#include <QMenuBar>
-#include <QPen>
-#include <QPushButton>
-#include <QScrollBar>
-#include <QSignalMapper>
-#include <QSlider>
-#include <QSpinBox>
-#include <QStatusBar>
-#include <QTabWidget>
-#include <QTimer>
-#include <QVariant>
-#include <QVBoxLayout>
-
-#include <ft2build.h>
-#include <freetype/ftlcdfil.h>
-
-
-class MainGUI
-: public QMainWindow
-{
- Q_OBJECT
-
-public:
- MainGUI(Engine* engine);
- ~MainGUI();
-
- void setDefaults();
-
- friend class Engine;
- friend FT_Error faceRequester(FTC_FaceID,
- FT_Library,
- FT_Pointer,
- FT_Face*);
-
-protected:
- void closeEvent(QCloseEvent*);
-
-private slots:
- void about();
- void aboutQt();
- void adjustGlyphIndex(int);
- void checkAntiAliasing();
- void checkAutoHinting();
- void checkCurrentFaceIndex();
- void checkCurrentFontIndex();
- void checkCurrentNamedInstanceIndex();
- void checkHinting();
- void checkHintingMode();
- void checkLcdFilter();
- void checkShowPoints();
- void checkUnits();
- void closeFont();
- void drawGlyph();
- void loadFonts();
- void nextFace();
- void nextFont();
- void nextNamedInstance();
- void previousFace();
- void previousFont();
- void previousNamedInstance();
- void watchCurrentFont();
- void zoom();
-
-private:
- Engine* engine_;
-
- int currentFontIndex_;
-
- long currentNumberOfFaces_;
- long currentFaceIndex_;
-
- int currentNumberOfNamedInstances_;
- int currentNamedInstanceIndex_;
-
- int currentNumberOfGlyphs_;
- int currentGlyphIndex_;
-
- int currentCFFHintingMode_;
- int currentTTInterpreterVersion_;
-
- // layout related stuff
- GlyphOutline *currentGlyphOutlineItem_;
- GlyphPoints *currentGlyphPointsItem_;
- GlyphPointNumbers *currentGlyphPointNumbersItem_;
- GlyphBitmap *currentGlyphBitmapItem_;
-
- QAction *aboutAct_;
- QAction *aboutQtAct_;
- QAction *closeFontAct_;
- QAction *exitAct_;
- QAction *loadFontsAct_;
-
- QCheckBox *autoHintingCheckBox_;
- QCheckBox *blueZoneHintingCheckBox_;
- QCheckBox *hintingCheckBox_;
- QCheckBox *horizontalHintingCheckBox_;
- QCheckBox *segmentDrawingCheckBox_;
- QCheckBox *showBitmapCheckBox_;
- QCheckBox *showOutlinesCheckBox_;
- QCheckBox *showPointNumbersCheckBox_;
- QCheckBox *showPointsCheckBox_;
- QCheckBox *verticalHintingCheckBox_;
-
- AntiAliasingComboBoxModel* antiAliasingComboBoxModel_;
- HintingModeComboBoxModel* hintingModeComboBoxModel_;
- LCDFilterComboBoxModel* lcdFilterComboboxModel_;
-
- QComboBox *antiAliasingComboBox_;
- QComboBox *hintingModeComboBox_;
- QComboBox *lcdFilterComboBox_;
- QComboBox *unitsComboBox_;
-
- QDoubleSpinBox *sizeDoubleSpinBox_;
-
- QGraphicsScene *glyphScene_;
- QGraphicsViewx *glyphView_;
-
- QGridLayout *fontLayout;
- QGridLayout *infoRightLayout;
-
- QHBoxLayout *antiAliasingLayout_;
- QHBoxLayout *blueZoneHintingLayout_;
- QHBoxLayout *ftinspectLayout_;
- QHBoxLayout *gammaLayout_;
- QHBoxLayout *hintingModeLayout_;
- QHBoxLayout *horizontalHintingLayout_;
- QHBoxLayout *infoLeftLayout_;
- QHBoxLayout *lcdFilterLayout_;
- QHBoxLayout *navigationLayout_;
- QHBoxLayout *pointNumbersLayout_;
- QHBoxLayout *segmentDrawingLayout_;
- QHBoxLayout *sizeLayout_;
- QHBoxLayout *verticalHintingLayout_;
-
- QLabel *antiAliasingLabel_;
- QLabel *dpiLabel_;
- QLabel *fontFilenameLabel_;
- QLabel *fontNameLabel_;
- QLabel *gammaLabel_;
- QLabel *glyphIndexLabel_;
- QLabel *glyphNameLabel_;
- QLabel *hintingModeLabel_;
- QLabel *lcdFilterLabel_;
- QLabel *sizeLabel_;
- QLabel *zoomLabel_;
-
- QLocale *locale_;
-
- QMenu *menuFile_;
- QMenu *menuHelp_;
-
- QPen axisPen_;
- QPen blueZonePen_;
- QPen gridPen_;
- QPen offPen_;
- QPen onPen_;
- QPen outlinePen_;
- QPen segmentPen_;
-
- QPushButton *nextFaceButton_;
- QPushButton *nextFontButton_;
- QPushButton *nextNamedInstanceButton_;
- QPushButton *previousFaceButton_;
- QPushButton *previousFontButton_;
- QPushButton *previousNamedInstanceButton_;
-
- QPushButton *toEndButtonx_;
- QPushButton *toM1000Buttonx_;
- QPushButton *toM100Buttonx_;
- QPushButton *toM10Buttonx_;
- QPushButton *toM1Buttonx_;
- QPushButton *toP1000Buttonx_;
- QPushButton *toP100Buttonx_;
- QPushButton *toP10Buttonx_;
- QPushButton *toP1Buttonx_;
- QPushButton *toStartButtonx_;
-
- QSignalMapper *glyphNavigationMapper_;
-
- QSlider *gammaSlider_;
-
- QSpinBox *dpiSpinBox_;
- ZoomSpinBox *zoomSpinBox_;
-
- QTabWidget *tabWidget_;
-
- QVBoxLayout *generalTabLayout_;
- QVBoxLayout *leftLayout_;
- QVBoxLayout *rightLayout_;
-
- QVector<QRgb> grayColorTable_;
- QVector<QRgb> monoColorTable_;
-
- QWidget *ftinspectWidget_;
- QWidget *generalTabWidget_;
- QWidget *leftWidget_;
- QWidget *rightWidget_;
- QWidget *mmgxTabWidget_;
-
- enum Units
- {
- Units_px,
- Units_pt
- };
-
- void showFont();
- void applySettings();
- void clearStatusBar();
-
- void createActions();
- void createConnections();
- void createLayout();
- void createMenus();
- void createStatusBar();
- void setGraphicsDefaults();
-
- void readSettings();
- void writeSettings();
-};
-
-
-// end of maingui.hpp
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2-demos] master 996dbf2 08/41: [ftinspect] WIP: Rewrite `MainGUI`.,
Werner Lemberg <=