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

Bugfix for Visual Studio 2022 #1406

Merged
merged 2 commits into from
Nov 11, 2023
Merged

Bugfix for Visual Studio 2022 #1406

merged 2 commits into from
Nov 11, 2023

Conversation

Finii
Copy link
Collaborator

@Finii Finii commented Nov 11, 2023

Description

name-parser: Unify abbreviations in family names

[why]
Because the newer Preferred/Typographic names ID 16 and ID 17 have not
a very demanding length limit we add the long form of the name
addendum (i.e. Nerd Font, Nerd Font Mono, Nerd Font Propo).

In the more restricted old names ID 1 and ID 2 we use the short forms
(i.e. NF, NFM, NFP).

This seems to be problematic with Visual Studio (Community) 2022 and the
fonts can be selected but are not really used.

The Postscript family name is never shortened which seems to be of no
consequence, but still is different than the other.

[how]
When creating the Preferred/Typographic Family (ID 16) we check the
shortening mode first and abbreviate the parts as needed and alike ID 1.

This will also change the filenames, because they base on the SFNT
table. We can not change that without changing the whole mechanism.

[note]
Also add new tool that lists all names of fonts, including the
Postscript ones.

Fixes: #1242

Requirements / Checklist

What does this Pull Request (PR) do?

How should this be manually tested?

Any background context you can provide?

What are the relevant tickets (if any)?

Screenshots (if appropriate or helpful)

@Finii Finii added the Bug fix label Nov 11, 2023
@Finii Finii mentioned this pull request Nov 11, 2023
2 tasks
@Finii
Copy link
Collaborator Author

Finii commented Nov 11, 2023

Forgot about the keep regular rule -> force push

[why]
Because the newer Preferred/Typographic names ID 16 and ID 17 have not
a very demanding length limit we add the long form of the name
addendum (i.e. Nerd Font, Nerd Font Mono, Nerd Font Propo).

In the more restricted old names ID 1 and ID 2 we use the short forms
(i.e. NF, NFM, NFP).

This seems to be problematic with Visual Studio (Community) 2022 and the
fonts can be selected but are not really used.

The Postscript family name is never shortened which seems to be of no
consequence, but still is different than the other.

[how]
When creating the Preferred/Typographic Family (ID 16) we check the
shortening mode first and abbreviate the parts as needed and alike ID 1.

This will also change the filenames, because they base on the SFNT
table. We can not change that without changing the whole mechanism.

[note]
Also add new tool that lists all names of fonts, including the
Postscript ones.

Fixes: #1242

Signed-off-by: Fini Jastrow <[email protected]>
[why]
It is better to have a not-abbreviated file name so that one can make
sense out of the name parts, especially when doing a partial patch.
With the previous commit we ended up with all abbreviated names.

The filename length is hopefully not limited, at least not as severe as
the SFNT table entries.

[how]
We need to store the answers somewhere because the naming is only
understood by the FontnameParser object which we throw away soon.
As fallback we still can parse the SFNT table, for example when the old
renaming is used.

Signed-off-by: Fini Jastrow <[email protected]>
@Finii Finii merged commit 61ab5c0 into master Nov 11, 2023
6 checks passed
@Finii Finii deleted the bugfix/visualstudio2022 branch November 11, 2023 23:09
LNKLEO pushed a commit to LNKLEO/Nerd that referenced this pull request Nov 24, 2023
This was referenced Nov 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(Caskaydia Code and) Visual Studio 2022
1 participant