-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Style wide characters at charWidth*2 in DOM #440
Conversation
Note that some half width chars are rendered to wide with some fonts. Also fonts may differ in the wcwidth calculation for some glyphs. Thats the reason why I ended up with a precalculated dictionary of glyph widths for a critial subset of characters. |
|
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.
Looks great, works great.
LGTM 👍 .
this.charMeasureElement.classList.add('xterm-char-measure-element'); | ||
this.charMeasureElement.innerHTML = 'W'; | ||
this.helperContainer.appendChild(this.charMeasureElement); | ||
this.charSizeStyleElement = document.createElement('style'); |
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.
Nice idea 👍 .
Tested after merge 👍 |
Fixes #439
Adds a new util class that encapsulates measuring of characters and restricts it to only be performed during at start up and after a resize (which I think should also be called when char size is changed).
Before:
After:
It appears to work when resizing using crazy sizes too: