You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Warn users if the terminal font is not monospace #45226
*out-of-scopePosted issue is not in scope of VS Codefeature-requestRequest for new features or functionalityterminalGeneral terminal issues that don't fall under another labelupstreamIssue identified as 'upstream' component related (exists outside of VS Code)
I see this as a new function on TerminalConfigHelper similar to _measureFont which checks the 2 characters and verifies they're the same width. This can be called by TerminalPanel when the font changes and show a notification (by adding INotificationService to constructor) if it's different:
Daniel Imms (@Tyriar) I took a look and wanted to clarify. I understand that the point of this is to confirm whether or not a font is monospace. With that being said, am I expected to render an actual html element and measure the difference among two separate letters (eg. in pixels)? I'm now pretty familiar with the code organization, just a little confused as to how to approach measuring the font 🙂
Peng Lyu (@rebornix) any ideas on whether the editor has something to leverage here? Basically I need some element to measure the width of w and i to check if it's really a monospace font but it only works when the panel is visible. I don't really want to break out of the panel element and touch things that the terminal doesn't own.
I'm toying with the idea of supporting this in xterm.js by specifying a measureContainer element to do the measurements in xtermjs/xterm.js#702. That would move the logic upstream, it would still be a little weird for me to put this element somewhere outside of the terminal panel though.
This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.
*out-of-scopePosted issue is not in scope of VS Codefeature-requestRequest for new features or functionalityterminalGeneral terminal issues that don't fall under another labelupstreamIssue identified as 'upstream' component related (exists outside of VS Code)
Activity
RubenMateus commentedon Mar 7, 2018
Daniel Imms (@Tyriar) I would really like to help on this one has my first issue on vscode repo.
Tyriar commentedon Mar 9, 2018
Ruben Mateus (@RubenMateus) that would be great!
To give you some pointers, there is an element used for measuring characters here:
https://github.com/Microsoft/vscode/blob/05b995dd9c99b709f41577ab04fe53740f67ccea/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts#L31
I see this as a new function on
TerminalConfigHelpersimilar to_measureFontwhich checks the 2 characters and verifies they're the same width. This can be called byTerminalPanelwhen the font changes and show a notification (by addingINotificationServiceto constructor) if it's different:https://github.com/Microsoft/vscode/blob/05b995dd9c99b709f41577ab04fe53740f67ccea/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts#L78-L82
jay-khatri commentedon Mar 15, 2018
Daniel Imms (@Tyriar) have there been any developments on this issue? I'd love to take a look!
Tyriar commentedon Mar 16, 2018
Jay Khatri (@jay-khatri) not yet, go for it 😃
jay-khatri commentedon Mar 19, 2018
Daniel Imms (@Tyriar) I took a look and wanted to clarify. I understand that the point of this is to confirm whether or not a font is monospace. With that being said, am I expected to render an actual html element and measure the difference among two separate letters (eg. in pixels)? I'm now pretty familiar with the code organization, just a little confused as to how to approach measuring the font 🙂
jay-khatri commentedon Mar 20, 2018
Ping Daniel Imms (@Tyriar) 😬 🙂
Tyriar commentedon Mar 22, 2018
Jay Khatri (@jay-khatri) yes, by utilizing
_charMeasureElementwhich I believe has font assigned to itTyriar commentedon May 25, 2018
#48028 adds the following notification when the terminal font is changed:
7 remaining items
Tyriar commentedon Jun 18, 2018
Peng Lyu (@rebornix) any ideas on whether the editor has something to leverage here? Basically I need some element to measure the width of
wandito check if it's really a monospace font but it only works when the panel is visible. I don't really want to break out of the panel element and touch things that the terminal doesn't own.Tyriar commentedon Jul 9, 2018
I'm toying with the idea of supporting this in xterm.js by specifying a
measureContainerelement to do the measurements in xtermjs/xterm.js#702. That would move the logic upstream, it would still be a little weird for me to put this element somewhere outside of the terminal panel though.Ping Peng Lyu (@rebornix)
vscodebot commentedon Oct 8, 2019
This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.
If you wonder what we are up to, please see our roadmap and issue reporting guidelines.
Thanks for your understanding and happy coding!