romkatv / powerlevel10k

A Zsh theme
MIT License
44.26k stars 2.12k forks source link

Azure icon UTF-8 RTL issue #2691

Closed itay-grudev closed 1 month ago

itay-grudev commented 1 month ago

When the Azure icon is displayed the following characters get strangely misaligned, which in the example below move the 4 and the / bracket.

Screenshot from 2024-05-27 03-32-26

This can be reproduced by:

echo -e "\uFD03" "4"

I believe the solution would be to put a \u200E UTF-8 Right-to-Left Mark after the Azure symbol. Example:

echo -e "\uFD03\u200E" "4"
romkatv commented 1 month ago

If your terminal does that, you need to do the following:

  1. Ensure your terminal is configured to use a relatively recent font. As a test, run print '\UF0805'. It should print the same icon as print '\uFD03'. If it does not, install the recommended font.
  2. Open ~/.p10k.zsh, find POWERLEVEL9K_MODE and set its value to nerdfont-v3.

Note that you can also override individual icons like this:

POWERLEVEL9K_AZURE_ICON='\UF0805'

Run get_icon_names to see the list of all icon labels and their values.

itay-grudev commented 1 month ago

@romkatv I am using the recommended font. And p10k configure set:

POWERLEVEL9K_MODE=nerdfont-complete

I think the problem is simply that \uFD03 (ﴃ) is an Arabic RTL symbol so some symbols after it are also rendered RTL and reversed.

If you don't think the PR is useful though I'll close it.

It's specifically in the: 'nerdfont-complete'|'nerdfont-fontconfig') case.

romkatv commented 1 month ago

@romkatv I am using the recommended font.

If it's a new enough version, the confirmation step that I described earlier will succeed.

I think the problem is simply that \uFD03 (ﴃ) is an Arabic RTL symbol so some symbols after it are also rendered RTL and reversed.

Yes, I know that. This was an old design mistake in Nerd Fonts that has since been fixed. My previous comment tells you what you can do.

And p10k configure set:

POWERLEVEL9K_MODE=nerdfont-complete

This is exactly as I expected. If you do what I suggested, it'll solve your issue.

If you don't think the PR is useful though I'll close it.

It would be useful if you ensured that it does not break anything on any of the most popular 10 terminals. I don't recommend doing it given the high risk/benefit ratio.

tl;dr: Please try what I suggested in my previous comment.

itay-grudev commented 1 month ago

It works of course. Thank you for your time.