... |
... |
@@ -6,6 +6,9 @@ |
6
|
6
|
|
7
|
7
|
#include "../uihelper.hpp"
|
8
|
8
|
|
|
9
|
+// for `FT_DEBUG_AUTOFIT`
|
|
10
|
+#include <freetype/config/ftoption.h>
|
|
11
|
+
|
9
|
12
|
SettingPanel::SettingPanel(QWidget* parent,
|
10
|
13
|
Engine* engine,
|
11
|
14
|
bool comparatorMode)
|
... |
... |
@@ -13,6 +16,11 @@ SettingPanel::SettingPanel(QWidget* parent, |
13
|
16
|
engine_(engine),
|
14
|
17
|
comparatorMode_(comparatorMode)
|
15
|
18
|
{
|
|
19
|
+#ifdef FT_DEBUG_AUTOFIT
|
|
20
|
+ debugMode_ = !comparatorMode_;
|
|
21
|
+#else
|
|
22
|
+ debugMode_ = false;
|
|
23
|
+#endif
|
16
|
24
|
createLayout();
|
17
|
25
|
setDefaults();
|
18
|
26
|
createConnections();
|
... |
... |
@@ -83,10 +91,13 @@ SettingPanel::onFontChanged() |
83
|
91
|
hintingModeComboBox_->setEnabled(false);
|
84
|
92
|
|
85
|
93
|
autoHintingCheckBox_->setEnabled(false);
|
86
|
|
- horizontalHintingCheckBox_->setEnabled(false);
|
87
|
|
- verticalHintingCheckBox_->setEnabled(false);
|
88
|
|
- blueZoneHintingCheckBox_->setEnabled(false);
|
89
|
|
- segmentDrawingCheckBox_->setEnabled(false);
|
|
94
|
+ if (debugMode_)
|
|
95
|
+ {
|
|
96
|
+ horizontalHintingCheckBox_->setEnabled(false);
|
|
97
|
+ verticalHintingCheckBox_->setEnabled(false);
|
|
98
|
+ blueZoneHintingCheckBox_->setEnabled(false);
|
|
99
|
+ segmentDrawingCheckBox_->setEnabled(false);
|
|
100
|
+ }
|
90
|
101
|
|
91
|
102
|
antiAliasingComboBoxModel_->setLightAntiAliasingEnabled(false);
|
92
|
103
|
if (antiAliasingComboBox_->currentIndex()
|
... |
... |
@@ -188,10 +199,13 @@ SettingPanel::checkAutoHinting() |
188
|
199
|
hintingModeLabel_->setEnabled(false);
|
189
|
200
|
hintingModeComboBox_->setEnabled(false);
|
190
|
201
|
|
191
|
|
- horizontalHintingCheckBox_->setEnabled(true);
|
192
|
|
- verticalHintingCheckBox_->setEnabled(true);
|
193
|
|
- blueZoneHintingCheckBox_->setEnabled(true);
|
194
|
|
- segmentDrawingCheckBox_->setEnabled(true);
|
|
202
|
+ if (debugMode_)
|
|
203
|
+ {
|
|
204
|
+ horizontalHintingCheckBox_->setEnabled(true);
|
|
205
|
+ verticalHintingCheckBox_->setEnabled(true);
|
|
206
|
+ blueZoneHintingCheckBox_->setEnabled(true);
|
|
207
|
+ segmentDrawingCheckBox_->setEnabled(true);
|
|
208
|
+ }
|
195
|
209
|
|
196
|
210
|
antiAliasingComboBoxModel_->setLightAntiAliasingEnabled(true);
|
197
|
211
|
}
|
... |
... |
@@ -204,10 +218,13 @@ SettingPanel::checkAutoHinting() |
204
|
218
|
hintingModeComboBox_->setEnabled(true);
|
205
|
219
|
}
|
206
|
220
|
|
207
|
|
- horizontalHintingCheckBox_->setEnabled(false);
|
208
|
|
- verticalHintingCheckBox_->setEnabled(false);
|
209
|
|
- blueZoneHintingCheckBox_->setEnabled(false);
|
210
|
|
- segmentDrawingCheckBox_->setEnabled(false);
|
|
221
|
+ if (debugMode_)
|
|
222
|
+ {
|
|
223
|
+ horizontalHintingCheckBox_->setEnabled(false);
|
|
224
|
+ verticalHintingCheckBox_->setEnabled(false);
|
|
225
|
+ blueZoneHintingCheckBox_->setEnabled(false);
|
|
226
|
+ segmentDrawingCheckBox_->setEnabled(false);
|
|
227
|
+ }
|
211
|
228
|
|
212
|
229
|
antiAliasingComboBoxModel_->setLightAntiAliasingEnabled(false);
|
213
|
230
|
|
... |
... |
@@ -265,10 +282,14 @@ SettingPanel::syncSettings() |
265
|
282
|
!= AntiAliasingComboBoxModel::AntiAliasing_None);
|
266
|
283
|
engine_->setHinting(hintingCheckBox_->isChecked());
|
267
|
284
|
engine_->setAutoHinting(autoHintingCheckBox_->isChecked());
|
268
|
|
- engine_->setHorizontalHinting(horizontalHintingCheckBox_->isChecked());
|
269
|
|
- engine_->setVerticalHinting(verticalHintingCheckBox_->isChecked());
|
270
|
|
- engine_->setBlueZoneHinting(blueZoneHintingCheckBox_->isChecked());
|
271
|
|
- engine_->setShowSegments(segmentDrawingCheckBox_->isChecked());
|
|
285
|
+
|
|
286
|
+ if (debugMode_)
|
|
287
|
+ {
|
|
288
|
+ engine_->setHorizontalHinting(horizontalHintingCheckBox_->isChecked());
|
|
289
|
+ engine_->setVerticalHinting(verticalHintingCheckBox_->isChecked());
|
|
290
|
+ engine_->setBlueZoneHinting(blueZoneHintingCheckBox_->isChecked());
|
|
291
|
+ engine_->setShowSegments(segmentDrawingCheckBox_->isChecked());
|
|
292
|
+ }
|
272
|
293
|
|
273
|
294
|
engine_->setGamma(gammaSlider_->value());
|
274
|
295
|
|
... |
... |
@@ -306,7 +327,7 @@ SettingPanel::createConnections() |
306
|
327
|
connect(hintingCheckBox_, &QCheckBox::clicked,
|
307
|
328
|
this, &SettingPanel::repaintNeeded);
|
308
|
329
|
|
309
|
|
- if (!comparatorMode_)
|
|
330
|
+ if (debugMode_)
|
310
|
331
|
{
|
311
|
332
|
connect(horizontalHintingCheckBox_, &QCheckBox::clicked,
|
312
|
333
|
this, &SettingPanel::repaintNeeded);
|
... |
... |
@@ -349,10 +370,15 @@ SettingPanel::createLayout() |
349
|
370
|
hintingModeLabel_->setBuddy(hintingModeComboBox_);
|
350
|
371
|
|
351
|
372
|
autoHintingCheckBox_ = new QCheckBox(tr("Auto-Hinting"), this);
|
352
|
|
- horizontalHintingCheckBox_ = new QCheckBox(tr("Horizontal Hinting"), this);
|
353
|
|
- verticalHintingCheckBox_ = new QCheckBox(tr("Vertical Hinting"), this);
|
354
|
|
- blueZoneHintingCheckBox_ = new QCheckBox(tr("Blue-Zone Hinting"), this);
|
355
|
|
- segmentDrawingCheckBox_ = new QCheckBox(tr("Segment Drawing"), this);
|
|
373
|
+
|
|
374
|
+ if (debugMode_)
|
|
375
|
+ {
|
|
376
|
+ horizontalHintingCheckBox_ = new QCheckBox(tr("Horizontal Hinting"), this);
|
|
377
|
+ verticalHintingCheckBox_ = new QCheckBox(tr("Vertical Hinting"), this);
|
|
378
|
+ blueZoneHintingCheckBox_ = new QCheckBox(tr("Blue-Zone Hinting"), this);
|
|
379
|
+ segmentDrawingCheckBox_ = new QCheckBox(tr("Segment Drawing"), this);
|
|
380
|
+ }
|
|
381
|
+
|
356
|
382
|
embeddedBitmapCheckBox_ = new QCheckBox(tr("Enable Embedded Bitmap"), this);
|
357
|
383
|
colorLayerCheckBox_ = new QCheckBox(tr("Enable Color Layer"), this);
|
358
|
384
|
|
... |
... |
@@ -409,12 +435,15 @@ SettingPanel::createLayout() |
409
|
435
|
gammaSlider_->setTickInterval(5);
|
410
|
436
|
gammaLabel_->setBuddy(gammaSlider_);
|
411
|
437
|
|
412
|
|
- debugLayout_ = new QVBoxLayout;
|
413
|
|
- debugLayout_->setContentsMargins(20, 0, 0, 0);
|
414
|
|
- debugLayout_->addWidget(horizontalHintingCheckBox_);
|
415
|
|
- debugLayout_->addWidget(verticalHintingCheckBox_);
|
416
|
|
- debugLayout_->addWidget(blueZoneHintingCheckBox_);
|
417
|
|
- debugLayout_->addWidget(segmentDrawingCheckBox_);
|
|
438
|
+ if (debugMode_)
|
|
439
|
+ {
|
|
440
|
+ debugLayout_ = new QVBoxLayout;
|
|
441
|
+ debugLayout_->setContentsMargins(20, 0, 0, 0);
|
|
442
|
+ debugLayout_->addWidget(horizontalHintingCheckBox_);
|
|
443
|
+ debugLayout_->addWidget(verticalHintingCheckBox_);
|
|
444
|
+ debugLayout_->addWidget(blueZoneHintingCheckBox_);
|
|
445
|
+ debugLayout_->addWidget(segmentDrawingCheckBox_);
|
|
446
|
+ }
|
418
|
447
|
|
419
|
448
|
gammaLayout_ = new QHBoxLayout;
|
420
|
449
|
gammaLayout_->addWidget(gammaLabel_);
|
... |
... |
@@ -427,7 +456,7 @@ SettingPanel::createLayout() |
427
|
456
|
hintingModeLabel_, hintingModeComboBox_);
|
428
|
457
|
gridLayout2ColAddWidget(generalTabLayout_, autoHintingCheckBox_);
|
429
|
458
|
|
430
|
|
- if (!comparatorMode_)
|
|
459
|
+ if (debugMode_)
|
431
|
460
|
gridLayout2ColAddLayout(generalTabLayout_, debugLayout_);
|
432
|
461
|
|
433
|
462
|
if (!comparatorMode_)
|
... |
... |
@@ -514,10 +543,14 @@ SettingPanel::setDefaults() |
514
|
543
|
lcdFilterComboBox_->setCurrentIndex(
|
515
|
544
|
LCDFilterComboBoxModel::LCDFilter_Light);
|
516
|
545
|
|
517
|
|
- horizontalHintingCheckBox_->setChecked(true);
|
518
|
|
- verticalHintingCheckBox_->setChecked(true);
|
519
|
|
- blueZoneHintingCheckBox_->setChecked(true);
|
520
|
|
- embeddedBitmapCheckBox_->setChecked(false);
|
|
546
|
+ if (debugMode_)
|
|
547
|
+ {
|
|
548
|
+ horizontalHintingCheckBox_->setChecked(true);
|
|
549
|
+ verticalHintingCheckBox_->setChecked(true);
|
|
550
|
+ blueZoneHintingCheckBox_->setChecked(true);
|
|
551
|
+ embeddedBitmapCheckBox_->setChecked(false);
|
|
552
|
+ }
|
|
553
|
+
|
521
|
554
|
colorLayerCheckBox_->setChecked(true);
|
522
|
555
|
|
523
|
556
|
if (comparatorMode_)
|