@@ -218,7 +218,11 @@ bool OptionsModel::Init(bilingual_str& error)
218218 if (!settings.contains (" UseEmbeddedMonospacedFont" )) {
219219 settings.setValue (" UseEmbeddedMonospacedFont" , " true" );
220220 }
221- m_use_embedded_monospaced_font = settings.value (" UseEmbeddedMonospacedFont" ).toBool ();
221+ if (settings.value (" UseEmbeddedMonospacedFont" ).toBool ()) {
222+ m_font_money = FontChoiceAbstract::EmbeddedFont;
223+ } else {
224+ m_font_money = FontChoiceAbstract::BestSystemFont;
225+ }
222226 Q_EMIT fontForMoneyChanged (getFontForMoney ());
223227
224228 m_mask_values = settings.value (" mask_values" , false ).toBool ();
@@ -428,7 +432,7 @@ QVariant OptionsModel::getOption(OptionID option, const std::string& suffix) con
428432 case Language:
429433 return QString::fromStdString (SettingToString (setting (), " " ));
430434 case UseEmbeddedMonospacedFont:
431- return m_use_embedded_monospaced_font ;
435+ return (m_font_money != UseBestSystemFont) ;
432436 case CoinControlFeatures:
433437 return fCoinControlFeatures ;
434438 case EnablePSBTControls:
@@ -456,8 +460,13 @@ QVariant OptionsModel::getOption(OptionID option, const std::string& suffix) con
456460
457461QFont OptionsModel::getFontForMoney () const
458462{
459- QFont f = GUIUtil::fixedPitchFont (m_use_embedded_monospaced_font);
460- f.setWeight (QFont::Bold);
463+ QFont f;
464+ if (std::holds_alternative<FontChoiceAbstract>(m_font_money)) {
465+ f = GUIUtil::fixedPitchFont (m_font_money != UseBestSystemFont);
466+ f.setWeight (QFont::Bold);
467+ } else {
468+ f = std::get<QFont>(m_font_money);
469+ }
461470 return f;
462471}
463472
@@ -594,10 +603,21 @@ bool OptionsModel::setOption(OptionID option, const QVariant& value, const std::
594603 }
595604 break ;
596605 case UseEmbeddedMonospacedFont:
597- m_use_embedded_monospaced_font = value.toBool ();
598- settings.setValue (" UseEmbeddedMonospacedFont" , m_use_embedded_monospaced_font);
606+ {
607+ const bool use_embedded_monospaced_font = value.toBool ();
608+ if (use_embedded_monospaced_font) {
609+ if (m_font_money != UseBestSystemFont) {
610+ // Leave it as-is
611+ break ;
612+ }
613+ m_font_money = FontChoiceAbstract::EmbeddedFont;
614+ } else {
615+ m_font_money = FontChoiceAbstract::BestSystemFont;
616+ }
617+ settings.setValue (" UseEmbeddedMonospacedFont" , use_embedded_monospaced_font);
599618 Q_EMIT fontForMoneyChanged (getFontForMoney ());
600619 break ;
620+ }
601621 case CoinControlFeatures:
602622 fCoinControlFeatures = value.toBool ();
603623 settings.setValue (" fCoinControlFeatures" , fCoinControlFeatures );
0 commit comments