Skip to content
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

Some unicode characters rendered not correctly in canvas mode #1637

Closed
robinhuy opened this issue Aug 27, 2018 · 7 comments
Closed

Some unicode characters rendered not correctly in canvas mode #1637

robinhuy opened this issue Aug 27, 2018 · 7 comments
Labels
help wanted type/bug Something is misbehaving

Comments

@robinhuy
Copy link

I display text in Terminal and some unicode characters rendered not correctly in canvas mode (default). In dom mode (using option rendererType) it display normal.

Details

  • Browser and browser version: Google Chrome 68.0.3440.106, Safari 11.1.1 & Firefox Quantum 61.0.2
  • OS version: macOS 10.13.6
  • xterm.js version: 3.6.0

Steps to reproduce

Server return unicode string to Terminal or User manually input to Terminal.

  • Canvas mode:
    image

  • Dom mode:
    image

@Tyriar
Copy link
Member

Tyriar commented Aug 27, 2018

@robinhuy did you add in those underlines or is that from the renderer? Is the problem the lines or the boldness (or lack thereof) in the canvas?

Can you provide that string so I can play around with it?

@robinhuy
Copy link
Author

@Tyriar I add the underlines to highlight the difference. Characters with green underline is nice but characters with red underline is thinner than the others.

I using this string to test: xin chào các bạn.
Character (unicode hex value U+1EA1) is thinner than à or á.

@Tyriar
Copy link
Member

Tyriar commented Aug 30, 2018

I think this is probably related to your font settings and those characters don't have bold variants or something, here's what I see using the Hack font:

screen shot 2018-08-30 at 7 10 50 am

Also in my screenshot the is cut off at the bottom, this is due to #1138

@robinhuy
Copy link
Author

I try with this font https://github.com/source-foundry/Hack instead the default and using this option to change font fontFamily: 'Hack, monospace'. But it's not work.

  • Canvas mode:
    image

  • Dom mode:
    image

I also tried fontWeight and fontWeightBold in canvas mode too:

  • Default font, canvas mode, font weight 300:
    image

  • Default font, canvas mode, font weight 700:
    image

@Tyriar
Copy link
Member

Tyriar commented Aug 31, 2018

Could you try downloading Noto Sans Mono from https://www.google.com/get/noto/ and trying it with that:

screen shot 2018-08-31 at 8 59 26 am

screen shot 2018-08-31 at 9 00 15 am

Run echo -e '\x1b[1mxin chào các bạn' to get the bold chars, just to make sure your program is not unbolding them.

@robinhuy
Copy link
Author

robinhuy commented Sep 3, 2018

It's not work. I think the problem is not by the font because in dom mode the string display nice.

image

using option: rendererType: 'dom' and override this css (change normal to bold):

.xterm-dom-renderer-owner-1 span:not(.xterm-bold) {
    font-weight: normal;
}

P/S: I'm using xtermjs on the browser and get values from backend server (use method .write() to display data).

@Tyriar Tyriar added type/bug Something is misbehaving help wanted and removed needs more info labels Sep 5, 2018
@Tyriar
Copy link
Member

Tyriar commented Sep 17, 2018

I can't seem to reproduce it, let me know if you get any more information but I'm closing this off for housekeeping purposes.

@Tyriar Tyriar closed this as completed Sep 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted type/bug Something is misbehaving
Projects
None yet
Development

No branches or pull requests

2 participants