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
53.92k stars 3.63k forks source link

Font naming inconsistences #1673

Closed MizardX closed 2 months ago

MizardX commented 2 months ago

Requirements

Experienced Behavior

The displayed font-names of "CaskaydiaCove" and "VictorMono" differ depending on the application used.

In some, the named is "CaskaydiaCove NF", and in others it is "CaskaydiaCove Nerd Font".

I believe this is due to the font having differencing names in "en-gb" and "en-us" locales.

Here is a PowerShell script to display the names:

Add-Type -AssemblyName PresentationCore -ErrorAction SilentlyContinue;
ls -rec *\Regular\*.ttf | % {
    $font = [Windows.Media.GlyphTypeface]::new([uri][string]$_);
    [pscustomobject]@{
        Filename = $_.Name;
        Win32FamilyNames = $font.Win32FamilyNames;
        FamilyNames = $font.FamilyNames;
    }
}

Output:

Filename                                Win32FamilyNames                          FamilyNames
--------                                ----------------                          -----------
3270NerdFont-Regular.ttf                {[en-US, 3270 Nerd Font]}                 {[en-US, 3270 Nerd Font]}
3270NerdFontMono-Regular.ttf            {[en-US, 3270 Nerd Font Mono]}            {[en-US, 3270 Nerd Font Mono]}
3270NerdFontPropo-Regular.ttf           {[en-US, 3270 Nerd Font Propo]}           {[en-US, 3270 Nerd Font Propo]}
AnonymiceProNerdFont-Regular.ttf        {[en-US, AnonymicePro Nerd Font]}         {[en-US, AnonymicePro Nerd Font]}
AnonymiceProNerdFontMono-Regular.ttf    {[en-US, AnonymicePro Nerd Font Mono]}    {[en-US, AnonymicePro Nerd Font Mono]}
AnonymiceProNerdFontPropo-Regular.ttf   {[en-US, AnonymicePro Nerd Font Propo]}   {[en-US, AnonymicePro Nerd Font Propo]}
ArimoNerdFont-Regular.ttf               {[en-US, Arimo Nerd Font]}                {[en-US, Arimo Nerd Font]}
ArimoNerdFontPropo-Regular.ttf          {[en-US, Arimo Nerd Font Propo]}          {[en-US, Arimo Nerd Font Propo]}
BitstromWeraNerdFont-Regular.ttf        {[en-US, BitstromWera Nerd Font]}         {[en-US, BitstromWera Nerd Font]}
BitstromWeraNerdFontMono-Regular.ttf    {[en-US, BitstromWera Nerd Font Mono]}    {[en-US, BitstromWera Nerd Font Mono]}
BitstromWeraNerdFontPropo-Regular.ttf   {[en-US, BitstromWera Nerd Font Propo]}   {[en-US, BitstromWera Nerd Font Propo]}
CaskaydiaCoveNerdFont-Italic.ttf        {[en-US, CaskaydiaCove NF]}               {[en-GB, CaskaydiaCove NF], [en-US, CaskaydiaCove Nerd Font]}
CaskaydiaCoveNerdFont-Regular.ttf       {[en-US, CaskaydiaCove NF]}               {[en-GB, CaskaydiaCove NF], [en-US, CaskaydiaCove Nerd Font]}
CaskaydiaCoveNerdFontMono-Italic.ttf    {[en-US, CaskaydiaCove NFM]}              {[en-GB, CaskaydiaCove NFM], [en-US, CaskaydiaCove Nerd Font Mono]}
CaskaydiaCoveNerdFontMono-Regular.ttf   {[en-US, CaskaydiaCove NFM]}              {[en-GB, CaskaydiaCove NFM], [en-US, CaskaydiaCove Nerd Font Mono]}
CaskaydiaCoveNerdFontPropo-Italic.ttf   {[en-US, CaskaydiaCove NFP]}              {[en-GB, CaskaydiaCove NFP], [en-US, CaskaydiaCove Nerd Font Propo]}
CaskaydiaCoveNerdFontPropo-Regular.ttf  {[en-US, CaskaydiaCove NFP]}              {[en-GB, CaskaydiaCove NFP], [en-US, CaskaydiaCove Nerd Font Propo]}
CousineNerdFont-Regular.ttf             {[en-US, Cousine Nerd Font]}              {[en-US, Cousine Nerd Font]}
CousineNerdFontMono-Regular.ttf         {[en-US, Cousine Nerd Font Mono]}         {[en-US, Cousine Nerd Font Mono]}
CousineNerdFontPropo-Regular.ttf        {[en-US, Cousine Nerd Font Propo]}        {[en-US, Cousine Nerd Font Propo]}
DejaVuSansMNerdFont-Regular.ttf         {[en-US, DejaVuSansM Nerd Font]}          {[en-US, DejaVuSansM Nerd Font]}
DejaVuSansMNerdFontMono-Regular.ttf     {[en-US, DejaVuSansM Nerd Font Mono]}     {[en-US, DejaVuSansM Nerd Font Mono]}
DejaVuSansMNerdFontPropo-Regular.ttf    {[en-US, DejaVuSansM Nerd Font Propo]}    {[en-US, DejaVuSansM Nerd Font Propo]}
FantasqueSansMNerdFont-Regular.ttf      {[en-US, FantasqueSansM Nerd Font]}       {[en-US, FantasqueSansM Nerd Font]}
FantasqueSansMNerdFontMono-Regular.ttf  {[en-US, FantasqueSansM Nerd Font Mono]}  {[en-US, FantasqueSansM Nerd Font Mono]}
FantasqueSansMNerdFontPropo-Regular.ttf {[en-US, FantasqueSansM Nerd Font Propo]} {[en-US, FantasqueSansM Nerd Font Propo]}
FiraCodeNerdFont-Regular.ttf            {[en-US, FiraCode Nerd Font]}             {[en-US, FiraCode Nerd Font]}
FiraCodeNerdFontMono-Regular.ttf        {[en-US, FiraCode Nerd Font Mono]}        {[en-US, FiraCode Nerd Font Mono]}
FiraCodeNerdFontPropo-Regular.ttf       {[en-US, FiraCode Nerd Font Propo]}       {[en-US, FiraCode Nerd Font Propo]}
GoMonoNerdFont-Regular.ttf              {[en-US, GoMono Nerd Font]}               {[en-US, GoMono Nerd Font]}
GoMonoNerdFontMono-Regular.ttf          {[en-US, GoMono Nerd Font Mono]}          {[en-US, GoMono Nerd Font Mono]}
GoMonoNerdFontPropo-Regular.ttf         {[en-US, GoMono Nerd Font Propo]}         {[en-US, GoMono Nerd Font Propo]}
HackNerdFont-Regular.ttf                {[en-US, Hack Nerd Font]}                 {[en-US, Hack Nerd Font]}
HackNerdFontMono-Regular.ttf            {[en-US, Hack Nerd Font Mono]}            {[en-US, Hack Nerd Font Mono]}
HackNerdFontPropo-Regular.ttf           {[en-US, Hack Nerd Font Propo]}           {[en-US, Hack Nerd Font Propo]}
InconsolataGoNerdFont-Regular.ttf       {[en-US, InconsolataGo Nerd Font]}        {[en-US, InconsolataGo Nerd Font]}
InconsolataGoNerdFontMono-Regular.ttf   {[en-US, InconsolataGo Nerd Font Mono]}   {[en-US, InconsolataGo Nerd Font Mono]}
InconsolataGoNerdFontPropo-Regular.ttf  {[en-US, InconsolataGo Nerd Font Propo]}  {[en-US, InconsolataGo Nerd Font Propo]}
LektonNerdFont-Regular.ttf              {[en-US, Lekton Nerd Font]}               {[en-US, Lekton Nerd Font]}
LektonNerdFontMono-Regular.ttf          {[en-US, Lekton Nerd Font Mono]}          {[en-US, Lekton Nerd Font Mono]}
LektonNerdFontPropo-Regular.ttf         {[en-US, Lekton Nerd Font Propo]}         {[en-US, Lekton Nerd Font Propo]}
MonofurNerdFont-Regular.ttf             {[en-US, Monofur Nerd Font]}              {[en-US, Monofur Nerd Font]}
MonofurNerdFontMono-Regular.ttf         {[en-US, Monofur Nerd Font Mono]}         {[en-US, Monofur Nerd Font Mono]}
MonofurNerdFontPropo-Regular.ttf        {[en-US, Monofur Nerd Font Propo]}        {[en-US, Monofur Nerd Font Propo]}
MonoidNerdFont-Regular.ttf              {[en-US, Monoid Nerd Font]}               {[en-US, Monoid Nerd Font]}
MonoidNerdFontMono-Regular.ttf          {[en-US, Monoid Nerd Font Mono]}          {[en-US, Monoid Nerd Font Mono]}
MonoidNerdFontPropo-Regular.ttf         {[en-US, Monoid Nerd Font Propo]}         {[en-US, Monoid Nerd Font Propo]}
MononokiNerdFont-Regular.ttf            {[en-US, Mononoki Nerd Font]}             {[en-US, Mononoki Nerd Font]}
MononokiNerdFontMono-Regular.ttf        {[en-US, Mononoki Nerd Font Mono]}        {[en-US, Mononoki Nerd Font Mono]}
MononokiNerdFontPropo-Regular.ttf       {[en-US, Mononoki Nerd Font Propo]}       {[en-US, Mononoki Nerd Font Propo]}
ProggyCleanNerdFont-Regular.ttf         {[en-US, ProggyClean Nerd Font]}          {[en-US, ProggyClean Nerd Font]}
ProggyCleanNerdFontMono-Regular.ttf     {[en-US, ProggyClean Nerd Font Mono]}     {[en-US, ProggyClean Nerd Font Mono]}
ProggyCleanNerdFontPropo-Regular.ttf    {[en-US, ProggyClean Nerd Font Propo]}    {[en-US, ProggyClean Nerd Font Propo]}
RobotoMonoNerdFont-Regular.ttf          {[en-US, RobotoMono Nerd Font]}           {[en-US, RobotoMono Nerd Font]}
RobotoMonoNerdFontMono-Regular.ttf      {[en-US, RobotoMono Nerd Font Mono]}      {[en-US, RobotoMono Nerd Font Mono]}
RobotoMonoNerdFontPropo-Regular.ttf     {[en-US, RobotoMono Nerd Font Propo]}     {[en-US, RobotoMono Nerd Font Propo]}
SpaceMonoNerdFont-Regular.ttf           {[en-US, SpaceMono Nerd Font]}            {[en-US, SpaceMono Nerd Font]}
SpaceMonoNerdFontMono-Regular.ttf       {[en-US, SpaceMono Nerd Font Mono]}       {[en-US, SpaceMono Nerd Font Mono]}
SpaceMonoNerdFontPropo-Regular.ttf      {[en-US, SpaceMono Nerd Font Propo]}      {[en-US, SpaceMono Nerd Font Propo]}
TinosNerdFont-Regular.ttf               {[en-US, Tinos Nerd Font]}                {[en-US, Tinos Nerd Font]}
TinosNerdFontPropo-Regular.ttf          {[en-US, Tinos Nerd Font Propo]}          {[en-US, Tinos Nerd Font Propo]}
UbuntuNerdFont-Regular.ttf              {[en-US, Ubuntu Nerd Font]}               {[en-US, Ubuntu Nerd Font]}
UbuntuNerdFontPropo-Regular.ttf         {[en-US, Ubuntu Nerd Font Propo]}         {[en-US, Ubuntu Nerd Font Propo]}
UbuntuMonoNerdFont-Regular.ttf          {[en-US, UbuntuMono Nerd Font]}           {[en-US, UbuntuMono Nerd Font]}
UbuntuMonoNerdFontMono-Regular.ttf      {[en-US, UbuntuMono Nerd Font Mono]}      {[en-US, UbuntuMono Nerd Font Mono]}
UbuntuMonoNerdFontPropo-Regular.ttf     {[en-US, UbuntuMono Nerd Font Propo]}     {[en-US, UbuntuMono Nerd Font Propo]}
VictorMonoNerdFont-Regular.ttf          {[en-US, VictorMono NF]}                  {[en-GB, VictorMono NF], [en-US, VictorMono Nerd Font]}
VictorMonoNerdFontMono-Regular.ttf      {[en-US, VictorMono NFM]}                 {[en-GB, VictorMono NFM], [en-US, VictorMono Nerd Font Mono]}
VictorMonoNerdFontPropo-Regular.ttf     {[en-US, VictorMono NFP]}                 {[en-GB, VictorMono NFP], [en-US, VictorMono Nerd Font Propo]}

It seems to be consistent on fonts with only one locale, but "CaskaydiaCove" and "VictorMono" have both "en-gb" and "en-us" locales, which seems to have different naming rules. The Win32FontFamily seems to pick the first name.

Expected Behavior

The "en-gb" locale should use the same naming rules ("Nerd Font" vs "NF") as "en-us". Or the "en-gb" locale should not be included at all.

Example Symbols or Text

No response

Font Used

CaskaydiaCove, VictorMono

Source of Font File

Github

Terminal Emulator (and the title of the terminal window)

Windows Terminal

Operating System and Version

Windows 11

Screenshots

image image

Finii commented 2 months ago

The "en-gb" locale should use the same naming rules ("Nerd Font" vs "NF") as "en-us". Or the "en-gb" locale should not be included at all.

Can you elaborate a bit on your expectation? In which way does it impact the usability or make the fonts unusable? Are there any things you can't do due to the naming?

The different names are on purpose, and the names in en-gb exist for the sole purpose to fix broken behaviour of MS VisualStudio 2022.

The PR that introduced these names with links to other relevant discussions is

We have 3 options

I close this for now, and I do not believe we will change the naming any time soon, but please give more details and why you think "consistent" font names are more important than the reasons for the introduction of the "inconsistent" ones.

P.S. More scripts for examining the fonts names are in bin/scripts/name_parser/

Finii commented 2 months ago

Depending on how the names impact you... I believe we can stuff the VS2022 names into any language, so if it is specifically the GB language that is an Issue, we can use any other, less likely to interfere with normal behaviour.

Finii commented 2 months ago
        Win32FamilyNames = $font.Win32FamilyNames;
        FamilyNames = $font.FamilyNames;

Why does MS introduce new names for the different naming parts in the font? There is no "Win32" whatsoever in the font specification. They should probably read their own documentation about the name properties of open type fonts: https://learn.microsoft.com/en-us/typography/opentype/spec/name

Finii commented 2 months ago

I don't know if you use VS2022, but that has another ... strange behavior:

If a font's name is "Cascadia" it renders it differently than other fonts. So if you want to have the patched font (i.e. "Caskaydia") in VS2022 and have it rendered identically to stock Cascadia, you need to rename it to "Cascadia". They really use the font's name. That is the reason why there is the no-renaming option with the patcher, so that people can self-patch a fully functional "Caskaydia" for VS2022.

Finii commented 2 months ago

Scripts that show different aspects of font names are bin/scripts/name_parser/query_name* in this repo.

fini@Air nerd-fonts % fontforge bin/scripts/name_parser/query_name patched-fonts/CascadiaCode/Regular/CaskaydiaCoveNerdFont-Regular.ttf 2>/dev/null
Examining 1 font files
======== CaskaydiaCoveNerdFont-Regular.ttf ========
SFNT Fullname      ID 4     CaskaydiaCove NF Regular
SFNT Family        ID 1     CaskaydiaCove NF
SFNT SubFamily     ID 2     Regular
SFNT Pref Family   ID 16    ('CaskaydiaCove Nerd Font', 'CaskaydiaCove NF')
SFNT Pref Styles   ID 17    -
SFNT PS Name       ID 6     CaskaydiaCoveNF-Regular
SFNT Compatible    ID 18    -
SFNT CID findfont  ID 20    -
SFNT WWS Family    ID 21    -
SFNT WWS SubFamily ID 22    -
PS fontname                 CaskaydiaCoveNF-Regular
PS fullname                 CaskaydiaCove NF Regular
PS familyname               CaskaydiaCove NF
fondname                    None
fini@Air nerd-fonts %
MizardX commented 2 months ago

I'll only look at FamilyNames['en-us'] instead of FontFamily.Source/GlyphTypeface.Win32FamilyNames['en-us'] in the future, when searching fonts. I was just surprised, since those are the only fonts on my system where FontFamily.Source didn't match the displayed font name.