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

Installation of fonts from .exe (MS TTF fonts) fails #71

Open
6 tasks done
breml opened this issue Jan 11, 2025 · 4 comments
Open
6 tasks done

Installation of fonts from .exe (MS TTF fonts) fails #71

breml opened this issue Jan 11, 2025 · 4 comments

Comments

@breml
Copy link

breml commented Jan 11, 2025

General troubleshooting steps

Description of issue

When I try to install fonts, which are contained in an .exe file, like the MS TTF fonts, for example Arial, this fails with the following error:

/tmp/font-arial-20250111-147200-nhi2ku
Error: An exception occurred within a child process:
  TypeError: no implicit conversion of nil into String

After some debugging, I found, that the arial32.exe file is not extracted and those the .TTF files are not present in the temporary folder. With the following additions to the formula, the installation is successful for me:

  class FontArial < Formula
    desc "Arial font"
    homepage "https://sourceforge.net/projects/corefonts/files/the%20fonts/final/"
    head "https://downloads.sourceforge.net/corefonts/arial32.exe"
+   depends_on "cabextract" => :build

    def install
+     system "cabextract", "arial32.exe"
      (share/"fonts").install Dir.glob("./**/Arial.TTF")[0]
      (share/"fonts").install Dir.glob("./**/Arialbd.TTF")[0]
      (share/"fonts").install Dir.glob("./**/Arialbi.TTF")[0]
      (share/"fonts").install Dir.glob("./**/Ariali.TTF")[0]
    end

    test do
      assert_path_exists share/"fonts"
    end
  end

Output of your command with --verbose --debug

$ brew install --verbose --debug --HEAD --force font-arial
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromNameLoader): loading font-arial
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromNameLoader): loading font-arial
==> Fetching homebrew/linux-fonts/font-arial
==> Downloading https://downloads.sourceforge.net/corefonts/arial32.exe
/usr/bin/env /var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Linuxbrew/4.4.15\ \(Linux\;\ x86_64\ Bluefin-dx\ 41\ \(FROM\ Fedora\ Silverblue\)\)\ curl/8.9.1 --header Accept-Language:\ en --retry 3 -V
/usr/bin/env /var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Linuxbrew/4.4.15\ \(Linux\;\ x86_64\ Bluefin-dx\ 41\ \(FROM\ Fedora\ Silverblue\)\)\ curl/8.9.1 --header Accept-Language:\ en --retry 3 --fail --location --silent --head https://downloads.sourceforge.net/corefonts/arial32.exe
Already downloaded: /var/home/lubr/.cache/Homebrew/downloads/591a954a9144940e6043df922d9c9a9436ba3f24256274676d78e3edc1a92fc3--arial32.exe
==> Verifying checksum for '591a954a9144940e6043df922d9c9a9436ba3f24256274676d78e3edc1a92fc3--arial32.exe'
Warning: Cannot verify integrity of '591a954a9144940e6043df922d9c9a9436ba3f24256274676d78e3edc1a92fc3--arial32.exe'.
No checksum was provided.
For your reference, the checksum is:
  sha256 "85297a4d146e9c87ac6f74822734bdee5f4b2a722d7eaa584b7f2cbf76f478f6"
==> Installing font-arial from homebrew/linux-fonts
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromTapLoader): loading homebrew/linux-fonts/font-arial
/usr/bin/env /var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/shims/shared/git --version
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb (Formulary::FromPathLoader): loading /var/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-linux-fonts/Formula/font-arial.rb
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb (Formulary::FromAPILoader): loading gcc@11
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb (Formulary::FromAPILoader): loading binutils
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb (Formulary::FromAPILoader): loading make
/usr/bin/env /var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/shims/shared/git --version
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb (Formulary::FromAPILoader): loading gcc
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb (Formulary::FromAPILoader): loading gcc@14
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb (Formulary::FromAPILoader): loading gcc
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb (Formulary::FromAPILoader): loading gcc@14
cp -p /var/home/lubr/.cache/Homebrew/downloads/591a954a9144940e6043df922d9c9a9436ba3f24256274676d78e3edc1a92fc3--arial32.exe /tmp/font-arial-20250111-147200-nhi2ku/arial32.exe
==> Temporary files retained at:
/tmp/font-arial-20250111-147200-nhi2ku
Error: An exception occurred within a child process:
  TypeError: no implicit conversion of nil into String
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/pathname.rb:113:in `basename'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/pathname.rb:113:in `block in install'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/pathname.rb:94:in `each'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/pathname.rb:94:in `install'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-linux-fonts/Formula/font-arial.rb:7:in `install'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/debrew.rb:15:in `block in install'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/debrew.rb:86:in `debrew'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/debrew.rb:15:in `install'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb:179:in `block (3 levels) in install'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/kernel.rb:539:in `with_env'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb:139:in `block (2 levels) in install'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:1623:in `block in brew'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:3347:in `block (2 levels) in stage'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/kernel.rb:539:in `with_env'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:3346:in `block in stage'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/resource.rb:114:in `block (2 levels) in unpack'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/download_strategy.rb:117:in `chdir'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/download_strategy.rb:102:in `stage'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/resource.rb:110:in `block in unpack'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/mktemp.rb:90:in `block in run'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/mktemp.rb:90:in `chdir'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/mktemp.rb:90:in `run'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/resource.rb:237:in `stage_resource'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/resource.rb:109:in `unpack'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/resource.rb:83:in `stage'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.6/lib/ruby/3.3.0/forwardable.rb:240:in `stage'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:3324:in `stage'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:1616:in `brew'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb:133:in `block in install'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/kernel.rb:539:in `with_env'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb:125:in `install'
/var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb:232:in `<main>'

Output of brew cask doctor

(I think, these instructions are no longer valid, but I provide the output anyway).

$ brew cask doctor
Error: `brew cask` is no longer a `brew` command. Use `brew <command> --cask` instead.
@tani
Copy link
Member

tani commented Jan 13, 2025

Deploying executable .exe files generally seems to pose legal and security risks. Furthermore, specifically regarding Arial, as with SF Mono, there are licensing concerns. Thank you for bringing this to our attention. I am considering removing Arial and other MS TTF fonts from this tap. If you would like to continue this discussion, could you kindly share any licensing documentation or similar references that explicitly allow the use of Arial on Linux, rather than on macOS or Windows, where it is already installed?

  • Of course, if Linux is being run on Windows (via WSL) or macOS (via Lima), this issue becomes a highly ambiguous matter.
  • Additionally, I am aware that similar fonts were installed in the past via Mono.

This tap is managed by a very small number of Homebrew maintainers, placing us in a weak position when it comes to potential litigation. Please understand that, in the interest of ensuring long-term usability for everyone, including yourself, we must take a conservative stance to eliminate such risks.

@breml
Copy link
Author

breml commented Jan 14, 2025

Hi @tani

I am by no means a lawyer, so I am not familiar with all the details about licensing. Anyway, I did a quick research on the web and this is what I found about the Microsoft Corefonts:

  • Wikipedia Article outlining the history about Core fonts for the Web: based on this article, these fonts are "freeware" based on a proprietary license imposing some restrictions on distribution. In my understanding the EULA (license) allows redistribution, as long as it is a complete copy (not sure what complete in this case means) including the EULA.
  • The Microsoft Core Fonts are also available for installation in Ubuntu and Debian (I have not checked for rpm based distributions, but I assume, that these fonts are available there as well). Based on the update-ms-fonts script in the Debian repository, the way the fonts are installed looks pretty much the same as the one in Homebrew (download from sourceforge.net, use cabextract to extract the fonts).

I hope, this gives some context.

@breml
Copy link
Author

breml commented Jan 14, 2025

I just looked at the .exe files from corefonts on sourceforge.net a little bit closer and it could be, that splitting each font into its own formula could be a violation of the licensing terms. I think, it would be safer to only provide one formula (e.g. ttf-mscorefonts, similar to Ubuntu/Debian) and with this formula install all the fonts listed on corefonts, including the content of wd97vwr.exe, which contains the License.txt with the above mentioned EULA.

Update: also other .exe files do contain the license, but not all of them. I found the license e.g. in webdin32.exe, but not in `arial32.exe. Not sure why this is the case, but it is like this since ages (these files have not been changed on SourceForge since 2002).

@breml
Copy link
Author

breml commented Jan 14, 2025

The Debian project gives the following hint on the license / redistribution of the corefonts:

These fonts were provided by Microsoft "in the interest of cross-
platform compatibility". This is no longer the case, but they are
still available from third parties.

You are free to download these fonts and use them for your own use,
but you may not redistribute them in modified form, including changes
to the file name or packaging format.

Source: https://salsa.debian.org/debian/msttcorefonts/-/blob/master/update-ms-fonts?ref_type=heads#L116-122

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

No branches or pull requests

2 participants