Skip to content

Warn users if the terminal font is not monospace #45226

Closed

Description

@Tyriar

As a workaround for #35681, we could measure characters, maybe i and w and tell the user to use a monospace font if they differ.

Activity

  1. added
    help wanted
    feature-request
    good first issue
    terminal
    on Mar 7, 2018
  2. RubenMateus commented on Mar 7, 2018

    @RubenMateus

    Daniel Imms (@Tyriar) I would really like to help on this one has my first issue on vscode repo.

  3. Tyriar commented on Mar 9, 2018

    @Tyriar
    ContributorAuthor

    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 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:

    https://github.com/Microsoft/vscode/blob/05b995dd9c99b709f41577ab04fe53740f67ccea/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts#L78-L82

  4. jay-khatri commented on Mar 15, 2018

    @jay-khatri

    Daniel Imms (@Tyriar) have there been any developments on this issue? I'd love to take a look!

  5. Tyriar commented on Mar 16, 2018

    @Tyriar
    ContributorAuthor

    Jay Khatri (@jay-khatri) not yet, go for it 😃

  6. jay-khatri commented on Mar 19, 2018

    @jay-khatri

    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 🙂

  7. jay-khatri commented on Mar 20, 2018

    @jay-khatri

    Ping Daniel Imms (@Tyriar) 😬 🙂

  8. Tyriar commented on Mar 22, 2018

    @Tyriar
    ContributorAuthor

    Jay Khatri (@jay-khatri) yes, by utilizing _charMeasureElement which I believe has font assigned to it

  9. Tyriar commented on May 25, 2018

    @Tyriar
    ContributorAuthor

    #48028 adds the following notification when the terminal font is changed:

    image

  10. added this to the May 2018 milestone on May 25, 2018
  11. 7 remaining items

  12. Tyriar commented on Jun 18, 2018

    @Tyriar
    ContributorAuthor

    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.

  13. Tyriar commented on Jul 9, 2018

    @Tyriar
    ContributorAuthor

    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.

    Ping Peng Lyu (@rebornix)

  14. added
    upstream
    and removed
    good first issue
    help wanted
    on Jul 9, 2018
  15. removed
    verification-needed
    on Aug 30, 2018
  16. added
    *out-of-scope
    on Oct 8, 2019
  17. vscodebot commented on Oct 8, 2019

    @vscodebot

    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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

*out-of-scopefeature-requestterminalupstream

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions