Skip to content

Commit e49f99b

Browse files
committed
fonts - adjust font stack for other windows
1 parent 61214b5 commit e49f99b

File tree

5 files changed

+44
-30
lines changed

5 files changed

+44
-30
lines changed

src/vs/code/electron-browser/issue/issueReporterMain.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { ElectronService, IElectronService } from 'vs/platform/electron/electron
88
import { ipcRenderer, webFrame } from 'vs/base/parts/sandbox/electron-sandbox/globals';
99
import * as os from 'os';
1010
import * as browser from 'vs/base/browser/browser';
11-
import { $, windowOpenNoOpener } from 'vs/base/browser/dom';
11+
import { $, windowOpenNoOpener, addClass } from 'vs/base/browser/dom';
1212
import { Button } from 'vs/base/browser/ui/button/button';
1313
import 'vs/base/browser/ui/codicons/codiconStyles'; // make sure codicon css is loaded
1414
import { CodiconLabel } from 'vs/base/browser/ui/codicons/codiconLabel';
@@ -55,6 +55,9 @@ export interface IssueReporterConfiguration extends INativeWindowConfiguration {
5555
}
5656

5757
export function startup(configuration: IssueReporterConfiguration) {
58+
const platformClass = platform.isWindows ? 'windows' : platform.isLinux ? 'linux' : 'mac';
59+
addClass(document.body, platformClass); // used by our fonts
60+
5861
document.body.innerHTML = BaseHtml();
5962
const issueReporter = new IssueReporter(configuration);
6063
issueReporter.render();

src/vs/code/electron-browser/issue/media/issueReporter.css

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,26 +95,30 @@ textarea, input, select {
9595
}
9696

9797
html {
98-
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif;
9998
color: #CCCCCC;
10099
height: 100%;
101100
}
102101

103-
html:lang(zh-Hans) {
104-
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Noto Sans", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif;
105-
}
102+
/* Font Families (with CJK support) */
106103

107-
html:lang(zh-Hant) {
108-
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Noto Sans", "Microsoft Jhenghei", "PingFang TC", "Source Han Sans TC", "Source Han Sans", "Source Han Sans TW", sans-serif;
109-
}
104+
.mac { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }
105+
.mac:lang(zh-Hans) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }
106+
.mac:lang(zh-Hant) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }
107+
.mac:lang(ja) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }
108+
.mac:lang(ko) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; }
110109

111-
html:lang(ja) {
112-
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Noto Sans", "Yu Gothic UI", "Meiryo UI", "Hiragino Kaku Gothic Pro", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", "Sazanami Gothic", "IPA Gothic", sans-serif;
113-
}
110+
.windows { font-family: "Segoe WPC", "Segoe UI", sans-serif; }
111+
.windows:lang(zh-Hans) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }
112+
.windows:lang(zh-Hant) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }
113+
.windows:lang(ja) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }
114+
.windows:lang(ko) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }
114115

115-
html:lang(ko) {
116-
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Noto Sans", "Malgun Gothic", "Nanum Gothic", "Dotom", "Apple SD Gothic Neo", "AppleGothic", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif;
117-
}
116+
/* Linux: add `system-ui` as first font and not `Ubuntu` to allow other distribution pick their standard OS font */
117+
.linux { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }
118+
.linux:lang(zh-Hans) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; }
119+
.linux:lang(zh-Hant) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; }
120+
.linux:lang(ja) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; }
121+
.linux:lang(ko) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; }
118122

119123
body {
120124
margin: 0;

src/vs/code/electron-browser/processExplorer/media/processExplorer.css

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,29 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
html {
7-
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif;
87
font-size: 13px;
98
}
109

11-
html:lang(zh-Hans) {
12-
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Noto Sans", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif;
13-
}
10+
/* Font Families (with CJK support) */
1411

15-
html:lang(zh-Hant) {
16-
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Noto Sans", "Microsoft Jhenghei", "PingFang TC", "Source Han Sans TC", "Source Han Sans", "Source Han Sans TW", sans-serif;
17-
}
12+
.mac { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }
13+
.mac:lang(zh-Hans) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }
14+
.mac:lang(zh-Hant) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }
15+
.mac:lang(ja) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }
16+
.mac:lang(ko) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; }
1817

19-
html:lang(ja) {
20-
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Noto Sans", "Yu Gothic UI", "Meiryo UI", "Hiragino Kaku Gothic Pro", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", "Sazanami Gothic", "IPA Gothic", sans-serif;
21-
}
18+
.windows { font-family: "Segoe WPC", "Segoe UI", sans-serif; }
19+
.windows:lang(zh-Hans) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }
20+
.windows:lang(zh-Hant) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }
21+
.windows:lang(ja) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }
22+
.windows:lang(ko) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }
2223

23-
html:lang(ko) {
24-
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Noto Sans", "Malgun Gothic", "Nanum Gothic", "Dotom", "Apple SD Gothic Neo", "AppleGothic", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif;
25-
}
24+
/* Linux: add `system-ui` as first font and not `Ubuntu` to allow other distribution pick their standard OS font */
25+
.linux { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }
26+
.linux:lang(zh-Hans) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; }
27+
.linux:lang(zh-Hant) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; }
28+
.linux:lang(ja) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; }
29+
.linux:lang(ko) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; }
2630

2731
body {
2832
margin: 0;

src/vs/code/electron-browser/processExplorer/processExplorerMain.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import * as platform from 'vs/base/common/platform';
1616
import { IContextMenuItem } from 'vs/base/parts/contextmenu/common/contextmenu';
1717
import { popup } from 'vs/base/parts/contextmenu/electron-sandbox/contextmenu';
1818
import { ProcessItem } from 'vs/base/common/processes';
19-
import { addDisposableListener } from 'vs/base/browser/dom';
19+
import { addDisposableListener, addClass } from 'vs/base/browser/dom';
2020
import { DisposableStore } from 'vs/base/common/lifecycle';
2121
import { isRemoteDiagnosticError, IRemoteDiagnosticError } from 'vs/platform/diagnostics/common/diagnostics';
2222

@@ -389,6 +389,9 @@ function createCloseListener(): void {
389389
}
390390

391391
export function startup(data: ProcessExplorerData): void {
392+
const platformClass = platform.isWindows ? 'windows' : platform.isLinux ? 'linux' : 'mac';
393+
addClass(document.body, platformClass); // used by our fonts
394+
392395
applyStyles(data.styles);
393396
applyZoom(data.zoomLevel);
394397
createCloseListener();

src/vs/code/electron-browser/proxy/auth.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
}
1919

2020
body {
21-
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif;
21+
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", system-ui, "Ubuntu", "Droid Sans", sans-serif;
2222
font-size: 10pt;
2323
background-color: #F3F3F3;
2424
}
@@ -58,7 +58,7 @@
5858
}
5959

6060
input {
61-
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif !important;
61+
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", system-ui, "Ubuntu", "Droid Sans", sans-serif !important;
6262
}
6363
</style>
6464
</head>

0 commit comments

Comments
 (0)