nerd-fonts icon indicating copy to clipboard operation
nerd-fonts copied to clipboard

Mono fonts have same family name as double-width fonts on Windows

Open fredizzimo opened this issue 2 years ago • 3 comments

🗹 Requirements

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

🎯 Subject of the issue

This is the same issue as Mono fonts have same family name as double-width fonts, which was fixed on all other platforms than Windows.

On Windows, if you have both variants installed, it randomly chooses one of them, which probably makes both variants unusable.

🔧 Your Setup

Windows 11 The font does not matter but I have mostly been testing with FiraCode NF

★ Screenshots (Optional)

fredizzimo avatar Jan 09 '22 13:01 fredizzimo

This will be fixed by #717 (former #706).

Finii avatar Jan 09 '22 14:01 Finii

(This is an obvious (*) error in font-patcher, but because the naming is additionally off in a lot other regards, this ended in a rather big PR, which probably will unfortunately take time to be pulled...)

(*) When you look on the code that adds it, you go ... WAT??!:

          if self.args.windows:
            # do stuff
          else:
              familyname += " " + projectNameSingular
              if self.args.single:
                  familyname += " Mono"

So maybe ~~this~~ the following was intended? But then the family name length check would be corrupted :grimacing:

diff --git a/font-patcher b/font-patcher
index f8ea7880..3d3770de 100755
--- a/font-patcher
+++ b/font-patcher
@@ -335,8 +335,8 @@ class font_patcher:
                 familyname = familyname[:maxFamilyLength]
         else:
             familyname += " " + projectNameSingular
-            if self.args.single:
-                familyname += " Mono"
+        if self.args.single:
+            familyname += " Mono"
 
         # Don't truncate the subfamily to keep fontname unique.  MacOS treats fonts with
         # the same name as the same font, even if subFamily is different.

But as there are a lot other issues, I believe tackling this one issue is not making much difference anyhow.

Finii avatar Jan 09 '22 14:01 Finii

Sounds good, thank you 👍

fredizzimo avatar Jan 09 '22 17:01 fredizzimo

Examining the fonts of current master shows these names:

$ fontforge bin/scripts/name_parser/query_names patched-fonts/FiraCode/**/*Windows*.ttf 2>/dev/null
Examining 12 font files
 |Filename                                           | | Fullname                                                          | | Family                                                  | | Subfamily                      | | Typogr. Family                           | | Typogr. Subfamily
 |-------------------------------------------------- |-| ------------------------------------------------------------      |-| ------------------------------------------------------- |-| ------------------------------ |-| ---------------------------------------- |-| ----------------------------------------
 |Fira Code Bold Nerd Font Complete Mono Windows Com | | Fira Code Bold Nerd Font Complete Mono Windows Compatible         | | FiraCode NFM                                            | | Bold                           | | FiraCode NFM                             | |
 |Fira Code Bold Nerd Font Complete Windows Compatib | | Fira Code Bold Nerd Font Complete Windows Compatible              | | FiraCode NF                                             | | Bold                           | | FiraCode NF                              | |
 |Fira Code Light Nerd Font Complete Mono Windows Co | | Fira Code Light Nerd Font Complete Mono Windows Compatible        | | FiraCode NFM                                            | | Regular                        | | FiraCode NFM                             | | Light
 |Fira Code Light Nerd Font Complete Windows Compati | | Fira Code Light Nerd Font Complete Windows Compatible             | | FiraCode NF                                             | | Regular                        | | FiraCode NF                              | | Light
 |Fira Code Medium Nerd Font Complete Mono Windows C | | Fira Code Medium Nerd Font Complete Mono Windows Compatible       | | FiraCode NFM                                            | | Regular                        | | FiraCode NFM                             | | Medium
 |Fira Code Medium Nerd Font Complete Windows Compat | | Fira Code Medium Nerd Font Complete Windows Compatible            | | FiraCode NF                                             | | Regular                        | | FiraCode NF                              | | Medium
 |Fira Code Regular Nerd Font Complete Mono Windows  | | Fira Code Regular Nerd Font Complete Mono Windows Compatible      | | FiraCode NFM                                            | | Regular                        | | FiraCode NFM                             | |
 |Fira Code Regular Nerd Font Complete Windows Compa | | Fira Code Regular Nerd Font Complete Windows Compatible           | | FiraCode NF                                             | | Regular                        | | FiraCode NF                              | |
 |Fira Code Retina Nerd Font Complete Mono Windows C | | Fira Code Retina Nerd Font Complete Mono Windows Compatible       | | FiraCode NFM                                            | | Regular                        | | FiraCode NFM                             | | Retina
 |Fira Code Retina Nerd Font Complete Windows Compat | | Fira Code Retina Nerd Font Complete Windows Compatible            | | FiraCode NF                                             | | Regular                        | | FiraCode NF                              | | Retina
 |Fira Code SemiBold Nerd Font Complete Mono Windows | | Fira Code SemiBold Nerd Font Complete Mono Windows Compatible     | | FiraCode NFM                                            | | Regular                        | | FiraCode NFM                             | | SemiBold
 |Fira Code SemiBold Nerd Font Complete Windows Comp | | Fira Code SemiBold Nerd Font Complete Windows Compatible          | | FiraCode NF                                             | | Regular                        | | FiraCode NF                              | | SemiBold

After some cleanup and sorting we get the following table. The classic Family/Subfamily is broken, but at least the Nerd Font Mono and the Nerd Font have different family names, which is what this Issue was about.

Fullname Family Subfamily Typogr. Family Typogr. Subfamily
Fira Code Bold Nerd Font Complete Windows Compatible FiraCode NF Bold FiraCode NF
Fira Code Light Nerd Font Complete Windows Compatible FiraCode NF Regular FiraCode NF Light
Fira Code Medium Nerd Font Complete Windows Compatible FiraCode NF Regular FiraCode NF Medium
Fira Code Regular Nerd Font Complete Windows Compatible FiraCode NF Regular FiraCode NF
Fira Code Retina Nerd Font Complete Windows Compatible FiraCode NF Regular FiraCode NF Retina
Fira Code SemiBold Nerd Font Complete Windows Compatible FiraCode NF Regular FiraCode NF SemiBold
Fira Code Bold Nerd Font Complete Mono Windows Compatible FiraCode NFM Bold FiraCode NFM
Fira Code Light Nerd Font Complete Mono Windows Compatible FiraCode NFM Regular FiraCode NFM Light
Fira Code Medium Nerd Font Complete Mono Windows Compatible FiraCode NFM Regular FiraCode NFM Medium
Fira Code Regular Nerd Font Complete Mono Windows Compatible FiraCode NFM Regular FiraCode NFM
Fira Code Retina Nerd Font Complete Mono Windows Compatible FiraCode NFM Regular FiraCode NFM Retina
Fira Code SemiBold Nerd Font Complete Mono Windows Compatible FiraCode NFM Regular FiraCode NFM SemiBold

So this issue has been fixed in a6e6ee26d83ddc59 with v2.2.2, I believe. Please reopen if still problematic.

Finii avatar Dec 22 '22 13:12 Finii

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a new issue, complete the issue template with all the details necessary to reproduce, and mention this issue as reference.

github-actions[bot] avatar Jun 26 '23 00:06 github-actions[bot]