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

[bug] wrong space width of emoji characters #6

Open
Freed-Wu opened this issue Jun 16, 2024 · 6 comments
Open

[bug] wrong space width of emoji characters #6

Freed-Wu opened this issue Jun 16, 2024 · 6 comments

Comments

@Freed-Wu
Copy link
Collaborator

Screenshot from 2024-06-16 23-50-52

space width after 2 and 0 is too long.

@black-desk
Copy link
Owner

I need more infomation:

  • Terminal enmulator
  • Font

@Freed-Wu
Copy link
Collaborator Author

  • terminal: wezterm 20240203-110809-5046fc22
  • font:
$ wezterm ls-fonts

Primary font:
wezterm.font_with_fallback({
  -- /usr/share/fonts/TTF/JetBrainsMonoNerdFontMono-Regular.ttf, FontConfig
  -- AKA: "JetBrainsMono NFM"
  "JetBrainsMono Nerd Font Mono",

  -- /usr/share/fonts/wenquanyi/wqy-zenhei/wqy-zenhei.ttc index=1 variation=0, FontConfig
  -- AKA: "文泉驛等寬正黑"
  -- AKA: "文泉驿等宽正黑"
  {family="WenQuanYi Zen Hei Mono", weight="Medium"},

  -- /usr/share/fonts/wenquanyi/wqy-microhei/wqy-microhei.ttc index=1 variation=0, FontConfig
  -- AKA: "文泉驛等寬微米黑"
  -- AKA: "文泉驿等宽微米黑"
  "WenQuanYi Micro Hei Mono",

  -- /usr/share/fonts/TTF/JetBrainsMono-Regular.ttf, FontConfig
  "JetBrains Mono",

  -- /usr/share/fonts/noto/NotoColorEmoji.ttf, FontConfig
  -- Assumed to have Emoji Presentation
  -- Pixel sizes: [128]
  "Noto Color Emoji",

})


When Intensity=Half Italic=true:
wezterm.font_with_fallback({
  -- /usr/share/fonts/TTF/JetBrainsMonoNerdFontMono-ExtraLightItalic.ttf, FontConfig
  -- AKA: "JetBrainsMono NFM"
  -- AKA: "JetBrainsMono NFM ExtraLight"
  {family="JetBrainsMono Nerd Font Mono", weight="ExtraLight", style="Italic"},

  -- /usr/share/fonts/wenquanyi/wqy-zenhei/wqy-zenhei.ttc index=1 variation=0, FontConfig
  -- Will synthesize italics
  -- Will synthesize dim
  -- AKA: "文泉驛等寬正黑"
  -- AKA: "文泉驿等宽正黑"
  {family="WenQuanYi Zen Hei Mono", weight="Medium"},

  -- /usr/share/fonts/wenquanyi/wqy-microhei/wqy-microhei.ttc index=1 variation=0, FontConfig
  -- Will synthesize italics
  -- Will synthesize dim
  -- AKA: "文泉驛等寬微米黑"
  -- AKA: "文泉驿等宽微米黑"
  "WenQuanYi Micro Hei Mono",

  -- /usr/share/fonts/TTF/JetBrainsMono-Regular.ttf, FontConfig
  "JetBrains Mono",

  -- /usr/share/fonts/noto/NotoColorEmoji.ttf, FontConfig
  -- Assumed to have Emoji Presentation
  -- Pixel sizes: [128]
  "Noto Color Emoji",

})


When Intensity=Half Italic=false:
wezterm.font_with_fallback({
  -- /usr/share/fonts/TTF/JetBrainsMonoNerdFontMono-ExtraLight.ttf, FontConfig
  -- AKA: "JetBrainsMono NFM"
  -- AKA: "JetBrainsMono NFM ExtraLight"
  {family="JetBrainsMono Nerd Font Mono", weight="ExtraLight"},

  -- /usr/share/fonts/wenquanyi/wqy-zenhei/wqy-zenhei.ttc index=1 variation=0, FontConfig
  -- Will synthesize dim
  -- AKA: "文泉驛等寬正黑"
  -- AKA: "文泉驿等宽正黑"
  {family="WenQuanYi Zen Hei Mono", weight="Medium"},

  -- /usr/share/fonts/wenquanyi/wqy-microhei/wqy-microhei.ttc index=1 variation=0, FontConfig
  -- Will synthesize dim
  -- AKA: "文泉驛等寬微米黑"
  -- AKA: "文泉驿等宽微米黑"
  "WenQuanYi Micro Hei Mono",

  -- /usr/share/fonts/TTF/JetBrainsMono-Regular.ttf, FontConfig
  "JetBrains Mono",

  -- /usr/share/fonts/noto/NotoColorEmoji.ttf, FontConfig
  -- Assumed to have Emoji Presentation
  -- Pixel sizes: [128]
  "Noto Color Emoji",

})


When Intensity=Bold Italic=false:
wezterm.font_with_fallback({
  -- /usr/share/fonts/TTF/JetBrainsMonoNerdFontMono-SemiBold.ttf, FontConfig
  -- AKA: "JetBrainsMono NFM"
  -- AKA: "JetBrainsMono NFM SemiBold"
  {family="JetBrainsMono Nerd Font Mono", weight="DemiBold"},

  -- /usr/share/fonts/wenquanyi/wqy-zenhei/wqy-zenhei.ttc index=1 variation=0, FontConfig
  -- AKA: "文泉驛等寬正黑"
  -- AKA: "文泉驿等宽正黑"
  {family="WenQuanYi Zen Hei Mono", weight="Medium"},

  -- /usr/share/fonts/wenquanyi/wqy-microhei/wqy-microhei.ttc index=1 variation=0, FontConfig
  -- Will synthesize bold
  -- AKA: "文泉驛等寬微米黑"
  -- AKA: "文泉驿等宽微米黑"
  "WenQuanYi Micro Hei Mono",

  -- /usr/share/fonts/TTF/JetBrainsMono-Regular.ttf, FontConfig
  "JetBrains Mono",

  -- /usr/share/fonts/noto/NotoColorEmoji.ttf, FontConfig
  -- Assumed to have Emoji Presentation
  -- Pixel sizes: [128]
  "Noto Color Emoji",

})


When Intensity=Bold Italic=true:
wezterm.font_with_fallback({
  -- /usr/share/fonts/TTF/JetBrainsMonoNerdFontMono-SemiBoldItalic.ttf, FontConfig
  -- AKA: "JetBrainsMono NFM"
  -- AKA: "JetBrainsMono NFM SemiBold"
  {family="JetBrainsMono Nerd Font Mono", weight="DemiBold", style="Italic"},

  -- /usr/share/fonts/wenquanyi/wqy-zenhei/wqy-zenhei.ttc index=1 variation=0, FontConfig
  -- Will synthesize italics
  -- AKA: "文泉驛等寬正黑"
  -- AKA: "文泉驿等宽正黑"
  {family="WenQuanYi Zen Hei Mono", weight="Medium"},

  -- /usr/share/fonts/wenquanyi/wqy-microhei/wqy-microhei.ttc index=1 variation=0, FontConfig
  -- Will synthesize italics
  -- Will synthesize bold
  -- AKA: "文泉驛等寬微米黑"
  -- AKA: "文泉驿等宽微米黑"
  "WenQuanYi Micro Hei Mono",

  -- /usr/share/fonts/TTF/JetBrainsMono-Regular.ttf, FontConfig
  "JetBrains Mono",

  -- /usr/share/fonts/noto/NotoColorEmoji.ttf, FontConfig
  -- Assumed to have Emoji Presentation
  -- Pixel sizes: [128]
  "Noto Color Emoji",

})


When Intensity=Normal Italic=true:
wezterm.font_with_fallback({
  -- /usr/share/fonts/TTF/JetBrainsMonoNerdFontMono-Italic.ttf, FontConfig
  -- AKA: "JetBrainsMono NFM"
  {family="JetBrainsMono Nerd Font Mono", style="Italic"},

  -- /usr/share/fonts/wenquanyi/wqy-zenhei/wqy-zenhei.ttc index=1 variation=0, FontConfig
  -- Will synthesize italics
  -- AKA: "文泉驛等寬正黑"
  -- AKA: "文泉驿等宽正黑"
  {family="WenQuanYi Zen Hei Mono", weight="Medium"},

  -- /usr/share/fonts/wenquanyi/wqy-microhei/wqy-microhei.ttc index=1 variation=0, FontConfig
  -- Will synthesize italics
  -- AKA: "文泉驛等寬微米黑"
  -- AKA: "文泉驿等宽微米黑"
  "WenQuanYi Micro Hei Mono",

  -- /usr/share/fonts/TTF/JetBrainsMono-Regular.ttf, FontConfig
  "JetBrains Mono",

  -- /usr/share/fonts/noto/NotoColorEmoji.ttf, FontConfig
  -- Assumed to have Emoji Presentation
  -- Pixel sizes: [128]
  "Noto Color Emoji",

})

Title font:
wezterm.font_with_fallback({
  -- /usr/share/fonts/TTF/Roboto-Bold.ttf, FontConfig
  {family="Roboto", weight="Bold"},

  -- /usr/share/fonts/TTF/JetBrainsMonoNerdFontMono-Regular.ttf, FontConfig
  -- AKA: "JetBrainsMono NFM"
  "JetBrainsMono Nerd Font Mono",

  -- /usr/share/fonts/wenquanyi/wqy-zenhei/wqy-zenhei.ttc index=1 variation=0, FontConfig
  -- AKA: "文泉驛等寬正黑"
  -- AKA: "文泉驿等宽正黑"
  {family="WenQuanYi Zen Hei Mono", weight="Medium"},

  -- /usr/share/fonts/wenquanyi/wqy-microhei/wqy-microhei.ttc index=1 variation=0, FontConfig
  -- AKA: "文泉驛等寬微米黑"
  -- AKA: "文泉驿等宽微米黑"
  "WenQuanYi Micro Hei Mono",

  -- /usr/share/fonts/TTF/JetBrainsMono-Regular.ttf, FontConfig
  "JetBrains Mono",

  -- /usr/share/fonts/noto/NotoColorEmoji.ttf, FontConfig
  -- Assumed to have Emoji Presentation
  -- Pixel sizes: [128]
  "Noto Color Emoji",

})

@Freed-Wu
Copy link
Collaborator Author

If we display #v[2]:

local candidate = string.sub(v[1], 1, #v[1] - 1) .. ' ' .. #v[2] .. ' ' .. v[2]

screen-2024-06-23-17-22-22

We can find the 6th candidate is 🫵🏻 not 🫵.
🫵🏻 is two character, first is 🫵, second is 🏻.

@Freed-Wu
Copy link
Collaborator Author

I think it is neovim's bug for combined emoji display.

@Freed-Wu
Copy link
Collaborator Author

screen-2024-06-23-17-31-47
screen-2024-06-23-17-32-23

@black-desk
Copy link
Owner

Let's keep this open.
I don't think this is a neovim issue.

@black-desk black-desk reopened this Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants