partial bitcoin-core/gui#79: Embed monospaced font

includes:
- 89e421918ee8b9c8439317f747e5c37f0733d94b
- 623de12d040af89ff7c25de6eb0a19c67179dc5f
This commit is contained in:
Kittywhiskers Van Gogh 2021-02-21 18:43:34 +02:00
parent 722bd8d7f3
commit 7774bdb423
No known key found for this signature in database
GPG Key ID: 30CD0C065E5C4AAD
7 changed files with 25 additions and 3 deletions

View File

@ -31,6 +31,10 @@ Files: src/qt/res/icons/proxy.png
Copyright: Cristian Mircea Messel
License: public-domain
Files: src/qt/fonts/RobotoMono-Bold.ttf
License: Apache-2.0
Comment: Site: https://fonts.google.com/specimen/Roboto+Mono
License: Expat
Permission is hereby granted, free of charge, to any person obtaining a
@ -88,3 +92,14 @@ Comment:
License: public-domain
This work is in the public domain.
License: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -352,7 +352,8 @@ RES_FONTS = \
qt/res/fonts/Montserrat/Montserrat-SemiBold.otf \
qt/res/fonts/Montserrat/Montserrat-SemiBoldItalic.otf \
qt/res/fonts/Montserrat/Montserrat-Thin.otf \
qt/res/fonts/Montserrat/Montserrat-ThinItalic.otf
qt/res/fonts/Montserrat/Montserrat-ThinItalic.otf \
qt/res/fonts/RobotoMono-Bold.ttf
RES_ANIMATION = $(wildcard $(srcdir)/qt/res/animation/spinner-*.png)

View File

@ -47,6 +47,7 @@
#include <QApplication>
#include <QDebug>
#include <QFontDatabase>
#include <QLatin1String>
#include <QLibraryInfo>
#include <QLocale>
@ -576,6 +577,7 @@ int GuiMain(int argc, char* argv[])
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
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:

View File

@ -36,6 +36,7 @@
<file alias="Traditional">res/css/traditional.css</file>
</qresource>
<qresource prefix="/fonts">
<file alias="monospace">res/fonts/RobotoMono-Bold.ttf</file>
<file alias="Montserrat-Black">res/fonts/Montserrat/Montserrat-Black.otf</file>
<file alias="Montserrat-BlackItalic">res/fonts/Montserrat/Montserrat-BlackItalic.otf</file>
<file alias="Montserrat-Bold">res/fonts/Montserrat/Montserrat-Bold.otf</file>

View File

@ -260,8 +260,11 @@ QString dateTimeStr(qint64 nTime)
return dateTimeStr(QDateTime::fromTime_t((qint32)nTime));
}
QFont fixedPitchFont()
QFont fixedPitchFont(bool use_embedded_font)
{
if (use_embedded_font) {
return {"Roboto Mono"};
}
return QFontDatabase::systemFont(QFontDatabase::FixedFont);
}

View File

@ -127,7 +127,7 @@ namespace GUIUtil
QString dateTimeStr(qint64 nTime);
// Return a monospace font
QFont fixedPitchFont();
QFont fixedPitchFont(bool use_embedded_font = false);
// Set up widget for address
void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent, bool fAllowURI = false);

Binary file not shown.