Skip to content

Commit 7774bdb

Browse files
committed
partial bitcoin-core/gui#79: Embed monospaced font
includes: - 89e4219 - 623de12
1 parent 722bd8d commit 7774bdb

File tree

7 files changed

+25
-3
lines changed

7 files changed

+25
-3
lines changed

contrib/debian/copyright

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ Files: src/qt/res/icons/proxy.png
3131
Copyright: Cristian Mircea Messel
3232
License: public-domain
3333

34+
Files: src/qt/fonts/RobotoMono-Bold.ttf
35+
License: Apache-2.0
36+
Comment: Site: https://fonts.google.com/specimen/Roboto+Mono
37+
3438

3539
License: Expat
3640
Permission is hereby granted, free of charge, to any person obtaining a
@@ -88,3 +92,14 @@ Comment:
8892

8993
License: public-domain
9094
This work is in the public domain.
95+
96+
License: Apache-2.0
97+
Licensed under the Apache License, Version 2.0 (the "License");
98+
you may not use this file except in compliance with the License.
99+
You may obtain a copy of the License at
100+
http://www.apache.org/licenses/LICENSE-2.0
101+
Unless required by applicable law or agreed to in writing, software
102+
distributed under the License is distributed on an "AS IS" BASIS,
103+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
104+
See the License for the specific language governing permissions and
105+
limitations under the License.

src/Makefile.qt.include

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,8 @@ RES_FONTS = \
352352
qt/res/fonts/Montserrat/Montserrat-SemiBold.otf \
353353
qt/res/fonts/Montserrat/Montserrat-SemiBoldItalic.otf \
354354
qt/res/fonts/Montserrat/Montserrat-Thin.otf \
355-
qt/res/fonts/Montserrat/Montserrat-ThinItalic.otf
355+
qt/res/fonts/Montserrat/Montserrat-ThinItalic.otf \
356+
qt/res/fonts/RobotoMono-Bold.ttf
356357

357358
RES_ANIMATION = $(wildcard $(srcdir)/qt/res/animation/spinner-*.png)
358359

src/qt/bitcoin.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747

4848
#include <QApplication>
4949
#include <QDebug>
50+
#include <QFontDatabase>
5051
#include <QLatin1String>
5152
#include <QLibraryInfo>
5253
#include <QLocale>
@@ -576,6 +577,7 @@ int GuiMain(int argc, char* argv[])
576577
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
577578

578579
BitcoinApplication app;
580+
QFontDatabase::addApplicationFont(":/fonts/monospace");
579581

580582
/// 2. Parse command-line options. We do this after qt in order to show an error if there are problems parsing these
581583
// Command-line options take precedence:

src/qt/dash.qrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
<file alias="Traditional">res/css/traditional.css</file>
3737
</qresource>
3838
<qresource prefix="/fonts">
39+
<file alias="monospace">res/fonts/RobotoMono-Bold.ttf</file>
3940
<file alias="Montserrat-Black">res/fonts/Montserrat/Montserrat-Black.otf</file>
4041
<file alias="Montserrat-BlackItalic">res/fonts/Montserrat/Montserrat-BlackItalic.otf</file>
4142
<file alias="Montserrat-Bold">res/fonts/Montserrat/Montserrat-Bold.otf</file>

src/qt/guiutil.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,11 @@ QString dateTimeStr(qint64 nTime)
260260
return dateTimeStr(QDateTime::fromTime_t((qint32)nTime));
261261
}
262262

263-
QFont fixedPitchFont()
263+
QFont fixedPitchFont(bool use_embedded_font)
264264
{
265+
if (use_embedded_font) {
266+
return {"Roboto Mono"};
267+
}
265268
return QFontDatabase::systemFont(QFontDatabase::FixedFont);
266269
}
267270

src/qt/guiutil.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ namespace GUIUtil
127127
QString dateTimeStr(qint64 nTime);
128128

129129
// Return a monospace font
130-
QFont fixedPitchFont();
130+
QFont fixedPitchFont(bool use_embedded_font = false);
131131

132132
// Set up widget for address
133133
void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent, bool fAllowURI = false);
85 KB
Binary file not shown.

0 commit comments

Comments
 (0)