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

Unexpected Subfamily 'Book' #1046

Closed
Finii opened this issue Jan 13, 2023 · 3 comments · Fixed by #1047
Closed

Unexpected Subfamily 'Book' #1046

Finii opened this issue Jan 13, 2023 · 3 comments · Fixed by #1047

Comments

@Finii
Copy link
Collaborator

Finii commented Jan 13, 2023

Hmm,

$ tar zxf liberation-fonts-ttf-2.1.5.tar.gz
$ find *ttf-2.1.5 -name '*.ttf' -exec fontforge ~/git/nerd-fonts/font-patcher {} \;
$ fontforge ~/git/nerd-fonts/bin/scripts/name_parser/query_names *.ttf 2>/dev/null
Examining 12 font files
 |Filename                                           | | Fullname                                                          | | Family                                                  | | Subfamily                      | | Typogr. Family                           | | Typogr. Subfamily
 |-------------------------------------------------- |-| ------------------------------------------------------------      |-| ------------------------------------------------------- |-| ------------------------------ |-| ---------------------------------------- |-| ----------------------------------------
 |Literation Mono Bold Italic Nerd Font.ttf          | | Literation Mono Bold Italic Nerd Font                             | | LiterationMono Nerd Font                                | | Bold Italic                    | | LiterationMono Nerd Font                 | |
 |Literation Mono Bold Nerd Font.ttf                 | | Literation Mono Bold Nerd Font                                    | | LiterationMono Nerd Font                                | | Bold                           | | LiterationMono Nerd Font                 | |
 |Literation Mono Italic Nerd Font.ttf               | | Literation Mono Italic Nerd Font                                  | | LiterationMono Nerd Font                                | | Italic                         | | LiterationMono Nerd Font                 | |
 |Literation Mono Nerd Font.ttf                      | | Literation Mono Nerd Font                                         | | LiterationMono Nerd Font                                | | Book                           | | LiterationMono Nerd Font                 | |
 |Literation Sans Bold Italic Nerd Font.ttf          | | Literation Sans Bold Italic Nerd Font                             | | LiterationSans Nerd Font                                | | Bold Italic                    | | LiterationSans Nerd Font                 | |
 |Literation Sans Bold Nerd Font.ttf                 | | Literation Sans Bold Nerd Font                                    | | LiterationSans Nerd Font                                | | Bold                           | | LiterationSans Nerd Font                 | |
 |Literation Sans Italic Nerd Font.ttf               | | Literation Sans Italic Nerd Font                                  | | LiterationSans Nerd Font                                | | Italic                         | | LiterationSans Nerd Font                 | |
 |Literation Sans Nerd Font.ttf                      | | Literation Sans Nerd Font                                         | | LiterationSans Nerd Font                                | | Book                           | | LiterationSans Nerd Font                 | |
 |Literation Serif Bold Italic Nerd Font.ttf         | | Literation Serif Bold Italic Nerd Font                            | | LiterationSerif Nerd Font                               | | Bold Italic                    | | LiterationSerif Nerd Font                | |
 |Literation Serif Bold Nerd Font.ttf                | | Literation Serif Bold Nerd Font                                   | | LiterationSerif Nerd Font                               | | Bold                           | | LiterationSerif Nerd Font                | |
 |Literation Serif Italic Nerd Font.ttf              | | Literation Serif Italic Nerd Font                                 | | LiterationSerif Nerd Font                               | | Italic                         | | LiterationSerif Nerd Font                | |
 |Literation Serif Nerd Font.ttf                     | | Literation Serif Nerd Font                                        | | LiterationSerif Nerd Font                               | | Book                           | | LiterationSerif Nerd Font                | |

Indeed what would be Regular is Book.

$ fontforge ~/git/nerd-fonts/bin/scripts/name_parser/query_names liberation-fonts-ttf-2.1.5/*.ttf 2>/dev/null
Examining 12 font files
 |Filename                                           | | Fullname                                                          | | Family                                                  | | Subfamily                      | | Typogr. Family                           | | Typogr. Subfamily
 |-------------------------------------------------- |-| ------------------------------------------------------------      |-| ------------------------------------------------------- |-| ------------------------------ |-| ---------------------------------------- |-| ----------------------------------------
 |LiberationMono-BoldItalic.ttf                      | | Liberation Mono Bold Italic                                       | | Liberation Mono                                         | | Bold Italic                    | |                                          | |
 |LiberationMono-Bold.ttf                            | | Liberation Mono Bold                                              | | Liberation Mono                                         | | Bold                           | |                                          | |
 |LiberationMono-Italic.ttf                          | | Liberation Mono Italic                                            | | Liberation Mono                                         | | Italic                         | |                                          | |
 |LiberationMono-Regular.ttf                         | | Liberation Mono                                                   | | Liberation Mono                                         | | Regular                        | |                                          | |
 |LiberationSans-BoldItalic.ttf                      | | Liberation Sans Bold Italic                                       | | Liberation Sans                                         | | Bold Italic                    | |                                          | |
 |LiberationSans-Bold.ttf                            | | Liberation Sans Bold                                              | | Liberation Sans                                         | | Bold                           | |                                          | |
 |LiberationSans-Italic.ttf                          | | Liberation Sans Italic                                            | | Liberation Sans                                         | | Italic                         | |                                          | |
 |LiberationSans-Regular.ttf                         | | Liberation Sans                                                   | | Liberation Sans                                         | | Regular                        | |                                          | |
 |LiberationSerif-BoldItalic.ttf                     | | Liberation Serif Bold Italic                                      | | Liberation Serif                                        | | Bold Italic                    | |                                          | |
 |LiberationSerif-Bold.ttf                           | | Liberation Serif Bold                                             | | Liberation Serif                                        | | Bold                           | |                                          | |
 |LiberationSerif-Italic.ttf                         | | Liberation Serif Italic                                           | | Liberation Serif                                        | | Italic                         | |                                          | |
 |LiberationSerif-Regular.ttf                        | | Liberation Serif                                                  | | Liberation Serif                                        | | Regular                        | |                                          | |

And it is not from the sourcefont.

Investigating

Originally posted by @Finii in #780 (comment)

@Finii
Copy link
Collaborator Author

Finii commented Jan 13, 2023

NameID 3 -=> Ascender - Liberation Mono 🤔

$ ttfdump Literation\ Mono\ Nerd\ Font.ttf
[...]
Name table   1.  PlatformID:     1
                 EncodingID:     0
                 LanguageID:     0
                 NameID:         1
                 Length:         24
                 Offset:         311
                 4c 69 74 65 72 61 74 69 6f 6e  >  Literation
                 4d 6f 6e 6f 20 4e 65 72 64 20  >  Mono Nerd 
                 46 6f 6e 74                    > Font
Name table   2.  PlatformID:     1
                 EncodingID:     0
                 LanguageID:     0
                 NameID:         2
                 Length:         4
                 Offset:         346
                 42 6f 6f 6b                    > Book
Name table   3.  PlatformID:     1
                 EncodingID:     0
                 LanguageID:     0
                 NameID:         3
                 Length:         26
                 Offset:         405
                 41 73 63 65 6e 64 65 72 20 2d  >  Ascender -
                 20 4c 69 62 65 72 61 74 69 6f  >   Liberatio
                 6e 20 4d 6f 6e 6f              > n Mono
Name table   4.  PlatformID:     1
                 EncodingID:     0
                 LanguageID:     0
                 NameID:         4
                 Length:         25
                 Offset:         484
                 4c 69 74 65 72 61 74 69 6f 6e  >  Literation
                 20 4d 6f 6e 6f 20 4e 65 72 64  >   Mono Nerd
                 20 46 6f 6e 74                 >  Font

@Finii
Copy link
Collaborator Author

Finii commented Jan 13, 2023

https://learn.microsoft.com/en-us/typography/opentype/spec/name#name-ids

NameID 3 -> unique font identifier

Fontforge name is { "UniqueID", 3},

Making mental note

Finii added a commit that referenced this issue Jan 13, 2023
[why]
Sometimes we set an empty string as SubFamily name. That ends up as
'Book' which is unexpected.

[how]
The translation from empty to "Book" is done by Fontforge, at least
with version 20220308.

Make sure we always have a SubFamily, and if we don't that must be a
'Regular'.

[note]
This was only a problem with the old naming engine. --makegroups got
this right always.

Fixes: #1046

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Finii added a commit that referenced this issue Jan 13, 2023
[why]
Sometimes we set an empty string as SubFamily name. That ends up as
'Book' which is unexpected.

[how]
The translation from empty to "Book" is done by Fontforge, at least
with version 20220308.

Make sure we always have a SubFamily, and if we don't that must be a
'Regular'.

[note]
This was only a problem with the old naming engine. --makegroups got
this right always.

Fixes: #1046

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Finii added a commit that referenced this issue Jan 13, 2023
[why]
Sometimes we set an empty string as SubFamily name. That ends up as
'Book' which is unexpected.

[how]
The translation from empty to "Book" is done by Fontforge, at least
with version 20220308.

Make sure we always have a SubFamily, and if we don't that must be a
'Regular'.

[note]
This was only a problem with the old naming engine. --makegroups got
this right always.

Fixes: #1046

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
@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 Jul 17, 2023
LNKLEO pushed a commit to LNKLEO/Nerd that referenced this issue Nov 24, 2023
[why]
Sometimes we set an empty string as SubFamily name. That ends up as
'Book' which is unexpected.

[how]
The translation from empty to "Book" is done by Fontforge, at least
with version 20220308.

Make sure we always have a SubFamily, and if we don't that must be a
'Regular'.

[note]
This was only a problem with the old naming engine. --makegroups got
this right always.

Fixes: ryanoasis#1046

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant