Use Consolas font by default in TortoiseMerge, TortoiseUDiff and TortoiseBlame
Ivan Zhakov <[email protected]>
| Newsgroups | gmane.comp.version-control.subversion.tortoisesvn.devel |
|---|---|
| Message-ID | <CABw-3Yeyj_m7VDWhd6HoCs6FbsW-PS5JRPJkgkzN4gG5JR7CLw@mail.gmail.com> |
Hi, I would like to change the default font used in TortoiseMerge, TortoiseUDiff and TortoiseBlame to Consolas 10pt, instead of Courier New 10pt. Consolas is the default font in the most programmers editors and IDEs on Windows [1] including Visual Studio. Please see the attached screenshots of all TortoiseSVN applications with Courier New and Consolas fonts. According to Wikipedia Consolas font is included with Windows since Windows XP [2] [1] https://spin.atomicobject.com/2016/07/11/programming-fonts/ [2] https://en.wikipedia.org/wiki/Consolas -- Ivan Zhakov ------------------------------------------------------ http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=3192945 To unsubscribe from this discussion, e-mail: [[email protected]].
tsvn-consolas-10pt-v1.patch
(text/x-patch, 5.5 KB)
Index: src/TortoiseBlame/TortoiseBlame.cpp
===================================================================
--- src/TortoiseBlame/TortoiseBlame.cpp (revision 27532)
+++ src/TortoiseBlame/TortoiseBlame.cpp (working copy)
@@ -589,7 +589,7 @@
if (IsWindows7OrGreater() && DWORD(used2d))
enabled2d = true;
// Set up the global default style. These attributes are used wherever no explicit choices are made.
- std::wstring fontNameW = CRegStdString(L"Software\\TortoiseSVN\\BlameFontName", L"Courier New");
+ std::wstring fontNameW = CRegStdString(L"Software\\TortoiseSVN\\BlameFontName", L"Consolas");
std::string fontName = CUnicodeUtils::StdGetUTF8(fontNameW);
SetAStyle(STYLE_DEFAULT, black, white, (DWORD)CRegStdDWORD(L"Software\\TortoiseSVN\\BlameFontSize", 10), fontName.c_str());
//SetAStyle(STYLE_MARK, black, ::GetSysColor(COLOR_HIGHLIGHT));
@@ -1317,7 +1317,7 @@
HDC hDC = ::GetDC(wBlame);
lf.lfHeight = -MulDiv((DWORD)CRegStdDWORD(L"Software\\TortoiseSVN\\BlameFontSize", 10), GetDeviceCaps(hDC, LOGPIXELSY), 72);
lf.lfCharSet = DEFAULT_CHARSET;
- CRegStdString fontname = CRegStdString(L"Software\\TortoiseSVN\\BlameFontName", L"Courier New");
+ CRegStdString fontname = CRegStdString(L"Software\\TortoiseSVN\\BlameFontName", L"Consolas");
wcscpy_s(lf.lfFaceName, ((tstring)fontname).c_str());
m_font = ::CreateFontIndirect(&lf);
Index: src/TortoiseMerge/BaseView.cpp
===================================================================
--- src/TortoiseMerge/BaseView.cpp (revision 27535)
+++ src/TortoiseMerge/BaseView.cpp (working copy)
@@ -499,7 +499,7 @@
m_lfBaseFont.lfHeight = -MulDiv((DWORD)CRegDWORD(L"Software\\TortoiseMerge\\FontSize", 10), GetDeviceCaps(pDC->m_hDC, LOGPIXELSY), 72);
ReleaseDC(pDC);
}
- wcsncpy_s(m_lfBaseFont.lfFaceName, (LPCTSTR)(CString)CRegString(L"Software\\TortoiseMerge\\FontName", L"Courier New"), _countof(m_lfBaseFont.lfFaceName) - 1);
+ wcsncpy_s(m_lfBaseFont.lfFaceName, (LPCTSTR)(CString)CRegString(L"Software\\TortoiseMerge\\FontName", L"Consolas"), _countof(m_lfBaseFont.lfFaceName) - 1);
if (!m_apFonts[nIndex]->CreateFontIndirect(&m_lfBaseFont))
{
delete m_apFonts[nIndex];
Index: src/TortoiseMerge/SetMainPage.cpp
===================================================================
--- src/TortoiseMerge/SetMainPage.cpp (revision 27532)
+++ src/TortoiseMerge/SetMainPage.cpp (working copy)
@@ -58,7 +58,7 @@
m_regIgnoreEOL = CRegDWORD(L"Software\\TortoiseMerge\\IgnoreEOL", TRUE);
m_regOnePane = CRegDWORD(L"Software\\TortoiseMerge\\OnePane");
m_regViewLinenumbers = CRegDWORD(L"Software\\TortoiseMerge\\ViewLinenumbers", 1);
- m_regFontName = CRegString(L"Software\\TortoiseMerge\\FontName", L"Courier New");
+ m_regFontName = CRegString(L"Software\\TortoiseMerge\\FontName", L"Consolas");
m_regFontSize = CRegDWORD(L"Software\\TortoiseMerge\\FontSize", 10);
m_regCaseInsensitive = CRegDWORD(L"Software\\TortoiseMerge\\CaseInsensitive", FALSE);
m_regUTF8Default = CRegDWORD(L"Software\\TortoiseMerge\\UseUTF8", FALSE);
Index: src/TortoiseProc/Settings/SettingsTBlame.cpp
===================================================================
--- src/TortoiseProc/Settings/SettingsTBlame.cpp (revision 27532)
+++ src/TortoiseProc/Settings/SettingsTBlame.cpp (working copy)
@@ -33,7 +33,7 @@
m_regOldLinesColor = CRegDWORD(L"Software\\TortoiseSVN\\BlameOldColor", BLAMEOLDCOLOR);
m_regNewLinesColorBar = CRegDWORD(L"Software\\TortoiseSVN\\BlameLocatorNewColor", BLAMENEWCOLORBAR);
m_regOldLinesColorBar = CRegDWORD(L"Software\\TortoiseSVN\\BlameLocatorOldColor", BLAMEOLDCOLORBAR);
- m_regFontName = CRegString(L"Software\\TortoiseSVN\\BlameFontName", L"Courier New");
+ m_regFontName = CRegString(L"Software\\TortoiseSVN\\BlameFontName", L"Consolas");
m_regFontSize = CRegDWORD(L"Software\\TortoiseSVN\\BlameFontSize", 10);
m_regTabSize = CRegDWORD(L"Software\\TortoiseSVN\\BlameTabSize", 4);
Index: src/TortoiseProc/Settings/SettingsTUDiff.cpp
===================================================================
--- src/TortoiseProc/Settings/SettingsTUDiff.cpp (revision 27532)
+++ src/TortoiseProc/Settings/SettingsTUDiff.cpp (working copy)
@@ -43,7 +43,7 @@
m_regBackAddedColor = CRegDWORD(L"Software\\TortoiseSVN\\UDiffBackAddedColor", UDIFF_COLORBACKADDED);
m_regBackRemovedColor = CRegDWORD(L"Software\\TortoiseSVN\\UDiffBackRemovedColor", UDIFF_COLORBACKREMOVED);
- m_regFontName = CRegString(L"Software\\TortoiseSVN\\UDiffFontName", L"Courier New");
+ m_regFontName = CRegString(L"Software\\TortoiseSVN\\UDiffFontName", L"Consolas");
m_regFontSize = CRegDWORD(L"Software\\TortoiseSVN\\UDiffFontSize", 10);
m_regTabSize = CRegDWORD(L"Software\\TortoiseSVN\\UDiffTabSize", 4);
}
Index: src/TortoiseUDiff/MainWindow.cpp
===================================================================
--- src/TortoiseUDiff/MainWindow.cpp (revision 27532)
+++ src/TortoiseUDiff/MainWindow.cpp (working copy)
@@ -579,7 +579,7 @@
bool enabled2d = false;
if (IsWindows7OrGreater() && DWORD(used2d))
enabled2d = true;
- std::wstring fontNameW = CRegStdString(L"Software\\TortoiseSVN\\UDiffFontName", L"Courier New");
+ std::wstring fontNameW = CRegStdString(L"Software\\TortoiseSVN\\UDiffFontName", L"Consolas");
std::string fontName;
fontName = CUnicodeUtils::StdGetUTF8(fontNameW);
SetAStyle(STYLE_DEFAULT, ::GetSysColor(COLOR_WINDOWTEXT), ::GetSysColor(COLOR_WINDOW),
TortoiseUDiff-CourierNew-10pt.png
(image/png, 40.3 KB) - not displayed
TortoiseUDiff-Consolas-10pt.png
(image/png, 44.7 KB) - not displayed
TortoiseMerge-CourierNew-10pt.png
(image/png, 139.5 KB) - not displayed
TortoiseMerge-Consolas-10pt.png
(image/png, 155.5 KB) - not displayed
TortoiseBlame-Consolas-10pt.png
(image/png, 96 KB) - not displayed
TortoiseBlame-CourierNew-10pt.png
(image/png, 91.2 KB) - not displayed