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

Natively bold letter symbols become extremely high in monospace editors #1515

Open
3 tasks done
mooreye opened this issue Feb 13, 2024 · 17 comments
Open
3 tasks done

Comments

@mooreye
Copy link

mooreye commented Feb 13, 2024

🗹 Requirements

  • I have searched the issues for my issue and found nothing related and/or helpful
  • I have searched the FAQ for help
  • I have searched the Wiki for help

🎯 Subject of the issue

Experienced behavior:

Natively bold unicode letters like 𝐅𝐎𝐎𝐁𝐀𝐑 are extremely high in a monospace editor like gedit.

Expected behavior:

𝐅𝐎𝐎𝐁𝐀𝐑 displays with normal height.

Example symbols:

𝐅𝐎𝐎𝐁𝐀𝐑
generated with: https://lingojam.com/BoldTextGenerator

🔧 Your Setup

  • Which font are you using (e.g. Anonymice Powerline Nerd Font Complete.ttf)?
    Tested with:
    • InconsolataNerdFont-Regular.ttf
    • SauceCodeProNerdFontMono-Regular.ttf
  • Where did you get the file from (download link, self patched, source downloaded from link...)
    • git clone --filter=blob:none --sparse https://github.com/ryanoasis/nerd-fonts.git
    • git sparse-checkout add patched-fonts/{Inconsolata,SourceCodePro}
    • copied to ~/.local/share/fonts/
  • Which terminal emulator are you using (e.g. iterm2, urxvt, gnome, konsole)?
    • gnome
  • Are you using OS X, Linux or Windows? And which specific version or distribution?
    • Linux, Fedora 39

★ Screenshots (Optional)

This is how hugely high line 4 becomes in gedit:
2024-02-13T22:22:20,123864172+01:00

@mooreye
Copy link
Author

mooreye commented Feb 13, 2024

It seems to happen with every nerd font from https://www.nerdfonts.com/font-downloads
While with any regular system-installed font there is no such issue.

@237dmitry
Copy link

It seems to happen with every nerd font

In my environment this happens with any font and in any application.

@Finii
Copy link
Collaborator

Finii commented Mar 16, 2024

Oh, sorry to hear you have problems!

Hmm, just did one test, on my machine with Tilix and CaskadiaCove it does not happen

image

Ah gnome terminal you say ...

image

In my environment this happens with any font and in any application.

In my environment does not happen with any (of the two tested) applications

This must be something to do with your setup and what the fallback font is.

@Finii Finii closed this as not planned Won't fix, can't repro, duplicate, stale Mar 16, 2024
@237dmitry
Copy link

237dmitry commented Mar 16, 2024

In my environment does not happen with any (of the two tested) applications

Are you serious? These aren't even alphabetic characters...

Firefox:

ss-1

Tilix:

ss-2

@Finii
Copy link
Collaborator

Finii commented Mar 16, 2024

Are you serious? It's not even a font...

That it is working on my machine? Yes?!

Lets see, the codepoints are this:

image

The bold F is U+1D405.

$ fc-list :charset=1D405 family
DejaVu Math TeX Gyre
Latin Modern Math
TeX Gyre Pagella Math
TeX Gyre Termes Math
FreeSerif
TeX Gyre Schola Math
DejaVu Serif,DejaVu Serif Condensed
TeX Gyre Bonum Math
TeX Gyre DejaVu Math
FreeSans
DejaVu Serif
FreeMono

I have no clue which one is used, but the one randomly chosen seems good on my machine :-D

Anyhow that "bold codepoints" are not part of Nerd Fonts patching and not (at lost not many) of the to-be-patched fonts.
That only works if some fontfallback like technique is active on your machine.

@237dmitry
Copy link

It's not even a font...

I edit it already

$ fc-list :charset=1D405 family
DejaVu Math TeX Gyre
DejaVu Serif,DejaVu Serif Condensed
Noto Sans Math
DejaVu Serif

ss-3

@mooreye
Copy link
Author

mooreye commented Mar 16, 2024

Terminal enforces line height so it's not a good place to test. Please check a GUI plaintext editor like gedit

@237dmitry
Copy link

Mousepad:

ss-3

@Finii
Copy link
Collaborator

Finii commented Mar 16, 2024

image

@mooreye Please check with some more common GUI thing like Writer. Did you check the output of above fc-list?
This is some font configuration thing; it has nothing to do with the patched fonts per se.

Edit: Typo

@Finii
Copy link
Collaborator

Finii commented Mar 16, 2024

gedit via flatpak

image

@Finii
Copy link
Collaborator

Finii commented Mar 16, 2024

Interestingly gedit uses a different fallback font than writer (on my system).

In writer it is smaller (less tall) and has serifs; with gedit it is slightly bigger and is a sans serif style.

Well, I have no preferences rules, as I never ever use these things.

@Finii
Copy link
Collaborator

Finii commented Mar 16, 2024

Suggestion for @mooreye

  • Find out which concrete fonts you have that supply these codepoints
  • Select the one you like best
  • Put that font into a preference rule in your fontconfig

If you never changed your fontconfig, this can be used as inspiration, but I am sure there are tons of example on SO or somewhere.
https://github.com/ryanoasis/nerd-fonts/blob/-/10-nerd-font-symbols.conf

@Finii
Copy link
Collaborator

Finii commented Mar 16, 2024

https://yaytext.com/blog/mathematical-unicode-letters/ 😆

But they are right:

image

@mooreye
Copy link
Author

mooreye commented Apr 1, 2024

Thank you all for trying to help with this.

I'm using Fedora 39.

I have Inconsolata and SourceCodePro fonts installed in ~/.local/share/fonts/.

This is my ~/.config/fontconfig/fonts.conf:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <match target="pattern">
        <test name="family" qual="any">
            <string>monospace</string>
        </test>
        <edit binding="strong" mode="prepend" name="family">
            <string>SauceCodePro Nerd Font Mono</string>
        </edit>
    </match>
    <match target="pattern">
        <test name="family" qual="any">
            <string>proportional</string>
        </test>
        <edit binding="strong" mode="prepend" name="family">
            <string>SauceCodePro Nerd Font Propo</string>
        </edit>
    </match>
</fontconfig>

Command fc-match monospace outputs SauceCodeProNerdFontMono-Regular.ttf: "SauceCodePro Nerd Font Mono" "Regular".

I have gedit installed natively via dnf.

With these Gedit settings, the issue happens:

image

When I untick Use the system fixed width font, the issue resolves itself:

image

Command fc-match 'Monospace Regular' outputs Vera.ttf: "Bitstream Vera Sans" "Regular".

And when I change to this font in Gedit, the issue is indeed resolved:

image

However, I want to use my Nerd Font. Is there some modification to fonts.conf that can be made so these glyphs fall back to Bitstream Vera Sans Mono Regular?

This didn't work:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <match target="pattern">
        <test name="family" qual="any">
            <string>monospace</string>
        </test>
        <edit binding="strong" mode="prepend" name="family">
            <string>SauceCodePro Nerd Font Mono</string>
        </edit>
        <edit binding="strong" mode="prepend" name="family">
            <string>Bitstream Vera Sans Mono</string>
        </edit>
    </match>
    <match target="pattern">
        <test name="family" qual="any">
            <string>proportional</string>
        </test>
        <edit binding="strong" mode="prepend" name="family">
            <string>SauceCodePro Nerd Font Propo</string>
        </edit>
        <edit binding="strong" mode="prepend" name="family">
            <string>Bitstream Vera Sans Mono</string>
        </edit>
    </match>
</fontconfig>

@Finii
Copy link
Collaborator

Finii commented Apr 2, 2024

Where did you get the unpatched Vera from?
Can you show fc-list | grep Vera ;-D

But I guess I should not look at this until Nerd Fonts 3.2.0 is ready 😬

@mooreye
Copy link
Author

mooreye commented Apr 2, 2024

fc-list | grep Vera

/usr/share/fonts/bitstream-vera-sans-mono-fonts/VeraMono.ttf: Bitstream Vera Sans Mono:style=Regular,Roman
/usr/share/fonts/bitstream-vera-serif-fonts/VeraSeBd.ttf: Bitstream Vera Serif:style=Bold
/usr/share/fonts/bitstream-vera-sans-fonts/Vera.ttf: Bitstream Vera Sans:style=Regular,Roman
/usr/share/fonts/bitstream-vera-sans-mono-fonts/VeraMoIt.ttf: Bitstream Vera Sans Mono:style=Oblique
/usr/share/fonts/bitstream-vera-sans-fonts/VeraBI.ttf: Bitstream Vera Sans:style=Bold Oblique
/usr/share/fonts/bitstream-vera-sans-fonts/VeraBd.ttf: Bitstream Vera Sans:style=Bold
/usr/share/fonts/bitstream-vera-serif-fonts/VeraSe.ttf: Bitstream Vera Serif:style=Regular,Roman
/usr/share/fonts/bitstream-vera-sans-mono-fonts/VeraMoBI.ttf: Bitstream Vera Sans Mono:style=Bold Oblique
/usr/share/fonts/bitstream-vera-sans-fonts/VeraIt.ttf: Bitstream Vera Sans:style=Oblique
/usr/share/fonts/bitstream-vera-sans-mono-fonts/VeraMoBd.ttf: Bitstream Vera Sans Mono:style=Bold

It's installed from dnf:

rpm -qf /usr/share/fonts/bitstream-vera-sans-mono-fonts/VeraMono.ttf

bitstream-vera-sans-mono-fonts-1.10-48.fc38.noarch

@Finii
Copy link
Collaborator

Finii commented Apr 2, 2024

Tnx. I'll try that after the 3.2.0 release

@Finii Finii reopened this Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants