Skip to content

Commit

Permalink
gui: Add IBM Plex Mono font
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed Aug 28, 2020
1 parent ca30d34 commit 15f37db
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 28 deletions.
7 changes: 5 additions & 2 deletions src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ BITCOIN_QT_H = \
qt/walletview.h \
qt/winshutdownmonitor.h

RES_FONTS = \
qt/res/fonts/IBMPlexMono-Medium.ttf

RES_ICONS = \
qt/res/icons/add.png \
qt/res/icons/address-book.png \
Expand Down Expand Up @@ -288,7 +291,7 @@ qt_libbitcoinqt_a_CXXFLAGS = $(AM_CXXFLAGS) $(QT_PIE_FLAGS)
qt_libbitcoinqt_a_OBJCXXFLAGS = $(AM_OBJCXXFLAGS) $(QT_PIE_FLAGS)

qt_libbitcoinqt_a_SOURCES = $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(QT_FORMS_UI) \
$(QT_QRC) $(QT_QRC_LOCALE) $(QT_TS) $(RES_ICONS) $(RES_ANIMATION)
$(QT_QRC) $(QT_QRC_LOCALE) $(QT_TS) $(RES_FONTS) $(RES_ICONS) $(RES_ANIMATION)
if TARGET_DARWIN
qt_libbitcoinqt_a_SOURCES += $(BITCOIN_MM)
endif
Expand Down Expand Up @@ -359,7 +362,7 @@ $(QT_QRC_LOCALE_CPP): $(QT_QRC_LOCALE) $(QT_QM)
$(SED) -e '/^\*\*.*Created:/d' -e '/^\*\*.*by:/d' > $@
@rm $(@D)/temp_$(<F)

$(QT_QRC_CPP): $(QT_QRC) $(QT_FORMS_H) $(RES_ICONS) $(RES_ANIMATION)
$(QT_QRC_CPP): $(QT_QRC) $(QT_FORMS_H) $(RES_FONTS) $(RES_ICONS) $(RES_ANIMATION)
@test -f $(RCC)
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin $< | \
$(SED) -e '/^\*\*.*Created:/d' -e '/^\*\*.*by:/d' > $@
Expand Down
2 changes: 2 additions & 0 deletions src/qt/bitcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

#include <QApplication>
#include <QDebug>
#include <QFontDatabase>
#include <QLibraryInfo>
#include <QLocale>
#include <QMessageBox>
Expand Down Expand Up @@ -465,6 +466,7 @@ int GuiMain(int argc, char* argv[])
#endif

BitcoinApplication app;
QFontDatabase::addApplicationFont(":/fonts/monospace");

/// 2. Parse command-line options. We do this after qt in order to show an error if there are problems parsing these
// Command-line options take precedence:
Expand Down
3 changes: 3 additions & 0 deletions src/qt/bitcoin.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,7 @@
<file alias="spinner-034">res/animation/spinner-034.png</file>
<file alias="spinner-035">res/animation/spinner-035.png</file>
</qresource>
<qresource prefix="/fonts">
<file alias="monospace">res/fonts/IBMPlexMono-Medium.ttf</file>
</qresource>
</RCC>
2 changes: 1 addition & 1 deletion src/qt/bitcoinunits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ QString BitcoinUnits::formatWithPrivacy(int unit, const CAmount& amount, Separat
assert(amount >= 0);
QString value;
if (privacy) {
value = format(unit, 0, false, separators, true).replace('0', '#');
value = format(unit, 0, false, separators, true).replace('0', '*');
} else {
value = format(unit, amount, false, separators, true);
}
Expand Down
32 changes: 8 additions & 24 deletions src/qt/forms/overviewpage.ui
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@
<widget class="QLabel" name="labelWatchPending">
<property name="font">
<font>
<family>Monospace</family>
<weight>75</weight>
<bold>true</bold>
<family>IBM Plex Mono</family>
</font>
</property>
<property name="cursor">
Expand All @@ -144,9 +142,7 @@
<widget class="QLabel" name="labelUnconfirmed">
<property name="font">
<font>
<family>Monospace</family>
<weight>75</weight>
<bold>true</bold>
<family>IBM Plex Mono</family>
</font>
</property>
<property name="cursor">
Expand All @@ -170,9 +166,7 @@
<widget class="QLabel" name="labelWatchImmature">
<property name="font">
<font>
<family>Monospace</family>
<weight>75</weight>
<bold>true</bold>
<family>IBM Plex Mono</family>
</font>
</property>
<property name="cursor">
Expand Down Expand Up @@ -229,9 +223,7 @@
<widget class="QLabel" name="labelImmature">
<property name="font">
<font>
<family>Monospace</family>
<weight>75</weight>
<bold>true</bold>
<family>IBM Plex Mono</family>
</font>
</property>
<property name="cursor">
Expand Down Expand Up @@ -275,9 +267,7 @@
<widget class="QLabel" name="labelTotal">
<property name="font">
<font>
<family>Monospace</family>
<weight>75</weight>
<bold>true</bold>
<family>IBM Plex Mono</family>
</font>
</property>
<property name="cursor">
Expand All @@ -301,9 +291,7 @@
<widget class="QLabel" name="labelWatchTotal">
<property name="font">
<font>
<family>Monospace</family>
<weight>75</weight>
<bold>true</bold>
<family>IBM Plex Mono</family>
</font>
</property>
<property name="cursor">
Expand Down Expand Up @@ -344,9 +332,7 @@
<widget class="QLabel" name="labelBalance">
<property name="font">
<font>
<family>Monospace</family>
<weight>75</weight>
<bold>true</bold>
<family>IBM Plex Mono</family>
</font>
</property>
<property name="cursor">
Expand All @@ -370,9 +356,7 @@
<widget class="QLabel" name="labelWatchAvailable">
<property name="font">
<font>
<family>Monospace</family>
<weight>75</weight>
<bold>true</bold>
<family>IBM Plex Mono</family>
</font>
</property>
<property name="cursor">
Expand Down
2 changes: 1 addition & 1 deletion src/qt/guiutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ QString dateTimeStr(qint64 nTime)

QFont fixedPitchFont()
{
return QFontDatabase::systemFont(QFontDatabase::FixedFont);
return QFont("IBM Plex Mono");
}

// Just some dummy data to generate a convincing random-looking (but consistent) address
Expand Down
Binary file added src/qt/res/fonts/IBMPlexMono-Medium.ttf
Binary file not shown.

0 comments on commit 15f37db

Please sign in to comment.