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

Emoji spacing in nwg-wrapper #939

Open
petrmanek opened this issue Nov 11, 2023 · 2 comments
Open

Emoji spacing in nwg-wrapper #939

petrmanek opened this issue Nov 11, 2023 · 2 comments

Comments

@petrmanek
Copy link

First of all, very nice job on wttr.in; I rely on it every day! I am currently using nwg-wrapper and ansifilter to display v1 and v2 forecast, and was wondering if you could give me some tips on character spacing with emoji fonts, as it is rather important for v2 layout to appear legible.

My current issue is that whenever emoji symbols appear, line height and character width is slightly larger than a standard monospace character. This in turn throws things off alignment, and causes an overflow in the right. In addition, I do not really understand why but sometimes a monospace font symbol is used instead of emoji. Both of these symptoms can be seen for instance on the weather symbols line or moon phases line in the following screenshot:

20231111_11h57m07s_grim

The picture above was generated using the following script:

curl -s "https://v2.wttr.in/$city" | grep -v "^$" | ansifilter -c -M -F "Terminus" -s 11 --art-tundra

As a monospace font, I am using Terminus but I verified that the same result can be reproduced using any other monospace font. My emoji font is Joypixels. My ~/.config/fontconfig/fonts.conf file looks like this:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <alias>
    <family>monospace</family>
    <prefer>
      <family>xos4 Terminus</family> <!-- Your preferred monospace font -->
      <family>JoyPixels</family> <!-- Your preferred emoji font -->
     </prefer>
  </alias>
</fontconfig>

I read the part of the README re: URXVT, specifically the URxvt.letterSpace: 0 setting and the symbola font workaround. I was wondering if you are aware of an equivalent setting for pango, or something similar that could help me squeeze those emojis into their bounding box, so that the table does not spill over. Thank you for any ideas you can share!

@petrmanek
Copy link
Author

Anyone here?

@petrmanek
Copy link
Author

@chubin Hello?

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

1 participant