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

Allow not renaming the font with parameter #1282

Merged
merged 4 commits into from
Jun 4, 2023
Merged

Conversation

Finii
Copy link
Collaborator

@Finii Finii commented Jun 4, 2023

Description

Add a flag for the user to not-rename (not touch) the name fields.

This can be useful for Visual Strudio and Cascadia Code, see #1242 (comment)

Requirements / Checklist

What does this Pull Request (PR) do?

See description.

Also corrects some logic errors (that do not really have an effect, but are nonetheless wrong).

How should this be manually tested?

Any background context you can provide?

What are the relevant tickets (if any)?

Screenshots (if appropriate or helpful)

Are in the issue.

Finii added 4 commits June 4, 2023 09:59
[why]
The font_patcher object should be self contained, and code outside of it
should not depend on stuff done within it that does not have to do
anything with patching.
In fact the code should run even if font_patcher.patch() has not been
called.

[how]
Pull name backup out of the patching process.

Signed-off-by: Fini Jastrow <[email protected]>
[why]
For tweaking we use the self.sourceFont, but in the loop the real
correct value is the local sourceFont. Usually it's the same, but from a
logical standpoint this is wrong.

The name is a bit unfortunate and C++ would have generated a warning.

Signed-off-by: Fini Jastrow <[email protected]>
[why]
When we did not collect xavgwidth data for some font and want to tweak
it the font-patcher crashes.

[how]
Check if we have a number before accessing it in the array.

[note]
This happens when font_patcher.patch() has not been called.

Signed-off-by: Fini Jastrow <[email protected]>
[why]
Sometimes a user might want to keep the original name.

This is escpecially true as Visual Studio seems to look at the font
names directly and enables special handling for 'Cascadia Code'.
Users might want to self-patch without renaming.

[how]
Add additional value to makegroups option.

That option should probably be renamed into 'naming scheme' or
something, as it is not really a fitting description of what it does.

Fixes: #1242 (some aspect of it)

Signed-off-by: Fini Jastrow <[email protected]>
@Finii Finii added this to the v3.0.2 milestone Jun 4, 2023
@Finii Finii merged commit 8fc3a7c into master Jun 4, 2023
@Finii Finii deleted the feature/allow-not-renaming branch June 4, 2023 11:24
@Finii Finii mentioned this pull request Jan 22, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant