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
54.57k stars 3.65k forks source link

font-patcher: Introduce weight check #1358

Closed Finii closed 1 year ago

Finii commented 1 year ago

[why] Windows seems to construct the font names including the PS weight. We have some sourcefonts that are broken (i.e. have in fact different weights but have the same PS weight and/or OS2 weight.

That raises problems with the fonts on Windows.

[how] Check and compare all weight metadata (except CID) and issue a warning if they differ too much. That might fail with unusual weight names, though.

See Issue #1333 and PR #1358.

Reported-by: LeoniePhiline

Requirements / Checklist

What does this Pull Request (PR) do?

How should this be manually tested?

Did let it run over the complete repo with

$ NERDFONTS="--dry --debug 3" ./gotta-patch-em-all-font-patcher\!.sh
$ grep -i -A 1 parse ../../font-patcher-log.txt
$ grep -A 1 Possible ../../font-patcher-log.txt

Any background context you can provide?

What are the relevant tickets (if any)?

Screenshots (if appropriate or helpful)

Finii commented 1 year ago

Problems that are detected right now in our sourcefonts:

DEBUG: gohufont-11.ttf                             OS2/PS/Name: 500/500/400  (from 500/'Medium'/'')
DEBUG: gohufont-14.ttf                             OS2/PS/Name: 500/500/400  (from 500/'Medium'/'')
DEBUG: gohufont-uni-11.ttf                         OS2/PS/Name: 500/500/400  (from 500/'Medium'/'')
DEBUG: gohufont-uni-14.ttf                         OS2/PS/Name: 500/500/400  (from 500/'Medium'/'')
DEBUG: Go-Mono-Bold-Italic.ttf                     OS2/PS/Name: 600/600/700  (from 600/'Demi'/'Bold')
DEBUG: Go-Mono-Bold.ttf                            OS2/PS/Name: 600/600/700  (from 600/'Demi'/'Bold')
DEBUG: iAWriterQuattroS-BoldItalic.ttf             OS2/PS/Name: 400/400/700  (from 400/'Book'/'Bold')
DEBUG: iAWriterQuattroS-Bold.ttf                   OS2/PS/Name: 400/400/700  (from 400/'Book'/'Bold')
DEBUG: Inconsolata-LGC-Italic.ttf                  OS2/PS/Name: 500/500/400  (from 500/'Medium'/'')
DEBUG: Inconsolata-LGC.ttf                         OS2/PS/Name: 500/500/400  (from 500/'Medium'/'')
DEBUG: iosevka-extrabolditalic.ttf                 OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: iosevka-extraboldoblique.ttf                OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: iosevka-extrabold.ttf                       OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: iosevka-term-extrabolditalic.ttf            OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: iosevka-term-extraboldoblique.ttf           OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: iosevka-term-extrabold.ttf                  OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: JetBrainsMono-ExtraBoldItalic.ttf           OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: JetBrainsMono-ExtraBold.ttf                 OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: JetBrainsMonoNL-ExtraBoldItalic.ttf         OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: JetBrainsMonoNL-ExtraBold.ttf               OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: Lilex-Bold.ttf                              OS2/PS/Name: 400/400/700  (from 400/'Book'/'Bold')
DEBUG: Lilex-Thin.ttf                              OS2/PS/Name: 400/400/100  (from 400/'Book'/'Thin')
DEBUG: Monoid-Retina.ttf                           OS2/PS/Name: 300/300/400  (from 300/'Light'/'Retina')
DEBUG: MPLUS1Code-Thin.ttf                         OS2/PS/Name: 250/300/100  (from 250/'Light'/'Thin')
DEBUG: MPLUS1-ExtraBold.ttf                        OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: MPLUS1-Thin.ttf                             OS2/PS/Name: 250/300/100  (from 250/'Light'/'Thin')
DEBUG: MPLUS2-ExtraBold.ttf                        OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: MPLUS2-Thin.ttf                             OS2/PS/Name: 250/300/100  (from 250/'Light'/'Thin')
DEBUG: MPLUSCodeLatin_Expanded-Thin.ttf            OS2/PS/Name: 250/300/100  (from 250/'Light'/'Thin')
DEBUG: MPLUSCodeLatin-Thin.ttf                     OS2/PS/Name: 250/300/100  (from 250/'Light'/'Thin')
DEBUG: NotoSans-CondensedExtraBoldItalic.ttf       OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: NotoSans-CondensedExtraBold.ttf             OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: NotoSans-ExtraBoldItalic.ttf                OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: NotoSans-ExtraBold.ttf                      OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: NotoSans-ExtraCondensedExtraBoldItalic.ttf  OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: NotoSans-ExtraCondensedExtraBold.ttf        OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: NotoSansMono-CondensedExtraBold.ttf         OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: NotoSansMono-ExtraBold.ttf                  OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: NotoSansMono-ExtraCondensedExtraBold.ttf    OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: NotoSansMono-SemiCondensedExtraBold.ttf     OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: NotoSans-SemiCondensedExtraBoldItalic.ttf   OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: NotoSans-SemiCondensedExtraBold.ttf         OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: NotoSerif-CondensedExtraBoldItalic.ttf      OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: NotoSerif-CondensedExtraBold.ttf            OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: NotoSerif-ExtraBoldItalic.ttf               OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: NotoSerif-ExtraBold.ttf                     OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: NotoSerif-ExtraCondensedExtraBoldItalic.ttf OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: NotoSerif-ExtraCondensedExtraBold.ttf       OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: NotoSerif-SemiCondensedExtraBoldItalic.ttf  OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: NotoSerif-SemiCondensedExtraBold.ttf        OS2/PS/Name: 800/900/800  (from 800/'Heavy'/'ExtraBold')
DEBUG: RobotoMono-ThinItalic.ttf                   OS2/PS/Name: 250/300/100  (from 250/'Light'/'Thin')
DEBUG: RobotoMono-Thin.ttf                         OS2/PS/Name: 250/300/100  (from 250/'Light'/'Thin')
DEBUG: TerminusTTF-4.49.2.ttf                      OS2/PS/Name: 500/500/400  (from 500/'Medium'/'')
DEBUG: TerminusTTF-Italic-4.49.2.ttf               OS2/PS/Name: 500/500/400  (from 500/'Medium'/'')
Finii commented 1 year ago

Fix Codeclimate, force push.