Skip to content

Commit 3f93720

Browse files
author
Confitty Developer
committed
fix(preview): match Kitty's cell metrics and rendering more closely
- line-height: 1.45 -> 1.25 to match Kitty's default cell_height ratio so rows pack to terminal density instead of web-text density. - font-kerning: none (terminals never kern monospace fonts). - text-rendering: geometricPrecision plus WebKit/Mozilla font smoothing, so cells stay on integer pixel grids and characters don't shift on hinting boundaries. - Wider fallback stack: Liberation Mono before generic monospace, so Linux preview without web fonts looks right. - Selection drops the 2px border-radius. Real Kitty fills selected cells as full rectangles, no rounding.
1 parent 62f9704 commit 3f93720

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

src/components/live-preview/terminal-screen.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ function isAnsiKey(value: string): value is AnsiKey {
4646
min-height: 1em;
4747
}
4848
.selected {
49-
border-radius: 2px;
49+
/* Match Kitty cell selection: square fill, no rounding. */
50+
padding: 0 0.05em;
5051
}
5152
.url {
5253
text-underline-offset: 2px;

src/components/live-preview/terminal-window.component.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,14 @@ export class TerminalWindowComponent {
141141
return {
142142
backgroundColor: rgba(colors.background, opacity),
143143
color: colors.foreground,
144-
fontFamily: `"${fonts.font_family}", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace`,
144+
fontFamily: `"${fonts.font_family}", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace`,
145145
fontSize: `${px}px`,
146-
lineHeight: '1.45',
146+
lineHeight: '1.25',
147147
fontVariantLigatures: ligatures,
148+
fontKerning: 'none',
149+
textRendering: 'geometricPrecision',
150+
WebkitFontSmoothing: 'antialiased',
151+
MozOsxFontSmoothing: 'grayscale',
148152
borderRadius: '10px',
149153
outline: borderWidth ? `${borderWidth}px solid ${w.active_border_color}` : 'none',
150154
outlineOffset: borderWidth ? `-${borderWidth}px` : '0',

0 commit comments

Comments
 (0)