The editor ships its own font, Source Sans 3 and Code Pro (#202)
Theme named Inter and JetBrains Mono, but neither was ever shipped, so every machine drew the editor in whatever it had installed. The e2e runs measured text in a different face than the user saw. - Five Latin woff2 faces live in src/ui/fonts/ next to their OFL licences: Source Sans 3 400/500/600/700 and Source Code Pro 400. - fonts.ts loads them through FontFace, and main.ts waits for them before the first widget exists, so Pixi measures the real face. - A face that fails to load is reported in the console and the system fallback in Theme takes over. - Theme is retuned by hand: 12 px body, 22 px rows, smaller gaps and padding, radius 8, and weight 500 for bold and headings. - The scene background default follows Theme.colors.graphBackground. This makes core import from ui for the first time. Findings: - The 500 file is in the folder but fonts.ts does not register it yet, so weight 500 currently falls back to the 400 face. Tests: - ./check.sh: 141 files, 2080 tests, exit 0. - e2e not run. Checks that measure widths or row positions are expected to need updating for the new metrics. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
28b1afa7af
commit
940a78e8ee
12 files changed
+231
-13
No files matched your search
+12
-11
@@ -2,21 +2,22 @@
|
||||
import { TextStyle } from 'pixi.js';
|
||||
|
||||
export const Theme = {
|
||||
font: 'Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',
|
||||
monoFont: '"JetBrains Mono", Consolas, "Courier New", monospace',
|
||||
fontSize: 13,
|
||||
// Both ship with the build (`fonts.ts`); the rest only covers glyphs outside their Latin subset.
|
||||
font: '"Source Sans 3", "Segoe UI", Roboto, Helvetica, Arial, sans-serif',
|
||||
monoFont: '"Source Code Pro", Consolas, "Courier New", monospace',
|
||||
fontSize: 12,
|
||||
smallFontSize: 11,
|
||||
viewportLabelSize: 10,
|
||||
rowHeight: 26,
|
||||
rowHeight: 22,
|
||||
controlHeight: 24,
|
||||
padding: 8,
|
||||
gap: 6,
|
||||
radius: 4,
|
||||
fieldPadding: 6,
|
||||
gap: 4,
|
||||
radius: 8,
|
||||
fieldPadding: 4,
|
||||
checkboxSize: 16,
|
||||
scrollbarWidth: 6,
|
||||
scrollbarWidth: 4,
|
||||
/** Horizontal indent per nesting level in tree lists. */
|
||||
treeIndent: 14,
|
||||
treeIndent: 12,
|
||||
hoverCursor: 'default',
|
||||
colors: {
|
||||
background: 0x1b1d22,
|
||||
@@ -108,7 +109,7 @@ export function textStyle(token: TextStyleToken = 'body'): TextStyle {
|
||||
style = new TextStyle(base);
|
||||
break;
|
||||
case 'bodyBold':
|
||||
style = new TextStyle({ ...base, fontWeight: '600' });
|
||||
style = new TextStyle({ ...base, fontWeight: '500' });
|
||||
break;
|
||||
case 'muted':
|
||||
style = new TextStyle({ ...base, fill: Theme.colors.textMuted });
|
||||
@@ -129,7 +130,7 @@ export function textStyle(token: TextStyleToken = 'body'): TextStyle {
|
||||
style = new TextStyle({
|
||||
...base,
|
||||
fontSize: Theme.smallFontSize,
|
||||
fontWeight: '700',
|
||||
fontWeight: '500',
|
||||
letterSpacing: 0.5,
|
||||
fill: Theme.colors.textMuted,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user