-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Pull 'Mono' to front in names and other naming changes #1028
Conversation
Invent >>Nerd Font Propo<< |
Todo:
|
ba535c2
to
271785b
Compare
As expected we now get fonts named Nerd Font Propo here:
On one hand I would like to keep the names as before. |
271785b
to
1207e0a
Compare
1207e0a
to
5a4d386
Compare
If we do any renaming, check
|
I think all the renaming, together with a possible drop of |
5a4d386
to
e6ad15c
Compare
Rebase on master, force push |
342465e
to
27469d7
Compare
Rebase on master, force push |
27469d7
to
bba2e2a
Compare
bba2e2a
to
0ef9f11
Compare
Now tackling the name length problems, which supposedly are solved by The problem is that different name parts have (sometimes historic) limitations in length. These are not really documented in any standard. Notably some Microsoft applications like IE9 or Word-2011for-Mac (! which does not run under Windows ;) have very tight restictions. The question arises if we still need to support those old issues or just move on. Some possible restrictions, taken mostly from [1], in 'our'/Fontforge nomenclature
(*) Might break document platform independence Citing Mark Simonson April 2014:
Examine the current source fonts:
Here examples for the three fonts with red marks:
[1] https://forum.fontlab.com/fontlab-studio-tips-and-tricks/font-family-naming-in-fontlab-studio-5/ |
Now lets check what the 'Windows Compat' did for us in the past:
|
Current HEAD of this PR.
|
Latest approach, this looks promising
Lets check how it fares after installing
|
e2b5f32
to
2fd7089
Compare
480ccc0
to
725df33
Compare
[why] The patched font is named 'OriginalName Nerd Font' and not 'OriginalName Nerd Fonts'. This is a bug. [how] Take the correct singular string form when assembling the names. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why] We want to keep "Nerd Font" in the font name if possible and instead shorten the weight part with accepted abbreviations. But these abbrevs are hard to read and sometimes a more mild abbreviating might be sufficient to get the desired name length. [how] Introduce a new shortening method for the weight parts of a family name. It takes a longer word (often un-shortened) when a weight stands on its own, but when a modifier is used together with the weight the more aggressive two-letter abbreviations are used. That new shortening method becomes the default and all the functions get a new parameter to enforce completely aggressive shortening, i.e. always use the shortest possible form. The new way to shorten is exposed all the way out to the font-patcher user who can select the shortening method as parameter to the --makegroups option. That option is undocumented because I expect some changes later on, still. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
961ba74
to
5a62f8a
Compare
[why] When we have a weight/width that can take a modifier, and a modifier is present we always take the shortest form of the weight/width. This is not how it is customarily done. Experienced: ExtraCondensed ExtraBold -> ExtCd ExtBd Expected: ExtraCondensed ExtraBold -> ExtCond ExtBd [how] In case a modifier is present: Use the shortest form for weights. Use the longer short form for widths. [note] Also circumvent CodeClimate issue by replacing if-s with formulas. And adding one nonsense entry to the data tables, because they were too 'similar' :rolleyes: Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
5a62f8a
to
0265034
Compare
[why] The shortened name is not as expected "BigBlueTerminal437 Nerd Font" but some obscure "c7 Nerd Font". [how] The backreference marker `\1` is directly in front of the string `437` which yields the replacement `\1437`. Python is not smart enough to correctly handle that (but 'sed' for example is). Instead use a named backreference which does not clash with the following digits. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why] CodeClimate does not allow 'complicated' functions. In a previous commit we added more if-s to a function that afterwards was rejected by CodeClimate. To fix that the if-s have been replaced with arithmetic. That is a) less readable than if-s b) has a bug [how] Change the code back to if-s but put them into yet another function. Hopefully we do not blow up CodeClimate's maximum number of functions per file limit now... Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why] If the font name is changed in a way where it now ends in a blank (for example because 'Name Momo' got 'Momo' dropped: 'Name '), that blank is not removed immediately. Well, it is later on, but anyhow. This can only happen on malformed SIL entries. But we want to have a correct replacement anyhow. [how] Remove trailing whitespace after replacements. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
3bd7b67
to
e71493c
Compare
[why] Some fonts have so long base names that we can not, even very abbreviated as 'NF', add the Nerd Font designator anymore. In this case we need to rename the font even if it has no RFN just to make it shorter. [note] As '(TTF)' is dropped now from Terminus we do not need to handle it specifically anymore. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why] As we introduces a default --makegroups value of 1 the solution to a problem can not be omitting the option but the user needs to specifically call it with value 0 instead. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why] Most fonts can run with the full naming (--makegroups 1). But for some (especially with full fledged subfamilies) the names become too long. Here we need to select more shortening. [how] This can be either done/stored in the font-patcher script, but if you need shortening (and which) still depends on what set of fonts you want to patch. So instead we make it a config.cfg option of the unpatched-fonts. [note] Findings: 3270 2 Agave 1 AnonymousPro 1 Arimo 1 Aurulent 1 BigBlueTerminal 1 BitstreamVera too long, and has RFM CascadiaCove 4 CodeNewRoman 1 Cousine 1 DaddyTimeMono 1 DejaVuSansMono 1 DroidSansMono 1 FantasqueSansMono 1 FiraCode 2 FiraMono 1 Gohu 1 Go-Mono 1 Hack 1 Hasklig 2 HeavyData 1 Hermit 1 iA-Writer PROBLEM Quattro / Duospace IBMPlexMono 1 Inconsolata 1 InconsolataGo 1 InconsolataLGC 1 Iosevka 4 (would also work with 3, but keep same with Term) IosevkaTerm 4 JetBrainsMono 4 Lekton 1 LiberationMono 1 Lilex 1 Meslo 1 Monofur 1 Monoid 1 Mononoki 1 MPlus 2, latX -> 3 NerdFontsSymbolsOnly 1 Noto 5, but!! "ExtraCondensed ExtraLight Italic" OpenDyslexic 1 Overpass 2 ProFont 1 ProggyClean 1 RobotoMono 3 ShareTechMono 1 SourceCodePro 4 SpaceMono 1 Terminus 1 Tinos 1 Ubuntu 2 UbuntuMono 2 VictorMono 4 Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why] The fonts generated with --makegroups work on all platforms, so there is no need for options --windows and --also-windows anymore. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why] After skipping the creation of 'Windows Compatible' fonts we have room to finally add 'Nerd Font Propo' to the release patch sets as first class citizen. [note] Also add undocumented feature that environment variable $NERDFONTS can be used to supply additional or differing options (last option wins). Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why] It is hard to grep for all naming related errors, because there is no common format. [how] Make them also visually similar and error cases easily spotted. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why] When we still process the arguments we do not have a real logger object. [how] Use the default (root) logger in these cases. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why] To check just the naming and other stuff it is good to not patch (and not store) the resultant font. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why] Some messages are not useful in all cases, and we want to hide them. On the other hand there are messages that we want to only hide in --shutup mode. Hmm. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why] We have both iA Writer Duospace iA Writer Duo S These are the same fonts, Duospace is just the former name of Duo S. Duospace is version 1.005 Duo S (and Mono and Quattro) is version 2.000 Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
e71493c
to
4921e59
Compare
[why] The systematic evaluation of all fonts is finished and we do not need any comparison with the old naming anymore. This can partially replaced by something like NERDFONTS='--debug --dry --makegroups 1' ./gotta-patch-em-all-font-patcher\!.sh -cv /iA-Writer | grep '===' [note] Also update query_names helper to what I used recently with length indicators. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why] It's not nessecary to shorten the PSname so much when no shortening is in place otherwise. This has been thought of as a good idea, because noone really cares about the PSname and we can avoid any problems. But checking with the current set of sourcefonts and using the current shortening options, keeping it longer is never a problem. It would be a problem for the Fullname ID4 before, and so we always shorten more. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
…aming Pull 'Mono' to front in names and other naming changes
This does a lot more than initially planned.
Main features
Complete
is dropped from the names (we have no incomplete fonts anymore anyhow)Windows Compatible
fonts are dropped (all fonts are now 'windows compatible')Nerd Font Mono
is treated as one connected name partAdditional features
Nerd Font Propo
is now properly named and included in patched-fontsfont-patcher
run creates a logfile with debug info--makegroups
)--makegroups
option gets a 'secret' parameter that controls font name shortening--dry
and--debug
forfont-patcher
(drop--windows
and--also-windows
)NERDFONTS
can be used to pass additional flags ongotta-patch-em
runsName changes
How should this be manually tested?
One way is to run
and examine the output. Or
OLD DESCRIPTION:
[why]
When we crate a font we take the OriginalName, add "Nerd Font" and which patches we applied, and add "Mono" if --mono has been specified:
But the 'Mono' part is quite important, but this scheme will put it in a place where it is easily out of view or has been removed (to keep the name short).
This truncation is especially bad on Windows Compatiple and when the user installs both the 'Nerd Font' and the 'Nerd Font Mono':
become after truncation
[how]
Always put the "Mono" directly after "Nerd Font" and all the other name components come later.
Requirements / Checklist
What does this Pull Request (PR) do?
Change the Family/Full/File name of all
Nerd Font Mono
fonts: Pull theMono
directly after theNerd Font
How should this be manually tested?
Any background context you can provide?
What are the relevant tickets (if any)?
Screenshots (if appropriate or helpful)