-
-
Notifications
You must be signed in to change notification settings - Fork 28
[#2092] Fixed terminal line height in the installer CLI video. #2093
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| #!/usr/bin/env node | ||
| /** | ||
| * Custom svg-term renderer with configurable lineHeight. | ||
| * | ||
| * This script uses svg-term as a library to have full control over the theme, | ||
| * specifically setting lineHeight to fix box-drawing character rendering. | ||
| * | ||
| * Usage: | ||
| * node svg-term-render.js <input.json> <output.svg> [options] | ||
| * | ||
| * Options: | ||
| * --at <ms> Timestamp of frame to render | ||
| * --line-height <n> Line height multiplier (default: 1.0) | ||
| * --font-family <s> Font family (default: Consolas, monospace) | ||
| */ | ||
|
|
||
| const fs = require('fs'); | ||
| const {render} = require('svg-term'); | ||
|
|
||
| // Parse command line arguments. | ||
| const args = process.argv.slice(2); | ||
|
|
||
| if (args.length < 2 || args.includes('--help')) { | ||
| console.log('Usage: node svg-term-render.js <input.json> <output.svg> [options]'); | ||
| console.log(''); | ||
| console.log('Options:'); | ||
| console.log(' --at <ms> Timestamp of frame to render'); | ||
| console.log(' --line-height <n> Line height multiplier (default: 1.0)'); | ||
| console.log(' --font-family <s> Font family (default: Consolas, monospace)'); | ||
| process.exit(args.includes('--help') ? 0 : 1); | ||
| } | ||
|
|
||
| const inputFile = args[0]; | ||
| const outputFile = args[1]; | ||
|
|
||
| // Parse options. | ||
| let at = null; | ||
| let lineHeight = 1.0; | ||
| let fontFamily = 'Consolas, "Courier New", Courier, "Liberation Mono", monospace'; | ||
|
|
||
| for (let i = 2; i < args.length; i++) { | ||
| if (args[i] === '--at' && i + 1 < args.length) { | ||
| at = parseInt(args[i + 1], 10); | ||
| i++; | ||
| } else if (args[i] === '--line-height' && i + 1 < args.length) { | ||
| lineHeight = parseFloat(args[i + 1]); | ||
| i++; | ||
| } else if (args[i] === '--font-family' && i + 1 < args.length) { | ||
| fontFamily = args[i + 1]; | ||
| i++; | ||
| } | ||
| } | ||
|
|
||
| // Read input cast file. | ||
| const input = fs.readFileSync(inputFile, 'utf8'); | ||
|
|
||
| // Define custom theme with lineHeight set to 1.0. | ||
| // Based on Atom One Dark theme colors. | ||
| // Note: svg-term 1.3.1 expects RGB arrays, not hex strings. | ||
| const theme = { | ||
| background: [40, 44, 52], // #282c34 | ||
| text: [171, 178, 191], // #abb2bf | ||
| cursor: [82, 139, 255], // #528bff | ||
| black: [40, 44, 52], // #282c34 | ||
| red: [224, 108, 117], // #e06c75 | ||
| green: [152, 195, 121], // #98c379 | ||
| yellow: [209, 154, 102], // #d19a66 | ||
| blue: [97, 175, 239], // #61afef | ||
| magenta: [198, 120, 221], // #c678dd | ||
| cyan: [86, 182, 194], // #56b6c2 | ||
| white: [171, 178, 191], // #abb2bf | ||
| brightBlack: [92, 99, 112], // #5c6370 | ||
| brightRed: [224, 108, 117], // #e06c75 | ||
| brightGreen: [152, 195, 121], // #98c379 | ||
| brightYellow: [209, 154, 102], // #d19a66 | ||
| brightBlue: [97, 175, 239], // #61afef | ||
| brightMagenta: [198, 120, 221], // #c678dd | ||
| brightCyan: [86, 182, 194], // #56b6c2 | ||
| brightWhite: [255, 255, 255], // #ffffff | ||
| bold: [171, 178, 191], // #abb2bf | ||
| fontSize: 1.67, | ||
| lineHeight: lineHeight, | ||
| fontFamily: fontFamily, | ||
| }; | ||
|
|
||
| // Render options. | ||
| const options = { | ||
| theme: theme, | ||
| }; | ||
|
|
||
| if (at !== null) { | ||
| options.at = at; | ||
| } | ||
|
|
||
| // Render SVG. | ||
| try { | ||
| const svg = render(input, options); | ||
| fs.writeFileSync(outputFile, svg, 'utf8'); | ||
| console.log(`SVG rendered successfully: ${outputFile}`); | ||
| console.log(` lineHeight: ${lineHeight}`); | ||
| console.log(` fontFamily: ${fontFamily}`); | ||
| if (at !== null) { | ||
| console.log(` at: ${at}ms`); | ||
| } | ||
| } catch (error) { | ||
| console.error('Error rendering SVG:', error.message); | ||
| process.exit(1); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
🧩 Analysis chain
Verify that svg-term-cli provides the required 'svg-term' module.
The new utility script at
.vortex/docs/.utils/svg-term-render.js(line 18) importssvg-termusingrequire('svg-term'). Please confirm that thesvg-term-clipackage provides this module, or if a separatesvg-termdependency is needed.🏁 Script executed:
Length of output: 890
Add
svg-termas an explicit dependency.The
[email protected]package includessvg-term: ^1.1.3as a dependency, so therequire('svg-term')call in.vortex/docs/.utils/svg-term-render.jswill work. However, since the code directly requiressvg-term(rather thansvg-term-cli), it should be explicitly listed inpackage.jsonas a direct dependency rather than relying on a transitive dependency. Add"svg-term": "^1.1.3"to the dependencies in.vortex/docs/package.json.🤖 Prompt for AI Agents