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

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

Closed
3 tasks done
fredizzimo opened this issue Jan 9, 2022 · 5 comments
Closed
3 tasks done

Comments

@fredizzimo
Copy link

🗹 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

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)

@Finii
Copy link
Collaborator

Finii commented Jan 9, 2022

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

@Finii
Copy link
Collaborator

Finii commented Jan 9, 2022

(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 😬

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.

@fredizzimo
Copy link
Author

Sounds good, thank you 👍

@Finii
Copy link
Collaborator

Finii commented Dec 22, 2022

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 a6e6ee2 with v2.2.2, I believe.
Please reopen if still problematic.

@Finii Finii closed this as completed Dec 22, 2022
@github-actions
Copy link
Contributor

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 github-actions bot locked as resolved and limited conversation to collaborators Jun 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants