atlas-engineer / nyxt

Nyxt - the hacker's browser.
https://nyxt-browser.com/
9.91k stars 415 forks source link

Ligatures in prompt-buffer (for monospace font). Problem just in my setup? #3000

Closed simendsjo closed 1 year ago

simendsjo commented 1 year ago

I get some "ligatures" in my prompt buffer. See how fi is rendered:

image

It's not rendered like this in html, e.g. when using Iosevka: image

I see prompt-buffer override the font family, could this be the reason? :font-family "monospace,monospace"

So it's my operating system which is configured strangely?

EDIT: When disabling the font override, I get the expected output:

image

EDIT2: It doesn't seem like there's an easy way to modify style without copy/paste the entire old block?

aartaka commented 1 year ago

I get some "ligatures" in my prompt buffer. See how fi is rendered:

image

It's not rendered like this in html, e.g. when using Iosevka: image

I see prompt-buffer override the font family, could this be the reason? :font-family "monospace,monospace"

Yes, that most probably is.

So it's my operating system which is configured strangely?

Yes. monospace,monospace uses the system default monspace font.

EDIT: When disabling the font override, I get the expected output:

image

A proof of the hypotheses above :D

EDIT2: It doesn't seem like there's an easy way to modify style without copy/paste the entire old block?

If you mean configuration, then it's achievable with %slot-value%:

(define-configuration :prompt-buffer
  ((style
    (str:concat
     %slot-value%
     (theme:themed-css (theme *browser*)
       `(*
         :font-family "Iosevka"))))))
simendsjo commented 1 year ago

So it's my operating system which is configured strangely?

Yes. monospace,monospace uses the system default monspace font.

Thanks, I see it now:

    <alias>
        <family>monospace</family>
        <prefer>
            <family>Noto Sans Mono</family>
            <family>DejaVu Sans Mono</family>
            <family>Inconsolata</family>
            <family>Andale Mono</family>
            <family>Courier New</family>
            <family>Cumberland AMT</family>
            <family>Luxi Mono</family>
            <family>Nimbus Mono L</family>
            <family>Nimbus Mono</family>
            <family>Nimbus Mono PS</family>
            <family>Courier</family>
        </prefer>
    </alias>

EDIT2: It doesn't seem like there's an easy way to modify style without copy/paste the entire old block?

If you mean configuration, then it's achievable with %slot-value%:

Last one wins then? I didn't know I could override just by adding a new entry like that, thanks!

aartaka commented 1 year ago

Last one wins then? I didn't know I could override just by adding a new entry like that, thanks!

Yes, in most cases. In cases it doesn't work you can try something like:

`(* 
  :font-family "Iosevka" !important)

Which is a CSS-native way to override any previous style.

jmercouris commented 1 year ago

Nice :-)