-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
Add setting for fontSize and lineHeight to the integrated terminal #6998
Conversation
By analyzing the blame information on this pull request, we identified @Tyriar to be a potential reviewer |
Hi @kisstkondoros, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! The agreement was validated by Microsoft and real humans are currently evaluating your PR. TTYL, MSBOT; |
'type': 'string', | ||
'default': '' | ||
}, | ||
'terminal.integrated.charWidth': { |
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.
I think #6456 should be figured out before the font size and line height is added to prevent addition the charWidth
/charHeight
settings.
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.
I also thought about that, but I have no clean solution in mind...
Perhaps measuring a character like X or M with canvas api... smth. like https://msdn.microsoft.com/en-us/library/ff975421(v=vs.85).aspx
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.
Yeah, that's why I haven't tackled it yet 😉
Something along the lines of that is what I was thinking, I think you might be able to do it by creating a div and measuring that.
58a3bc3
to
3c1103d
Compare
@kisstkondoros Awesome! 👍 |
3c1103d
to
1f3d189
Compare
@kisstkondoros I merged the PR into master as the 1.2 release was branched off. |
I moved the configuration code into Maybe changing export interface ITerminalFont {
fontFamily: string;
fontSize: string;
lineHeight: string;
} |
a7be30e
to
62b0bb1
Compare
@Tyriar Please have a look, I hope that was the idea! 😉 |
@@ -41,6 +41,14 @@ configurationRegistry.registerConfiguration({ | |||
'terminal.integrated.fontFamily': { | |||
'description': nls.localize('terminal.integrated.fontFamily', "The font family used by the terminal (CSS font-family format), this defaults to editor.fontFamily's value."), | |||
'type': 'string' | |||
}, | |||
'terminal.integrated.fontSize': { | |||
'description': nls.localize('terminal.integrated.fontSize', "The font size used by the terminal."), |
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.
Add: " (in pixels)"
@kisstkondoros really nice work! Made a bunch of comments, mainly just names and shuffling things around. |
62b0bb1
to
46ab627
Compare
@Tyriar based on Your comments I've did a refactor, some stuff has been simplified a lot. Things to note:
|
this.charMeasureElement = new Builder(this.parentDomElement, true).div().build().getHTMLElement(); | ||
} | ||
let style = this.charMeasureElement.style; | ||
style.display = 'inline'; |
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.
Will this flicker the element on the screen? Should it be positioned absolutely off screen?
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.
I'll check, but this triggers a synchronous layout and then immediatelly removes it I think it is not visible.
Really nice! Just a couple of little things and good to go, I'm also cloning your branch to check it out. |
@@ -41,6 +41,14 @@ configurationRegistry.registerConfiguration({ | |||
'terminal.integrated.fontFamily': { | |||
'description': nls.localize('terminal.integrated.fontFamily', "The font family used by the terminal (CSS font-family format), this defaults to editor.fontFamily's value."), | |||
'type': 'string' | |||
}, | |||
'terminal.integrated.fontSize': { |
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.
I'll continue with it tomorrow. |
@@ -41,6 +41,14 @@ configurationRegistry.registerConfiguration({ | |||
'terminal.integrated.fontFamily': { | |||
'description': nls.localize('terminal.integrated.fontFamily', "The font family used by the terminal (CSS font-family format), this defaults to editor.fontFamily's value."), | |||
'type': 'string' | |||
}, | |||
'terminal.integrated.fontSize': { | |||
'description': nls.localize('terminal.integrated.fontSize', "The font size used by the terminal (in pixels), this defaults to editor.fontSize's value."), |
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.
Sorry but let's go for consistency with the editor settings for this in commonEditorConfig.ts:
"Controls the font family of the terminal."
"Controls the font size of the terminal."
"Controls the line height of the terminal."
Thanks a lot @kisstkondoros, this is awesome! I'm going to refactor terminalPanel.ts for #6458 and didn't want to introduce a bunch of conflicts so I'll make the touch ups mentioned. It should land in the June release! 🎆 |
Awesome, thanks! 🎉 |
resolves #6728