diff --git a/qrenderdoc/Code/Interface/PersistantConfig.h b/qrenderdoc/Code/Interface/PersistantConfig.h
index 2d9061dc1..5c074d27d 100644
--- a/qrenderdoc/Code/Interface/PersistantConfig.h
+++ b/qrenderdoc/Code/Interface/PersistantConfig.h
@@ -497,6 +497,12 @@ DECLARE_REFLECTION_STRUCT(BugReport);
"Defaults to an empty string which means to use the system default."); \
CONFIG_SETTING_VAL(public, QString, rdcstr, Font_Family, "") \
\
+ DOCUMENT( \
+ "The monospaced font family to use in the UI.\n" \
+ "\n" \
+ "Defaults to an empty string which means to use the system default."); \
+ CONFIG_SETTING_VAL(public, QString, rdcstr, Font_MonoFamily, "") \
+ \
DOCUMENT( \
"``True`` if a monospaced font should be used in all places where data is displayed, even " \
"if the data is not tabular such as names.\n" \
diff --git a/qrenderdoc/Code/QRDUtils.cpp b/qrenderdoc/Code/QRDUtils.cpp
index 5a917802c..3712bf635 100644
--- a/qrenderdoc/Code/QRDUtils.cpp
+++ b/qrenderdoc/Code/QRDUtils.cpp
@@ -2401,6 +2401,7 @@ QFont *Formatter::m_FixedFont = NULL;
float Formatter::m_FontBaseSize = 10.0f; // this should always be overridden below, but just in
// case let's pick a sensible value
QString Formatter::m_DefaultFontFamily;
+QString Formatter::m_DefaultMonoFontFamily;
float Formatter::m_FixedFontBaseSize = 10.0f;
QColor Formatter::m_DarkChecker, Formatter::m_LightChecker;
@@ -2421,16 +2422,27 @@ void Formatter::setParams(const PersistantConfig &config)
m_FixedFont = new QFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
m_FixedFontBaseSize = m_FixedFont->pointSizeF();
m_DefaultFontFamily = QApplication::font().family();
+ m_DefaultMonoFontFamily = QFontDatabase::systemFont(QFontDatabase::FixedFont).family();
}
// this is only used for display to the user
if(m_DefaultFontFamily.isEmpty())
m_DefaultFontFamily = lit("System font");
+ if(m_DefaultMonoFontFamily.isEmpty())
+ m_DefaultMonoFontFamily = lit("System font");
- *m_Font =
- config.Font_PreferMonospaced ? QFontDatabase::systemFont(QFontDatabase::FixedFont) : QFont();
- if(!config.Font_Family.isEmpty())
- m_Font->setFamily(config.Font_Family);
+ if(config.Font_PreferMonospaced)
+ {
+ *m_Font = QFontDatabase::systemFont(QFontDatabase::FixedFont);
+ if(!config.Font_MonoFamily.isEmpty())
+ m_Font->setFamily(config.Font_MonoFamily);
+ }
+ else
+ {
+ *m_Font = QFont();
+ if(!config.Font_Family.isEmpty())
+ m_Font->setFamily(config.Font_Family);
+ }
m_Font->setPointSizeF(m_FontBaseSize * config.Font_GlobalScale);
QFont f = QApplication::font();
@@ -2439,6 +2451,9 @@ void Formatter::setParams(const PersistantConfig &config)
f.setFamily(config.Font_Family);
QApplication::setFont(f);
+ if(!config.Font_MonoFamily.isEmpty())
+ m_FixedFont->setFamily(config.Font_MonoFamily);
+
m_FixedFont->setPointSizeF(m_FixedFontBaseSize * config.Font_GlobalScale);
Formatter::setPalette(QApplication::palette());
diff --git a/qrenderdoc/Code/QRDUtils.h b/qrenderdoc/Code/QRDUtils.h
index c86352e94..0036284ab 100644
--- a/qrenderdoc/Code/QRDUtils.h
+++ b/qrenderdoc/Code/QRDUtils.h
@@ -262,12 +262,13 @@ struct Formatter
static const QColor DarkCheckerColor() { return m_DarkChecker; }
static const QColor LightCheckerColor() { return m_LightChecker; }
static QString DefaultFontFamily() { return m_DefaultFontFamily; }
+ static QString DefaultMonoFontFamily() { return m_DefaultMonoFontFamily; }
private:
static int m_minFigures, m_maxFigures, m_expNegCutoff, m_expPosCutoff;
static double m_expNegValue, m_expPosValue;
static QFont *m_Font, *m_FixedFont;
static float m_FontBaseSize, m_FixedFontBaseSize;
- static QString m_DefaultFontFamily;
+ static QString m_DefaultFontFamily, m_DefaultMonoFontFamily;
static QColor m_DarkChecker, m_LightChecker;
};
diff --git a/qrenderdoc/Windows/Dialogs/SettingsDialog.cpp b/qrenderdoc/Windows/Dialogs/SettingsDialog.cpp
index 56db3aad6..f35a3a5ec 100644
--- a/qrenderdoc/Windows/Dialogs/SettingsDialog.cpp
+++ b/qrenderdoc/Windows/Dialogs/SettingsDialog.cpp
@@ -47,9 +47,6 @@ SettingsDialog::SettingsDialog(ICaptureContext &ctx, QWidget *parent)
m_ReplayOptions = new ReplayOptionsSelector(m_Ctx, false, this);
- QStringList fontFamilies = QFontDatabase().families();
- fontFamilies.insert(0, tr("Default (%1)").arg(Formatter::DefaultFontFamily()));
-
ui->replayOptionsLayout->insertWidget(0, m_ReplayOptions);
QString styleChooseTooltip = ui->UIStyle->toolTip();
@@ -63,14 +60,13 @@ SettingsDialog::SettingsDialog(ICaptureContext &ctx, QWidget *parent)
for(int i = 0; i < StyleData::numAvailable; i++)
ui->UIStyle->addItem(StyleData::availStyles[i].styleName);
+ QFontDatabase fontdb;
+
+ QStringList fontFamilies = fontdb.families();
+ fontFamilies.insert(0, tr("Default (%1)").arg(Formatter::DefaultFontFamily()));
+
ui->Font_Family->addItems(fontFamilies);
- ui->Font_GlobalScale->addItems({lit("50%"), lit("75%"), lit("100%"), lit("125%"), lit("150%"),
- lit("175%"), lit("200%"), lit("250%"), lit("300%"), lit("400%")});
-
- ui->Font_GlobalScale->setCurrentText(
- QString::number(ceil(m_Ctx.Config().Font_GlobalScale * 100)) + lit("%"));
-
int curFontOption = -1;
for(int i = 0; i < ui->Font_Family->count(); i++)
{
@@ -86,6 +82,49 @@ SettingsDialog::SettingsDialog(ICaptureContext &ctx, QWidget *parent)
ui->Font_Family->setCurrentIndex(curFontOption);
+ // remove the default again
+ fontFamilies.removeAt(0);
+
+ // remove any non-fixed width fonts
+ for(int i = 0; i < fontFamilies.count();)
+ {
+ if(!fontdb.isFixedPitch(fontFamilies[i]))
+ {
+ fontFamilies.removeAt(i);
+ // check i again
+ continue;
+ }
+
+ // move to the next
+ i++;
+ }
+
+ // re-add the default
+ fontFamilies.insert(0, tr("Default (%1)").arg(Formatter::DefaultMonoFontFamily()));
+
+ ui->Font_MonoFamily->addItems(fontFamilies);
+
+ curFontOption = -1;
+ for(int i = 0; i < ui->Font_MonoFamily->count(); i++)
+ {
+ if(ui->Font_MonoFamily->itemText(i) == m_Ctx.Config().Font_MonoFamily)
+ {
+ curFontOption = i;
+ break;
+ }
+ }
+
+ if(m_Ctx.Config().Font_MonoFamily.isEmpty() || curFontOption < 0)
+ curFontOption = 0;
+
+ ui->Font_MonoFamily->setCurrentIndex(curFontOption);
+
+ ui->Font_GlobalScale->addItems({lit("50%"), lit("75%"), lit("100%"), lit("125%"), lit("150%"),
+ lit("175%"), lit("200%"), lit("250%"), lit("300%"), lit("400%")});
+
+ ui->Font_GlobalScale->setCurrentText(
+ QString::number(ceil(m_Ctx.Config().Font_GlobalScale * 100)) + lit("%"));
+
for(int i = 0; i < ui->Font_GlobalScale->count(); i++)
{
if(ui->Font_GlobalScale->currentText() == ui->Font_GlobalScale->itemText(i))
@@ -347,6 +386,21 @@ void SettingsDialog::on_Font_Family_currentIndexChanged(int index)
m_Ctx.Config().Save();
}
+void SettingsDialog::on_Font_MonoFamily_currentIndexChanged(int index)
+{
+ if(m_Init)
+ return;
+
+ if(index == 0)
+ m_Ctx.Config().Font_MonoFamily.clear();
+ else
+ m_Ctx.Config().Font_MonoFamily = ui->Font_MonoFamily->currentText();
+
+ m_Ctx.Config().SetupFormatting();
+
+ m_Ctx.Config().Save();
+}
+
void SettingsDialog::on_Font_GlobalScale_currentIndexChanged(int index)
{
Font_GlobalScale_returnPressed();
diff --git a/qrenderdoc/Windows/Dialogs/SettingsDialog.h b/qrenderdoc/Windows/Dialogs/SettingsDialog.h
index c0e012550..79a32a323 100644
--- a/qrenderdoc/Windows/Dialogs/SettingsDialog.h
+++ b/qrenderdoc/Windows/Dialogs/SettingsDialog.h
@@ -57,6 +57,7 @@ private slots:
// general
void on_Font_Family_currentIndexChanged(int index);
+ void on_Font_MonoFamily_currentIndexChanged(int index);
void on_Font_GlobalScale_currentIndexChanged(int index);
void Font_GlobalScale_returnPressed();
void on_UIStyle_currentIndexChanged(int index);
diff --git a/qrenderdoc/Windows/Dialogs/SettingsDialog.ui b/qrenderdoc/Windows/Dialogs/SettingsDialog.ui
index bb52efdb8..211a8200c 100644
--- a/qrenderdoc/Windows/Dialogs/SettingsDialog.ui
+++ b/qrenderdoc/Windows/Dialogs/SettingsDialog.ui
@@ -7,7 +7,7 @@
0
0
564
- 554
+ 580
@@ -66,7 +66,7 @@
QTabWidget::West
- 3
+ 0
true
@@ -129,12 +129,26 @@
The default font family to be used for text. This will be overridden by the default monospace font if the below option for monospace override is chosen.
-
- false
-
-
+
+
+ The default font family to be used for monospaced text, typically code display or tables of buffer data. If the below option for monospace override is chosen this font will be used for those extra places.
+
+
+ Monospaced font family (restart required)
+
+
+
+ -
+
+
+ The default font family to be used for monospaced text, typically code display or tables of buffer data. If the below option for monospace override is chosen this font will be used for those extra places.
+
+
+
+ -
A global scale for all fonts in the program. This will only scale text, icons and other UI elements will be scaled according to DPI settings as normal.
@@ -144,7 +158,7 @@
- -
+
-
A global scale for all fonts in the program. This will only scale text, icons and other UI elements will be scaled according to DPI settings as normal.
@@ -154,34 +168,34 @@
- -
+
-
- Wherever possible a monospaced font will be used instead of the default font
+ Prefer using a monospace font instead of the default font for places where resource names, action and marker names, and similar pieces of information are displayed.</p><p><br/></p><p>By default a monospaced font will only be used for places where fixed width is important such as code and numerical data displays.
Prefer monospaced fonts in UI (restart required)
- -
+
-
- Wherever possible a monospaced font will be used instead of the default font
+ Prefer using a monospace font instead of the default font for places where resource names, action and marker names, and similar pieces of information are displayed.</p><p><br/></p><p>By default a monospaced font will only be used for places where fixed width is important such as code and numerical data displays.
- -
+
-
Qt::Horizontal
- -
+
-
At least this many decimal places will be displayed on floats.
@@ -192,7 +206,7 @@ e.g. a value of 2 means 0 will display as 0.00, 0.5 as 0.50. A value of 5 would
- -
+
-
Decimals will display at least this many digits.
@@ -203,7 +217,7 @@ e.g. a value of 2 means 0 will display as 0.00, 0.5 as 0.50
- -
+
-
No more decimal places than this will be displayed on floats.
@@ -214,7 +228,7 @@ e.g. a value of 5 means 0.123456789 will display as 0.12345
- -
+
-
No more decimal places than this will be displayed on floats.
@@ -225,7 +239,7 @@ e.g. a value of 5 means 0.123456789 will display as 0.12345 and 123.123456789 wi
- -
+
-
Any numbers smaller than this exponent will be displayed in scientific notation.
@@ -236,7 +250,7 @@ E.g. a value of 3 means 0.005 / 10 = 5E-4
- -
+
-
Any numbers smaller than this exponent will be displayed in scientific notation.
@@ -247,7 +261,7 @@ E.g. a value of 3 means 0.005 / 10 = 5E-4
- -
+
-
Any numbers larger than this exponent will be displayed in scientific notation.
@@ -258,7 +272,7 @@ e.g. 1000 * 10 = 1e4
- -
+
-
Any numbers larger than this exponent will be displayed in scientific notation.
@@ -272,7 +286,7 @@ e.g. 1000 * 10 = 1e4
- -
+
-
Changes the directory where capture files are saved after being created, until saved manually or deleted.
@@ -284,7 +298,7 @@ Defaults to %TEMP%.
- -
+
-
Changes the directory where capture files are saved after being created, until saved manually or deleted.
@@ -293,7 +307,7 @@ Defaults to %TEMP%.
- -
+
-
Changes the directory where capture files are saved after being created, until saved manually or deleted.
@@ -305,7 +319,7 @@ Defaults to %TEMP%.
- -
+
-
Changes the default directory for the save dialog when saving capture files.
@@ -317,7 +331,7 @@ Defaults to blank, which follows system default behaviour.
- -
+
-
Changes the default directory for the save dialog when saving capture files.
@@ -326,7 +340,7 @@ Defaults to blank, which follows system default behaviour.
- -
+
-
Changes the default directory for the save dialog when saving capture files.
@@ -338,7 +352,7 @@ Defaults to blank, which follows system default behaviour.
- -
+
-
Enables functionality on the capture application window that will insert RenderDoc automatically
@@ -353,7 +367,7 @@ Since this is a global system hook it must be used carefully and only when neces
- -
+
-
Enables functionality on the capture application window that will insert RenderDoc automatically
@@ -368,7 +382,7 @@ Since this is a global system hook it must be used carefully and only when neces
- -
+
-
Enables the ability to inject into processes on windows.
@@ -382,7 +396,7 @@ program should be launched through RenderDoc via the Launch Process panel.
- -
+
-
Enables the ability to inject into processes on windows.
@@ -396,7 +410,7 @@ program should be launched through RenderDoc via the Launch Process panel.
- -
+
-
Allows RenderDoc to phone home to https://renderdoc.org to anonymously check for new versions.
@@ -406,7 +420,7 @@ program should be launched through RenderDoc via the Launch Process panel.
- -
+
-
Allows RenderDoc to phone home to https://renderdoc.org to anonymously check for new versions.
@@ -416,7 +430,7 @@ program should be launched through RenderDoc via the Launch Process panel.
- -
+
-
If a capture is marked as being created on a significantly different system (different OS or platform)
@@ -429,7 +443,7 @@ This option overrides that and will always replay locally if the local context i
- -
+
-
If a capture is marked as being created on a significantly different system (different OS or platform)
@@ -442,7 +456,7 @@ This option overrides that and will always replay locally if the local context i
- -
+
-
Qt::Vertical
diff --git a/qrenderdoc/Windows/TextureViewer.ui b/qrenderdoc/Windows/TextureViewer.ui
index ec6e10345..32c70012c 100644
--- a/qrenderdoc/Windows/TextureViewer.ui
+++ b/qrenderdoc/Windows/TextureViewer.ui
@@ -1068,11 +1068,6 @@ See FAQ on "Gamma display of linear data"
0
-
-
- Consolas
-
-
texStatusName