Added default font for MacOS

This commit is contained in:
RigoLigo 2022-05-30 17:10:10 +08:00
parent 62080e61b0
commit c8b1fbbc83
2 changed files with 9 additions and 2 deletions

View File

@ -52,8 +52,10 @@ SynEdit::SynEdit(QWidget *parent) : QAbstractScrollArea(parent),
mPainting = false;
#ifdef Q_OS_WIN
mFontDummy = QFont("Consolas",12);
#elif defined(Q_OS_LINUX) || defined(Q_OS_MACOS)
#elif defined(Q_OS_LINUX)
mFontDummy = QFont("terminal",14);
#elif defined(Q_OS_MACOS)
mFontDummy = QFont("Menlo", 14);
#else
#error "Not supported!"
#endif

View File

@ -1265,10 +1265,13 @@ void Settings::Editor::doLoad()
mRightEdgeWidth = intValue("right_edge_width",80);
mRightEdgeLineColor = colorValue("right_edge_line_color",Qt::yellow);
//Font
//Editor font
#ifdef Q_OS_WIN
mFontName = stringValue("font_name","consolas");
mNonAsciiFontName = stringValue("non_ascii_font_name","consolas");
#elif defined(Q_OS_MACOS)
mFontName = stringValue("font_name","Menlo");
mNonAsciiFontName = stringValue("non_ascii_font_name","PingFang SC");
#else
mFontName = stringValue("font_name","Dejavu Sans Mono");
mNonAsciiFontName = stringValue("non_ascii_font_name","Dejavu Sans Mono");
@ -3222,6 +3225,8 @@ void Settings::Executor::doLoad()
mIgnoreSpacesWhenValidatingCases = boolValue("ignore_spaces_when_validating_cases",false);
#ifdef Q_OS_WIN
mCaseEditorFontName = stringValue("case_editor_font_name","consolas");
#elif defined(Q_OS_MACOS)
mCaseEditorFontName = stringValue("case_editor_font_name", "Menlo");
#else
mCaseEditorFontName = stringValue("case_editor_font_name","Dejavu Sans Mono");
#endif