91861 / wayst

A simple terminal emulator
MIT License
293 stars 9 forks source link

Emoji #86

Open yellowhat opened 3 years ago

yellowhat commented 3 years ago

Hi, I am noticing very strange artifacts when rendering emoji.

I am using the following config file:

font = "monospace"
font-color = "joypixels"
font-symbol = "joypixels"
font-size=10
dpi=96
no-dynamic-title=true
blink="true:500:1:999"
colorscheme="linux tty"
bg-color="#000000ff"
fg-color="#ffffff"

If I try to display some emoji, this is the wayst --debug-font:

Match result for '-10':
  /usr/share/fonts/liberation-fonts/LiberationSans-Regular.ttf
Match result for '-10:Bold':
  /usr/share/fonts/liberation-fonts/LiberationSans-Bold.ttf
Match result for '-10:Italic':
  /usr/share/fonts/liberation-fonts/LiberationSans-Italic.ttf
Match result for '-10:Bold:Italic':
  /usr/share/fonts/liberation-fonts/LiberationSans-BoldItalic.ttf
Match result for 'monospace-10':
  /usr/share/fonts/liberation-fonts/LiberationMono-Regular.ttf
Match result for 'monospace-10:Bold':
  /usr/share/fonts/liberation-fonts/LiberationMono-Bold.ttf
Match result for 'monospace-10:Italic':
  /usr/share/fonts/liberation-fonts/LiberationMono-Italic.ttf
Match result for 'monospace-10:Bold:Italic':
  /usr/share/fonts/liberation-fonts/LiberationMono-BoldItalic.ttf
Loaded styled font:
  regular:     /usr/share/fonts/liberation-fonts/LiberationMono-Regular.ttf
  bold:        /usr/share/fonts/liberation-fonts/LiberationMono-Bold.ttf
  italic:      /usr/share/fonts/liberation-fonts/LiberationMono-Italic.ttf
  bold italic: /usr/share/fonts/liberation-fonts/LiberationMono-BoldItalic.ttf
Match result for 'joypixels-10':
  /usr/share/fonts/joypixels/joypixels-6.0.0.ttf
Loaded unstyled (symbol) font:
  file:     /usr/share/fonts/joypixels/joypixels-6.0.0.ttf
Match result for 'joypixels-10':
  /usr/share/fonts/joypixels/joypixels-6.0.0.ttf
Loaded unstyled (color) font:
  file:     /usr/share/fonts/joypixels/joypixels-6.0.0.ttf
[warning] Missing glyph u+276F
[warning] Missing glyph u+276F
[warning] Missing glyph u+276F
[warning] Missing glyph u+276F
[warning] Missing glyph u+276F
[warning] Missing glyph u+276F
[warning] Missing glyph u+276F
[warning] Missing glyph u+276F
[warning] Missing glyph u+276F
[warning] Combining character limit (2) exceeded
[warning] Combining character limit (2) exceeded
[warning] Combining character limit (2) exceeded
[warning] Combining character limit (2) exceeded
[warning] Combining character limit (2) exceeded
[warning] Combining character limit (2) exceeded
[warning] Combining character limit (2) exceeded
[warning] Combining character limit (2) exceeded
[warning] Combining character limit (2) exceeded
[warning] Combining character limit (2) exceeded
[warning] Combining character limit (2) exceeded
[warning] Combining character limit (2) exceeded

The same emoji in kitty works as expected.

Is my config file wrong?

Thanks

91861 commented 3 years ago

Remove

font-symbol = "joypixels"

The font-symbol option expects a regular, non-color, font (it's meant for mathematical symbols etc.) and has higher priority than font-color. The only difference is that it doesn't look for extra styles.

I should probably combine the three font lists into one with an option to disable specific styles to make it less confusing.

yellowhat commented 3 years ago

Thanks for the reply.

I have tried with:

font = "monospace"
font-color = "joypixels"
font-size=10
dpi=96
no-dynamic-title=true
blink="true:500:1:999"
colorscheme="linux tty"
bg-color="#000000ff"
fg-color="#ffffff"

The artifacts are gone, but emoji some wrong or duplicated or missing:

$ wayst --debug-font
Match result for '-10':
  /usr/share/fonts/liberation-fonts/LiberationSans-Regular.ttf
Match result for '-10:Bold':
  /usr/share/fonts/liberation-fonts/LiberationSans-Bold.ttf
Match result for '-10:Italic':
  /usr/share/fonts/liberation-fonts/LiberationSans-Italic.ttf
Match result for '-10:Bold:Italic':
  /usr/share/fonts/liberation-fonts/LiberationSans-BoldItalic.ttf
Match result for 'monospace-10':
  /usr/share/fonts/liberation-fonts/LiberationMono-Regular.ttf
Match result for 'monospace-10:Bold':
  /usr/share/fonts/liberation-fonts/LiberationMono-Bold.ttf
Match result for 'monospace-10:Italic':
  /usr/share/fonts/liberation-fonts/LiberationMono-Italic.ttf
Match result for 'monospace-10:Bold:Italic':
  /usr/share/fonts/liberation-fonts/LiberationMono-BoldItalic.ttf
Loaded styled font:
  regular:     /usr/share/fonts/liberation-fonts/LiberationMono-Regular.ttf
  bold:        /usr/share/fonts/liberation-fonts/LiberationMono-Bold.ttf
  italic:      /usr/share/fonts/liberation-fonts/LiberationMono-Italic.ttf
  bold italic: /usr/share/fonts/liberation-fonts/LiberationMono-BoldItalic.ttf
Match result for 'joypixels-10':
  /usr/share/fonts/joypixels/joypixels-6.5.0.ttf
Loaded unstyled (color) font:
  file:     /usr/share/fonts/joypixels/joypixels-6.5.0.ttf
[warning] Missing glyph u+276F
[warning] Missing glyph u+276F
[warning] Missing glyph u+276F
[warning] Missing glyph u+276F
[warning] Missing glyph u+276F
[warning] Missing glyph u+276F
[warning] Missing glyph u+276F
[warning] Missing glyph u+276F
[warning] Missing glyph u+276F
[warning] Missing glyph u+276F
[warning] Missing glyph u+276F
[warning] Missing glyph u+276F
[warning] Missing glyph u+276F
[warning] Combining character limit (2) exceeded
[warning] Combining character limit (2) exceeded
[warning] Combining character limit (2) exceeded
[warning] Combining character limit (2) exceeded
[warning] Combining character limit (2) exceeded
[warning] Combining character limit (2) exceeded
[warning] Combining character limit (2) exceeded
[warning] Combining character limit (2) exceeded
[warning] Combining character limit (2) exceeded
[warning] Combining character limit (2) exceeded
[warning] Combining character limit (2) exceeded
[warning] Combining character limit (2) exceeded
[warning] Missing glyph u+276F
yellowhat commented 3 years ago

kitty on the left, wayst on the right, showing the same file of emoji

screenshot_2021-03-30_184525

91861 commented 3 years ago

Emoji flags are encoded as a pair of regional indicator symbols that should be joined as a ligature. If ligatures are not supported symbols' glyphs will be displayed.