ryanoasis / nerd-fonts

Iconic font aggregator, collection, & patcher. 3,600+ icons, 50+ patched fonts: Hack, Source Code Pro, more. Glyph collections: Font Awesome, Material Design Icons, Octicons, & more
https://NerdFonts.com
Other
52.63k stars 3.59k forks source link

`U+F001` displayed incorrectly in some Ubuntu and UbuntuMono font variations #1595

Closed eliminmax closed 2 months ago

eliminmax commented 2 months ago

🗹 Requirements

🎯 Subject of the issue

Experienced behavior:

U+F001 renders as a music note except when bold and/or italic, in which case it's what appears to be a ligature of "fi". I first discovered this in the kitty terminal emulator, but the issue also occurred in XTerm with the font set to UbuntuMono Nerd Font

In LibreOffice, I set up a spreadsheet where I checked how U+F001 was rendered in each of the following font families, with columns for regular, bold, italic, and bold italic (in a details block for space's sake:

view font list
    • UbuntuMono Nerd Font
    • UbuntuMono Nerd Font Mono
    • UbuntuMono Nerd Font Propo
    • Ubuntu Nerd Font
    • Ubuntu Nerd Font Cond
    • Ubuntu Nerd Font Light
    • Ubuntu Nerd Font Med
    • Ubuntu Nerd Font Propo
    • Ubuntu Nerd Font Propo Cond
    • Ubuntu Nerd Font Propo Light
    • Ubuntu Nerd Font Propo Med
    • UbuntuSansMono NF
    • UbuntuSansMono NFM
    • UbuntuSansMono NF Medium
    • UbuntuSansMono NFM Medium
    • UbuntuSansMono NFM SemiBold
    • UbuntuSansMono NFP
    • UbuntuSansMono NFP Medium
    • UbuntuSansMono NFP SemiBold
    • UbuntuSansMono NF SemiBold
    • UbuntuSans NF
    • UbuntuSans NF Medium
    • UbuntuSans NFP
    • UbuntuSans NFP Medium
    • UbuntuSans NFP SemiBold
    • UbuntuSans NF SemiBold

None of the UbuntuSans or UbuntuSansMono fonts had any problems. All of the Ubuntu and UbuntuMono fonts displayed the "fi" ligature in the italics and bold italics columns, and most of them displayed it for all 4 columns.

Expected behavior:

U+F001 consistently renders a music note icon

Example symbols:

n/a

🔧 Your Setup

In my terminals, I use UbuntuMono Nerd Font Mono and it's bold, italic, and bold italic variations. In investigating this issue, I used the following, again, in a details block:

view font list
    • UbuntuNerdFontPropo-BoldItalic.ttf
    • UbuntuNerdFontPropo-Light.ttf
    • UbuntuNerdFontPropo-Medium.ttf
    • UbuntuNerdFont-MediumItalic.ttf
    • UbuntuNerdFontPropo-MediumItalic.ttf
    • UbuntuNerdFontPropo-Regular.ttf
    • UbuntuNerdFont-Medium.ttf
    • UbuntuNerdFont-Regular.ttf
    • UbuntuNerdFont-Light.ttf
    • UbuntuNerdFont-Bold.ttf
    • UbuntuNerdFont-Italic.ttf
    • UbuntuNerdFontPropo-Condensed.ttf
    • UbuntuNerdFontPropo-Bold.ttf
    • UbuntuNerdFont-Condensed.ttf
    • UbuntuNerdFontPropo-Italic.ttf
    • UbuntuNerdFont-LightItalic.ttf
    • UbuntuNerdFontPropo-LightItalic.ttf
    • UbuntuMonoNerdFont-BoldItalic.ttf
    • UbuntuMonoNerdFont-Regular.ttf
    • UbuntuNerdFont-BoldItalic.ttf
    • UbuntuMonoNerdFontPropo-BoldItalic.ttf
    • UbuntuMonoNerdFontMono-BoldItalic.ttf
    • UbuntuMonoNerdFontPropo-Regular.ttf
    • UbuntuMonoNerdFontMono-Regular.ttf
    • UbuntuMonoNerdFontPropo-Italic.ttf
    • UbuntuMonoNerdFont-Italic.ttf
    • UbuntuMonoNerdFontPropo-Bold.ttf
    • UbuntuMonoNerdFontMono-Bold.ttf
    • UbuntuMonoNerdFont-Bold.ttf
    • UbuntuMonoNerdFontMono-Italic.ttf
    • UbuntuSansNerdFont-MediumItalic.ttf
    • UbuntuSansNerdFont-SemiBoldItalic.ttf
    • UbuntuSansNerdFontPropo-Medium.ttf
    • UbuntuSansNerdFont-Regular.ttf
    • UbuntuSansNerdFontPropo-Regular.ttf
    • UbuntuSansNerdFont-Italic.ttf
    • UbuntuSansNerdFontPropo-Italic.ttf
    • UbuntuSansNerdFontPropo-SemiBold.ttf
    • UbuntuSansNerdFont-Medium.ttf
    • UbuntuSansNerdFontPropo-Bold.ttf
    • UbuntuSansNerdFontPropo-SemiBoldItalic.ttf
    • UbuntuSansNerdFont-SemiBold.ttf
    • UbuntuSansNerdFont-Bold.ttf
    • UbuntuSansNerdFont-BoldItalic.ttf
    • UbuntuSansNerdFontPropo-MediumItalic.ttf
    • UbuntuSansNerdFontPropo-BoldItalic.ttf
    • UbuntuSansMonoNerdFontMono-BoldItalic.ttf
    • UbuntuSansMonoNerdFontPropo-Regular.ttf
    • UbuntuSansMonoNerdFont-SemiBoldItalic.ttf
    • UbuntuSansMonoNerdFontPropo-MediumItalic.ttf
    • UbuntuSansMonoNerdFont-Medium.ttf
    • UbuntuSansMonoNerdFontPropo-Medium.ttf
    • UbuntuSansMonoNerdFontMono-SemiBold.ttf
    • UbuntuSansMonoNerdFontMono-Italic.ttf
    • UbuntuSansMonoNerdFont-Bold.ttf
    • UbuntuSansMonoNerdFontPropo-Italic.ttf
    • UbuntuSansMonoNerdFontPropo-Bold.ttf
    • UbuntuSansMonoNerdFontPropo-BoldItalic.ttf
    • UbuntuSansMonoNerdFontMono-Regular.ttf
    • UbuntuSansMonoNerdFont-BoldItalic.ttf
    • UbuntuSansMonoNerdFont-Italic.ttf
    • UbuntuSansMonoNerdFont-SemiBold.ttf
    • UbuntuSansMonoNerdFontPropo-SemiBoldItalic.ttf
    • UbuntuSansMonoNerdFont-MediumItalic.ttf
    • UbuntuSansMonoNerdFontMono-Medium.ttf
    • UbuntuSansMonoNerdFont-Regular.ttf
    • UbuntuSansMonoNerdFontMono-SemiBoldItalic.ttf
    • UbuntuSansMonoNerdFontMono-Bold.ttf
    • UbuntuSansMonoNerdFontMono-MediumItalic.ttf
    • UbuntuSansMonoNerdFontPropo-SemiBold.ttf

★ Screenshots (Optional)

Spreadsheet in Libreoffice illustrating issue (nf-issue-demo.ods):

image

Note: I removed the UbuntuSans and UbuntuSansMono lines from the spreadsheet once I saw they were all fine.

Illustration of issue in Kitty:

image

Finii commented 2 months ago

Thanks for reporting. I remember that I fixed that some longer time ago :thinking:

Finii commented 2 months ago

:flushed:

Finii commented 2 months ago

Hmm, I can not reproduce.

Set up like this:

image

Then run LibreOffice Writer:

image image

There is a difference between mechanics in the Ubuntu Light compared to the other Ubuntu fonts, but you specifically state Ubuntu Mono where no Light is available.

Maybe we should concentrate on a subset of the patched Ubuntu fonts. Please for example remove all Ubuntu Nerd Fonts and Ubuntu Sans Nerd Fonts, leaving only the Ubuntu Mono Nerd Fonts, which are 12 files. Maybe check also the font versions, not that you have the issue with some old patch. Important is to restart LibreOffice after changes in the font directory. Also I never need to rebuild the font cache, your mileage may vary.

eliminmax commented 2 months ago

The issue is that the "fi" ligature appears instead of the music note, not the other way around. I think it's the inverse of the previous issue you linked.

Finii commented 2 months ago

Ah you assed your spreadsheet file, excellent :+1:

image

image

image

You did enter a codepoint directly, i.e. F001, and that is indeed the musical note. Why do you think that is the fi ligature?

It's not, the fi ligature is at FB01 in the Ubuntu fonts (at least in most).

The ligature lookup table says the ligature glyph name is f_i, and that is here:

image

The glyph at F001 has the name fi and THAT is not referenced my anything inside the font.

image

So, the question is, why do you insert some concrete codepoint, if you want the ligature you just type f and i and let the font do its magic? And IF you enter a codepoint, enter the correct one?

Finii commented 2 months ago

The issue is that the "fi" ligature appears instead of the music note, not the other way around. I think it's the inverse of the previous issue you linked.

Ah, sorry, now I seem to understand :sweat_smile: , let me explain:

Finii commented 2 months ago

In the (few) Ubuntu fonts where at F001 is not a musical note we can not remove that glyph without breaking the font.

If - in those fonts - the glyph would be patched to the music note glyph, and someone types f followed by i it would display the note. That is a ligature rule inside the font file and we can not easily change that.

We could remove the ligature rule, leaving the f and i as individual glyphs, but then the font is not intact anymore and looks bad where people expect a better looking ligature glyph. We could take the ligature glyph and move it to some other codepoint, and then adjust the substitution tables in the font. But that is very hard to do automatically. So we choose to not patch over 'essential' glyphs. Patching those glyphs breaks the font because of its substitution rules.

Finii commented 2 months ago

If you want to self-patch I can give you the patcher config to remove the ligature.

And when the ligature is removed the patcher notices that the glyph can be replaced by the note glyph.

Finii commented 2 months ago

Hmm, I am a bit too dump (maybe sleep deprivation),

can reproduce finally :grimacing:

image

Finii commented 2 months ago

Thanks for reporting and nudging me in the right direction :+1:

eliminmax commented 2 months ago

I understand. I might just switch to a different Nerd Font.

Finii commented 2 months ago

I will fix that. Tomorrow.

Sent from Nine


From: Eli Array Minkoff @.***> Sent: Monday, April 8, 2024 20:39 To: ryanoasis/nerd-fonts Cc: Fini; Comment Subject: Re: [ryanoasis/nerd-fonts] U+F001 displayed incorrectly in some Ubuntu and UbuntuMono font variations (Issue #1595)

I understand. I might just switch to a different Nerd Font. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

Finii commented 2 months ago

Ubuntu

image

Ubuntu Mono

image

Finii commented 2 months ago

@allcontributors please add @eliminmax for bug

allcontributors[bot] commented 2 months ago

@Finii

I've put up a pull request to add @eliminmax! :tada:

Finii commented 2 months ago

There was even a real bug in the code - UbuntuMono should never have had the fi-ligatures preserved (because it just had the glyphs but no rules in the font file to access them as ligs).