Skip to content

Commit

Permalink
Use the system's fixed-width font in the **Memory Viewer** dialog for…
Browse files Browse the repository at this point in the history
… all platforms.

Previously, the system-defined, fixed-width font was used only for
macOS; now the font is used on Windows and Linux too, as opposed to
using some hardcoded font families that may not be available in the
system.
  • Loading branch information
cristian64 committed May 29, 2024
1 parent 7e15e25 commit 49cc084
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions Source/GUI/MemViewer/MemViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,15 +372,9 @@ void MemViewer::updateFontSize(int newSize)
{
m_memoryFontSize = newSize;

#ifdef __linux__
setFont(QFont("Monospace", m_memoryFontSize));
#elif _WIN32
setFont(QFont("Courier New", m_memoryFontSize));
#elif __APPLE__
QFont fixedFont = QFontDatabase::systemFont(QFontDatabase::FixedFont);
fixedFont.setPointSize(m_memoryFontSize);
setFont(fixedFont);
#endif

m_charWidthEm = fontMetrics().horizontalAdvance(QLatin1Char('M'));
m_charHeight = fontMetrics().height();
Expand Down

0 comments on commit 49cc084

Please sign in to comment.