wthrr-the-weathercrab icon indicating copy to clipboard operation
wthrr-the-weathercrab copied to clipboard

Can the graphs in Hourly forecasts be disabled?

Open 0323pin opened this issue 1 year ago • 9 comments

Hi,

I would like to disable the graphs for the current day in the Hourly forecasts. I'm clearly missing some characters in FantasqueSansMono Nerd Font or, on alacritty,

2022-10-21-134925_675x740_scrot

I don't want to change font or terminal, so the alternative would be to disable the graph.

Thanks.

0323pin avatar Oct 21 '22 11:10 0323pin

Thanks for opening the issue and info for reproduction!

Currently, it can not be disabled, unfortunately.

I've scheduled some time in the next days to work on the app. I'll do my best to implement something like this and to fix the graph, so it works with more terminal/font combinations.

ttytm avatar Oct 21 '22 22:10 ttytm

Hey again @0323pin,

FantasqueSans is a font I'm also using in some of my dot files. So a reproduction was a super quick thing to do - hoping to also provide a quick fix for the problem.

Due to the "oversized" nerd icons and the missing symbols, I guess the issue comes down to a not fully up-to-date version of the font that you are using. What's also visible on the screenshot is that the superscripted precipitation units are also not patched into that version. So disabling the graph would still result in missing icons.

I've experienced similar problems with patched fonts when installing them via the package manager. If you have installed it via the package manager, downloading it directly from the nerd-fonts repo and using that version is something you could try. nerd-fonts/.../FantasqueSansMono

This is how it looks reproducing the issue with latest FantasqueSansMono Nerd Font Mono version. left kitty ; right alacritty: Screenshot_20221022_121140

There are still some small missplacements in the graph symbols which is down to alacritty not the font. I will check on the possibilites to fix this, but it's already usable I would say.

For now, would this be another alternative you are willing to use?

ttytm avatar Oct 22 '22 11:10 ttytm

This looks good enough 😄

I did fetch the font from the nerdfonts site.

I'll refetch them as it was probably over a year ago since I've installed them.

Would you mind sharing your alacritty.yml? Here's mine, https://codeberg.org/pin/leftwm-netbsd/raw/branch/master/.config/alacritty/alacritty.yml

0323pin avatar Oct 22 '22 12:10 0323pin

Let me know how it goes. I think if it works, it's fair enough to have the latest nerd fonts as a requirement for the app to work.

Sure, I'll post it below. In the same breath, I have to admit that - as much as I am a Rust fanboy - alacritty never qualified to become one of my favorite tools. So the configuration file never went beyond a few minutes of messy basic setup with mainly just fonts and theme. Please forgive for posting it without cleaning it up.

alacritty.yml
window:
  padding:
    x: 0
    y: 0

  opacity: 0.95

# Font configuration
font:
  normal:
    # Font family
    #
    # Default:
    #   - (macOS) Monaco
    #   - (Linux/BSD) monospace
    #   - (Windows) Consolas
    # family: JetBrainsMono Nerd Font Mono
    family: FantasqueSansMono Nerd Font Mono

    # The `style` can be specified to pick a specific face.
    style: Regular

  bold:
    # Font family
    #
    # If the bold family is not specified, it will fall back to the
    # value specified for the normal font.
    # family: Roboto Mono for Powerline

    # The `style` can be specified to pick a specific face.
    style: SemiBold

  italic:
    # Font family
    #
    # If the italic family is not specified, it will fall back to the
    # value specified for the normal font.
    # family: Roboto Mono for Powerline
    family: JetBrainsMono

    # The `style` can be specified to pick a specific face.
    style: Italic

  bold_italic:
    # Font family
    #
    # If the bold italic family is not specified, it will fall back to the
    # value specified for the normal font.
    # family: Roboto Mono for Powerline

    # The `style` can be specified to pick a specific face.
    style: SemiBold Italic

  # Point size
  size: 10

  # Offset is the extra space around each character. `offset.y` can be thought of
  # as modifying the line spacing, and `offset.x` as modifying the letter spacing.
  offset:
    x: 0
    y: 2

  # Glyph offset determines the locations of the glyphs within their cells with
  # the default being at the bottom. Increasing `x` moves the glyph to the right,
  # increasing `y` moves the glyph upwards.
  glyph_offset:
    x: 0
    y: 0

  # Thin stroke font rendering (macOS only)
  #
  # Thin strokes are suitable for retina displays, but for non-retina screens
  # it is recommended to set `use_thin_strokes` to `false`
  #
  # macOS >= 10.14.x:
  #
  # If the font quality on non-retina display looks bad then set
  # `use_thin_strokes` to `true` and enable font smoothing by running the
  # following command:
  #   `defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO`
  #
  # This is a global setting and will require a log out or restart to take
  # effect.
  use_thin_strokes: true

# If `true`, bold text is drawn using the bright color variants.
# draw_bold_text_with_bright_colors: true

key_bindings:
# (Windows, Linux, and BSD only)
# - { key: Return,      action: None           }
#- { key: C,        mods: Control|Shift, action: Copy             }
#- { key: Insert,   mods: Shift,         action: PasteSelection   }
#- { key: Key0,     mods: Control,       action: ResetFontSize    }
 - { key: Equals,   mods: Control,       action: ResetFontSize }
 - { key: Plus,     mods: Control|Shift, action: IncreaseFontSize }
 - { key: Minus,    mods: Control,       action: DecreaseFontSize }

schemes:
  # Tokyo Night theme, based on both:
  #   https://github.com/ghifarit53/tokyonight-vim
  #   https://github.com/enkia/tokyo-night-vscode-theme
  tokyo-night: &tokyo-night # Default colors
    primary:
      # background: "0x1a1b26"
      # background: "0x222638"
      background: "0x282A36"
      foreground: "0xa9b1d6"

    # Normal colors
    normal:
      black: "0x32344a"
      red: "0xf7768e"
      green: "0x9ece6a"
      yellow: "0xe0af68"
      blue: "0x7aa2f7"
      magenta: "0xad8ee6"
      cyan: "0x449dab"
      white: "0x787c99"

    # Bright colors
    bright:
      black: "0x444b6a"
      red: "0xff7a93"
      green: "0xb9f27c"
      yellow: "0xff9e64"
      blue: "0x7da6ff"
      magenta: "0xbb9af7"
      cyan: "0x0db9d7"
      white: "0xacb0d0"

  tokyo-night-storm: &tokyo-night-storm # Default colors
    primary:
      background: "0x24283b"
      foreground: "0xa9b1d6"

    # Normal colors
    normal:
      black: "0x32344a"
      red: "0xf7768e"
      green: "0x9ece6a"
      yellow: "0xe0af68"
      blue: "0x7aa2f7"
      magenta: "0xad8ee6"
      cyan: "0x449dab"
      white: "0x9699a8"

    # Bright colors
    bright:
      black: "0x444b6a"
      red: "0xff7a93"
      green: "0xb9f27c"
      yellow: "0xff9e64"
      blue: "0x7da6ff"
      magenta: "0xbb9af7"
      cyan: "0x0db9d7"
      white: "0xacb0d0"

    # Dracula theme for Alacritty
    # https://draculatheme.com/alacritty
    #
    # Color palette
    # https://spec.draculatheme.com
    #
    # Template
    # https://github.com/alacritty/alacritty/blob/master/alacritty.yml

  dracula: &dracula
    primary:
      background: "#282a36"
      foreground: "#f8f8f2"
      bright_foreground: "#ffffff"
    cursor:
      text: CellBackground
      cursor: CellForeground
    vi_mode_cursor:
      text: CellBackground
      cursor: CellForeground
    search:
      matches:
        foreground: "#44475a"
        background: "#50fa7b"
      focused_match:
        foreground: "#44475a"
        background: "#ffb86c"
      bar:
        background: "#282a36"
        foreground: "#f8f8f2"
    hints:
      start:
        foreground: "#282a36"
        background: "#f1fa8c"
      end:
        foreground: "#f1fa8c"
        background: "#282a36"
    line_indicator:
      foreground: None
      background: None
    selection:
      text: CellForeground
      background: "#44475a"
    normal:
      black: "#21222c"
      red: "#ff5555"
      green: "#50fa7b"
      yellow: "#f1fa8c"
      blue: "#bd93f9"
      magenta: "#ff79c6"
      cyan: "#8be9fd"
      white: "#f8f8f2"
    bright:
      black: "#6272a4"
      red: "#ff6e6e"
      green: "#69ff94"
      yellow: "#ffffa5"
      blue: "#d6acff"
      magenta: "#ff92df"
      cyan: "#a4ffff"
      white: "#ffffff"

colors: *tokyo-night

ttytm avatar Oct 22 '22 17:10 ttytm

@tobealive Using family: FantasqueSansMono Nerd Font Mono instead of family: FantasqueSansMono Nerd Font made a difference. I've re-fetched the font as well, still, I have to dig deeper.

Here's how it looks now 2022-10-22-224720_1358x740_scrot

As you can see, there are still issues. Also, I don't know why colors are missing but, as said, I'll dig further.

0323pin avatar Oct 22 '22 20:10 0323pin

Okay, seems we are coming closer.

Running kitty in font debug mode I found out that the terminal uses NotoSansMono-Regular for the superscripted precipitation unit icons. But I could not get info on the graph icons yet - might also be NotoSans.

Alacritty will most certainly have a debug mode too. Does it tell you which font is missing then?

ttytm avatar Oct 23 '22 08:10 ttytm

alacritty -v outputs nothing useful, increasing the verbose level, I get the following

> alacritty -vv
...
[5.831237229s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 }
[5.835325552s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Roman, load_flags: TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 }

> alacritty -vvv
...
[7.730173262s] [TRACE] [crossfont] Got font path="/usr/X11R7/lib/X11/fonts/TTF/Vera.ttf", index=0
[7.730653494s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Roman, load_flags: TARGET_LIGHT, render_mode: "Normal", lcd_filter: 1 }

Wonder why it's looking for other fonts. Apparently, looking for a Roman variant.

font:
  normal:
    family: FantasqueSansMono Nerd Font Mono
    style: Regular

  bold:
    family: FantasqueSansMono Nerd Font Mono
    style: Bold

  italic:
    family: FantasqueSansMono Nerd Font Mono
    style: Italic

  bold_italic:
    family: FantasqueSansMono Nerd Font Mono
    style: Bold Italic

  size: 8.5

0323pin avatar Oct 23 '22 19:10 0323pin

Yep, I'm a bit stumped here too and would have to dig further as well. I will also try my luck reproducing it later this week. @0323pin it's NetBSD you are using right?

Then I'd have something to debug, and trying to implement working variants wouldn't just be blind shots.

And if extending the list of requirements is the only thing necessary to allow unimpaired usage of the app while users can use their preferred terminal and font, it's the solution I prefer for now.

ttytm avatar Oct 24 '22 09:10 ttytm

@tobealive Yes, I'm using NetBSD but, before anything else, I'd like to give it a try on another laptop where I have Void Linux on top of musl libc. I'm using alacritty on Void also, so it would be a direct comparisson.

Will give it a shot tonight and report back here.

0323pin avatar Oct 24 '22 12:10 0323pin

@tobealive :disappointed: 2022-10-24-193850_950x1048_scrot

0323pin avatar Oct 24 '22 17:10 0323pin

@tobealive The good news is, ...

Same fantasqueSansMono on kitty on NetBSD looks like this,

2022-10-24-202901_1358x740_scrot

So, something is wrong with alacritty.

And with sakura, also on NetBSD (I didn't configure the fonts here)

2022-10-24-203357_1358x740_scrot

0323pin avatar Oct 24 '22 18:10 0323pin

Had to use a mint live boot and did a test here. Could reproduce the kitty / alacritty situation.

But no problems with colors being applied. It will be another thing to find out why you are running short on those when using netbsd, looks good on void.

Screenshot_20221025_133341

I'll dig further after work and report back.

ttytm avatar Oct 25 '22 11:10 ttytm

Thanks!

I have basically the same alacritty.yml on Void, just slightly different colors. Also, I have no issues with colors on other applications on NetBSD,

screenshot

All the apps displayed on the screenshot are written in Rust. Clockwise: lsd, spotify_player and tuifeed

EDIT: Void alacritty, NetBSD alacritty

EDIT 2: As for the precipitation_unit symbol, that one is missing from the selected font, I don't see it when opening hourly.rs in vim or in firefox.

2022-10-25-150000_1366x768_scrot

0323pin avatar Oct 25 '22 12:10 0323pin

Some of the discoveries:

  • Installing fonts-noto is sufficient to get the graph for alacritty working on ubuntu based distros.
  • I found that there were more problems with installing the app on distros with ubuntu base. While checking on these problems using Ubuntu 22.10 I was able to recreate this "fix".
  • Then with nerd fonts installed, also all other symbols are displayed properly.

  • Oddly enough, it works when uninstalling fonts-noto packages afterwards, clearing the font cache, etc. There doesn't seem to be a sub-dependency installed during the font package installation that keeps it running. So this carries a bit of new confusion :D

  • If you haven't already tried installing noto after https://github.com/tobealive/wthrr-the-weathercrab/issues/25#issuecomment-1288055691, let me know how it works when you install noto-font related packages of your distros / add the noto font files to your system.

  • The slightly misaligned symbols in the graph when using alacritty should also be fixable. I'll be looking into this shortly.

  • Regarding colors, I might need to move the app to a crate with wider coverage then term-painter. At first, I was down to use termcolor - which has it all - but went with the former because of its simplicity. This, I will tackle in the coming weeks.

Let me know if you can make use of something of it. If it still doesn't want to work, I just have loaded netbsd 🤞

ttytm avatar Oct 25 '22 14:10 ttytm

I'll look at this tonight.

If it still doesn't want to work, I just have loaded netbsd

Installing NetBSD for the first time can be a slight wtf. But, if we need to go there, I'm here to help 😄

0323pin avatar Oct 25 '22 14:10 0323pin

Yep, if necessary, let's go all the way 🕵🏽

And if installing noto is enough, I'll just add it to the list of requirements. I would mention you as a co-author then if I may.

ttytm avatar Oct 26 '22 09:10 ttytm

I couldn't get it to display properly in alacritty but, other terminals work. So, I wouldn't say this is a wthrr issue. It's more likely something I'm missing.

Man, now I was reminded as of why I usually avoid noto-fonts, 3Gb of diskspace 😮

0323pin avatar Oct 26 '22 14:10 0323pin

@tobealive forgot to ask. Do you think it's possible to have the hourly forecasts as a config parameter which, can be on or off?

0323pin avatar Oct 26 '22 14:10 0323pin

@0323pin

@tobealive forgot to ask. Do you think it's possible to have the hourly forecasts as a config parameter which, can be on or off?

If you mean something like saving a forecast option to have it displayed by default, then I have that on my list 👍

Currently, only it's possible via creating an alias in your shell.

ttytm avatar Oct 27 '22 09:10 ttytm

I mean have the whole graph for hourly forecast switched-off, so it does not display.

0323pin avatar Oct 27 '22 09:10 0323pin

Man, now I was reminded as of why I usually avoid noto-fonts, 3Gb of diskspace open_mouth

Yep, full noto is quite a chunk. In the tests on Ubuntu, it was sufficient to install the noto-core package, which is only a few MB in size, and omit the lang-specific noto packages.


Sharing the results from testing on BSD:

  • I've come to the conclusion that the glyphs used for the graph just don't work in alacritty under BSD.
  • I won't dig further to find out what is missing on BSD. But to work around this, I tested other Unicode symbols. These don't have as many levels, but work with alacritty. So I will add some simple configurable variants for the graph.

Journal:

  • Running NetBSD in a virtual machine was a bit tedious, but worked well enough to do a basic setup.
  • I can confirm that wthrr worked well in other terminal emulators here.
  • However, compiling alacritty was not possible under NetBSD for me. The creation of the binary file as the last step of the compilation always failed.
  • After some time, the VM broke to the point where I couldn't boot it up again, so I had to do a re-setup. When this happened a second time, I switched to another BSD operating system to continue the test 😅.
  • Being able to do more extensive testing here I can confirm your results regarding the graphic icons.
  • No problems with colors and bold fonts though.

Full font section of my alacritty.yml

alacritty.yml font: normal: family: FantasqueSansMono Nerd Font Mono

size: 12

offset: y: 3

ttytm avatar Oct 27 '22 10:10 ttytm

I mean have the whole graph for hourly forecast switched-off, so it does not display.

Ok that's the question stated in the issue title, isn't it? Saying you forgot to ask sounded like you mean some additional parameter.

Two points that should help me fully getting what you mean:

  • Do I understand correctly that you want to keep the numbers for hourly weather, just without the graph?

  • Would having the graph problem solved when using other glyphs like done in my reply above solve to problem. Would you still want to disable a graph?

That should help me to see your desired end result more clearly.


Edit: let me transform this issue into a discussion as I feel we have more than one topic here, and I'll reference all points of work in separate issues when having some clear steps to take.

ttytm avatar Oct 27 '22 10:10 ttytm