sumo300 / chocolatey-nerd-fonts

Repository for automated creation of Chocolatey packages for Nerd Fonts
MIT License
6 stars 0 forks source link

"Windows Compatible" fonts? #9

Closed Jaykul closed 1 year ago

Jaykul commented 1 year ago

It looks like the current installer just blindly installs all the font files...

For all fonts that have a "Windows Compatible" version, that ends up meaning we have two copies of the font installed. For instance, for Cascadia Code, I ended up with four sets of the font:

The last two are the "Windows Compatible" versions. That's why the installer has a WindowsCompatibleOnly switch.

Assuming these packages only work on Windows, I think the install scripts need to change to avoid the extra copies of the fonts (which vary only by name). Another way might be to give it parameters for filtering Mono/Windows. But at a minimum, the bit that sets $fontList should look something like:

$fontList = Get-ChildItem -Filter "*Windows Compatible*.otf"

if ($fontList.Count -le 0) {
  $fontList = Get-ChildItem -Filter *.otf
}

# Use the TrueType fonts only if the OpenType files are missing
if ($fontList.Count -le 0) {
  $fontList = Get-ChildItem "*Windows Compatible*.ttf"
}
if ($fontList.Count -le 0) {
  $fontList = Get-ChildItem -Filter *.ttf
}
sumo300 commented 1 year ago

@Jaykul Sorry it took so long, but I finally added common code across all fonts, even new ones I just added to check for Windows Compatible fonts. Check out the linked pull request (#11).