Skip to content

Commit 2ca3523

Browse files
committed
Fix CJK fonts again as per go-gitea#12522
1 parent 1ea4339 commit 2ca3523

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

templates/base/head.tmpl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html lang="{{.Language}}" class="theme-{{.SignedUser.Theme}}">
2+
<html lang="{{.Lang}}" class="theme-{{.SignedUser.Theme}}">
33
<head data-suburl="{{AppSubUrl}}">
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1">
@@ -67,6 +67,9 @@
6767
<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/easymde.css?v={{MD5 AppVer}}">
6868
{{end}}
6969
<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/index.css?v={{MD5 AppVer}}">
70+
<script>
71+
if (navigator.userAgent.match('Windows')) { document.documentElement.style.setProperty('--fonts-system-ui', 'Segoe UI'); }
72+
</script>
7073
<noscript>
7174
<style>
7275
.dropdown:hover > .menu { display: block; }

web_src/less/_base.less

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
:root {
22
/* documented customizable variables */
3-
--fonts-proportional: system-ui, -apple-system, "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica Neue", "Arial", "Noto Sans", "Liberation Sans", sans-serif;
3+
--fonts-proportional: var(--fonts-system-ui), "Roboto", "Helvetica Neue", "Arial", "Noto Sans", "Liberation Sans";
44
--fonts-monospace: "SFMono-Regular", "Menlo", "Monaco", "Consolas", "Liberation Mono", "Courier New", monospace;
5-
--fonts-emoji: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "Twemoji Mozilla";
5+
--fonts-emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla";
66
/* other variables */
7-
--fonts-regular: var(--fonts-proportional), var(--fonts-emoji);
7+
--fonts-system-ui: system-ui, -apple-system; // will be replaced with "Segoe UI" if user agent is Windows
8+
--fonts-regular: var(--fonts-proportional), var(--fonts-emoji), sans-serif;
89
--border-radius: .28571429rem;
910
--opacity-disabled: .55;
1011
--color-primary: #4183c4;
@@ -116,23 +117,29 @@
116117
}
117118

118119
:root:lang(ja) {
119-
--fonts-proportional: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Source Han Sans JP", "Noto Sans CJK JP", "Droid Sans Japanese", "Meiryo", "MS PGothic";
120+
--fonts-regular: var(--fonts-proportional), var(--fonts-emoji), "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Source Han Sans JP", "Noto Sans CJK JP", "Droid Sans Japanese", "Meiryo", "MS PGothic", sans-serif;
120121
}
121122

122123
:root:lang(zh-CN) {
123-
--fonts-proportional: "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", "Heiti SC", "SimHei";
124+
--fonts-regular: var(--fonts-proportional), var(--fonts-emoji), "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", "Heiti SC", "SimHei", sans-serif;
124125
}
125126

126127
:root:lang(zh-TW) {
127-
--fonts-proportional: "PingFang TC", "Hiragino Sans TC", "Source Han Sans TW", "Source Han Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", "Heiti TC", "PMingLiU";
128+
--fonts-regular: var(--fonts-proportional), var(--fonts-emoji), "PingFang TC", "Hiragino Sans TC", "Source Han Sans TW", "Source Han Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", "Heiti TC", "PMingLiU", sans-serif;
128129
}
129130

130131
:root:lang(zh-HK) {
131-
--fonts-proportional: "PingFang HK", "Hiragino Sans TC", "Source Han Sans HK", "Source Han Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", "Heiti TC", "PMingLiU_HKSCS", "PMingLiU";
132+
--fonts-regular: var(--fonts-proportional), var(--fonts-emoji), "PingFang HK", "Hiragino Sans TC", "Source Han Sans HK", "Source Han Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", "Heiti TC", "PMingLiU_HKSCS", "PMingLiU", sans-serif;
132133
}
133134

134135
:root:lang(ko) {
135-
--fonts-proportional: "Apple SD Gothic Neo", "NanumBarunGothic", "Malgun Gothic", "Gulim", "Dotum", "Nanum Gothic", "Source Han Sans KR", "Noto Sans CJK KR";
136+
--fonts-regular: var(--fonts-proportional), var(--fonts-emoji), "Apple SD Gothic Neo", "NanumBarunGothic", "Malgun Gothic", "Gulim", "Dotum", "Nanum Gothic", "Source Han Sans KR", "Noto Sans CJK KR", sans-serif;
137+
}
138+
139+
@font-face {
140+
font-family: "Yu Gothic";
141+
src: local("Yu Gothic Regular"), local("Yu Gothic Medium");
142+
font-weight: 300;
136143
}
137144

138145
@font-face {
@@ -144,7 +151,7 @@
144151
@font-face {
145152
font-family: "Yu Gothic";
146153
src: local("Yu Gothic Bold");
147-
font-weight: 500;
154+
font-weight: 700;
148155
}
149156

150157
textarea {

0 commit comments

Comments
 (0)