Skip to content

Commit 07670b6

Browse files
committed
m-plus-rounded-1cからhintingを消したものをpublic/に書き出して使う
1 parent 163536b commit 07670b6

File tree

8 files changed

+173
-43
lines changed

8 files changed

+173
-43
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ next-env.d.ts
4545

4646

4747
/public/typescript/
48+
/public/m-plus-rounded-1c-nohint/

app/globals.css

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,22 +129,21 @@ mycdark:
129129
確実にフォントを統一するためにRoundedM+を指定することにした
130130
以前NotoSansJPを指定していたが、xterm.jsで全角の()の幅がバグった
131131
*/
132-
--font-mono:
133-
"Inconsolata Variable", "Rounded M+ 1c", "Rounded M+ 1p",
134-
"M PLUS Rounded 1c", monospace;
132+
--font-mono: "Inconsolata Variable", "M PLUS Rounded 1c NoHint", monospace;
135133
/*
136134
本家のフォント名は Rounded M+ 1c 、または1pでもいいかも
137-
layout.tsxでインポートしているwebフォントが M PLUS Rounded 1c
135+
layout.tsxでインポートしているwebフォントが M PLUS Rounded 1c NoHint
136+
scripts/removeHinting.ts で M PLUS Rounded 1c からHintingを除去したものを使っている
137+
(HintingがあるとWindowsでジャギーが発生する)
138138
139139
それ以下はM+をダウンロードするまでの間表示されるswap用フォールバックとしてM+に見た目が近いものを指定。
140140
Hiragino Maru Gothic は見た目はめっちゃきれいなんだけど太字がない :cry:
141-
Meiryo は日本語の形がM+に近いが、英数がダメ
142141
*/
143142
--font-sans:
144-
"Rounded M+ 1c", "Rounded M+ 1p", "M PLUS Rounded 1c",
145-
/* 以下fallback */ "M+ 1c", "MigMix 1c", "Migu 1c",
146-
"Hiragino Maru Gothic ProN", "Noto Sans", "Arial", "Liberation Sans",
147-
"Meiryo", sans-serif,
143+
"M PLUS Rounded 1c NoHint", /* 以下fallback */ "Rounded M+ 1c",
144+
"Rounded M+ 1p", "M+ 1c", "MigMix 1c", "Migu 1c",
145+
"Hiragino Maru Gothic ProN", "Segoe UI", "Noto Sans", "Arial",
146+
"Liberation Sans", "BIZ UDゴシック", "Meiryo", sans-serif,
148147
/* TailwindCSSでデフォルトで指定されていた絵文字フォントは一応残しておく */
149148
"Apple Color Emoji",
150149
"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";

app/layout.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import type { Metadata } from "next";
22
import "@fontsource-variable/inconsolata";
3-
import "@fontsource/m-plus-rounded-1c/400.css";
4-
import "@fontsource/m-plus-rounded-1c/700.css";
3+
// import "@fontsource/m-plus-rounded-1c/400.css";
4+
// import "@fontsource/m-plus-rounded-1c/700.css";
5+
import "@/../public/m-plus-rounded-1c-nohint/400.css";
6+
import "@/../public/m-plus-rounded-1c-nohint/700.css";
57
import "./globals.css";
68
import { Navbar } from "./navbar";
79
import { Sidebar } from "./sidebar";

app/terminal/terminal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export function useTerminal(props: TerminalProps) {
134134
lineHeight: 1.2,
135135
letterSpacing: 0,
136136
fontFamily:
137-
"'Inconsolata Variable', 'Rounded M+ 1c', 'Rounded M+ 1p', 'M PLUS Rounded 1c', monospace",
137+
"'Inconsolata Variable', 'M PLUS Rounded 1c NoHint', monospace",
138138
theme: computeTerminalTheme(),
139139
});
140140
terminalInstanceRef.current = term;

package-lock.json

Lines changed: 42 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
"private": true,
55
"type": "module",
66
"scripts": {
7-
"dev": "npm run cf-typegen && npm run copyAllDTSFiles && next dev",
8-
"build": "npm run cf-typegen && npm run copyAllDTSFiles && next build",
7+
"dev": "npm run cf-typegen && npm run copyAllDTSFiles && npm run removeHinting && next dev",
8+
"build": "npm run cf-typegen && npm run copyAllDTSFiles && npm run removeHinting && next build",
99
"start": "next start",
1010
"lint": "npm run cf-typegen && next lint",
1111
"tsc": "npm run cf-typegen && tsc",
1212
"format": "prettier --write app/",
1313
"copyAllDTSFiles": "tsx ./scripts/copyAllDTSFiles.ts",
14+
"removeHinting": "tsx ./scripts/removeHinting.ts",
1415
"cf-preview": "opennextjs-cloudflare build && opennextjs-cloudflare preview --port 3000",
1516
"cf-deploy": "opennextjs-cloudflare build && opennextjs-cloudflare deploy",
1617
"cf-typegen": "wrangler types --env-interface CloudflareEnv cloudflare-env.d.ts"
@@ -57,6 +58,7 @@
5758
"@types/mocha": "^10.0.10",
5859
"@types/node": "^20",
5960
"@types/object-inspect": "^1.13.0",
61+
"@types/pako": "^2.0.4",
6062
"@types/pg": "^8.15.5",
6163
"@types/prismjs": "^1.26.5",
6264
"@types/react": "^19",
@@ -66,6 +68,8 @@
6668
"drizzle-kit": "^0.31.5",
6769
"eslint": "^9",
6870
"eslint-config-next": "~15.4.10",
71+
"fonteditor-core": "^2.6.3",
72+
"pako": "^2.1.0",
6973
"prettier": "^3.6.2",
7074
"prisma": "^6.18.0",
7175
"tailwindcss": "^4",

public/_headers

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
Cross-Origin-Embedder-Policy: require-corp
55
/typescript/*
66
Cache-Control: public,max-age=31536000,immutable
7+
/m-plus-rounded-1c-nohint/*.woff*
8+
Cache-Control: public,max-age=31536000,immutable

0 commit comments

Comments
 (0)