Skip to content

Commit

Permalink
Merge tbc_font
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-jr committed May 25, 2022
2 parents edbcba9 + 6547a02 commit 9929a59
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions configure.ac
Expand Up @@ -2100,6 +2100,7 @@ AM_CONDITIONAL([TARGET_DARWIN], [test "$TARGET_OS" = "darwin"])
AM_CONDITIONAL([BUILD_DARWIN], [test "$BUILD_OS" = "darwin"])
AM_CONDITIONAL([TARGET_LINUX], [test "$TARGET_OS" = "linux"])
AM_CONDITIONAL([TARGET_WINDOWS], [test "$TARGET_OS" = "windows"])
AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != ""])
AM_CONDITIONAL([ENABLE_WALLET], [test "$enable_wallet" = "yes"])
AM_CONDITIONAL([USE_SQLITE], [test "$use_sqlite" = "yes"])
AM_CONDITIONAL([USE_BDB], [test "$use_bdb" = "yes"])
Expand Down
13 changes: 13 additions & 0 deletions src/Makefile.am
Expand Up @@ -971,6 +971,19 @@ if ENABLE_BENCH
include Makefile.bench.include
endif

# Font handling must be here, not in Makefile.qt.include, since the output is distributed with the source tarball
RES_MONOSPACE_FONT_INPUT = qt/res/fonts/RobotoTonalMono-Bold.ttf.in
RES_MONOSPACE_FONT = qt/res/fonts/RobotoTonalMono-Bold.ttf
EXTRA_DIST += $(RES_MONOSPACE_FONT_INPUT) $(RES_MONOSPACE_FONT)

if HAVE_PYTHON

$(RES_MONOSPACE_FONT): $(RES_MONOSPACE_FONT_INPUT)
@$(MKDIR_P) "$(@D)"
$(AM_V_GEN) $(PYTHON) -c 'import base64, lzma, sys; sys.stdout.buffer.write(lzma.decompress(base64.b85decode(sys.stdin.read())))' <"$<" >"$@.new" && mv "$@.new" "$@"

endif

if ENABLE_QT
include Makefile.qt.include
endif
Expand Down
4 changes: 2 additions & 2 deletions src/Makefile.qt.include
Expand Up @@ -178,7 +178,7 @@ BITCOIN_QT_H = \
qt/winshutdownmonitor.h

QT_RES_FONTS = \
qt/res/fonts/RobotoMono-Bold.ttf
$(RES_MONOSPACE_FONT)

QT_RES_ICONS = $(RES_RENDERED_ICONS) \
qt/res/icons/add.png \
Expand Down Expand Up @@ -388,7 +388,7 @@ $(QT_QRC_LOCALE_CPP): $(QT_QRC_LOCALE) $(QT_QM)
@rm $(@D)/temp_$(<F)

$(QT_QRC_BUILD): $(QT_QRC)
$(SED) -e 's:\(res\/\(icons\|animation\|fonts\)/\):$(abs_srcdir)/qt/\1:' <"$<" >"$@"
$(SED) -e 's:\(res\/\(icons\|animation\)/\):$(abs_srcdir)/qt/\1:' <"$<" >"$@"

$(QT_QRC_CPP): $(QT_QRC_BUILD) $(QT_FORMS_H) $(QT_RES_FONTS) $(QT_RES_ICONS) $(QT_RES_ANIMATION)
@test -f $(RCC)
Expand Down
2 changes: 1 addition & 1 deletion src/qt/bitcoin.qrc
Expand Up @@ -84,6 +84,6 @@
<file alias="spinner-035">res/animation/spinner-035.png</file>
</qresource>
<qresource prefix="/fonts">
<file alias="monospace">res/fonts/RobotoMono-Bold.ttf</file>
<file alias="monospace">res/fonts/RobotoTonalMono-Bold.ttf</file>
</qresource>
</RCC>
1 change: 1 addition & 0 deletions src/qt/res/fonts/RobotoTonalMono-Bold.ttf.in

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/qt/tonalutils.cpp
Expand Up @@ -33,8 +33,8 @@ bool TonalUtils::Supported()
{
QFont default_font;
if (font_supports_tonal(default_font)) return true;
QFont last_resort_font(default_font.lastResortFamily());
if (font_supports_tonal(last_resort_font)) return true;
// FIXME: This will fail if the default font has some non-Tonal glyphs but a fallback supports Tonal
// TODO: Check other fonts and ensure their usage when appropriate
return false;
}

Expand Down

0 comments on commit 9929a59

Please sign in to comment.