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

add support for installing fonts #1860

Merged
merged 2 commits into from
Dec 6, 2013
Merged

Conversation

rolandwalker
Copy link
Contributor

I used a different naming scheme for the example cask, prefixing it with font- (font-dejavu.rb) I think some name collisions are inevitable otherwise.

It would also be possible to link just the directory dejavu-fonts-ttf-2.34 into ~/Library/Fonts instead of linking each individual font. I don't know if you would consider that to be preferable.

@vitorgalvao
Copy link
Contributor

Do we really want this? I mean, if you’re that interested in automating the installation of and use that many fonts, shouldn’t you be using a font manager anyway? Having a lot of fonts installed is one of the best ways to make sure your computer slows down considerably.

@Peeja
Copy link
Contributor

Peeja commented Nov 28, 2013

Being able to install fonts this way sounds useful to me. I end up installing Inconsolata everywhere I go, and I'd rather do it through a package manager like this.

DejaVu has a lot of fonts, though. Maybe each family should be a separate cask?

@phinze
Copy link
Contributor

phinze commented Dec 6, 2013

Wow - this is badass! 👊

I've always found installing fonts to be a gross process of my machine setup process. I never thought that homebrew-cask could work for them. Nice work!

phinze added a commit that referenced this pull request Dec 6, 2013
add support for installing fonts
@phinze phinze merged commit 5dba177 into Homebrew:master Dec 6, 2013
rolandwalker added a commit to rolandwalker/homebrew-cask that referenced this pull request Dec 6, 2013
This should not be needed for .qlgenerator or .prefPane, because
(like .app) those are always directories/bundles and therefore must
be transported in some type of container.
phinze added a commit that referenced this pull request Dec 6, 2013
Allow naked OTF and TTF files, follow-up on #1860
@phinze phinze mentioned this pull request Dec 8, 2013
kevinSuttle pushed a commit to kevinSuttle/homebrew-cask that referenced this pull request Dec 8, 2013
This should not be needed for .qlgenerator or .prefPane, because
(like .app) those are always directories/bundles and therefore must
be transported in some type of container.
@kevinSuttle
Copy link

@kevinSuttle
Copy link

I just want to make sure that font licensing is being respected. Hopefully on a project like this, it wouldn't need to be said, but it can get nasty quickly if it gets quasi-legal.

@vitorgalvao
Copy link
Contributor

Agreed. And this one is tricky. Although I believe DMG agreements have a clear answer, this one does not. We could argue that in this case it is the responsibility of the user to know in which cases the typefaces can and cannot be used, but facilitating their installation in this way can make that a bit blurry.

I propose we shift every font to a new tap, and clearly state in the README that the user should read the individual licenses before using them (if they really do or not is out of our control and responsibility). We’ll be separating the regular casks from the main project anyway, eventually, so it’s not like this would be a big inconvenience, but it would be a nice step in preventing licensing issues.

@phinze @nanoxd @passcod @fanquake Thoughts?

@kevinSuttle
Copy link

@rolandwalker
Copy link
Contributor Author

Debian should be a good point of reference here. They have a more conservative philosophy about which packages can be included, and are further constrained in legal terms as they actually store and redistribute packages. In addition, they have had the benefit of extensive legal review.

I note that although Debian packages many font binaries, Microsoft Core Fonts[1] are only installed via a virtual package which executes an installer, as brew-cask does in general, and as #1992 does in specific.

@kevinSuttle I have reviewed the licenses of all fonts prior to submitting. The only unusual cases are where the font author does not provide a standard license, just says "hey these are free to use". I don't know if you followed the saga of the Code2000 font family. In that case, the author walked away, leaving things in a confusing state. FreeBSD determined that it was permissible to redistribute Code2000 and Code2001, and the submitted casks use FreeBSD servers for url. One definitely cannot redistribute all of the fonts in https://code.google.com/p/googlefontdirectory/, as that is a list of "web fonts" which includes both free/open and restrictively-licensed fonts.

As licensing issues are not specific to fonts, and as it is in everyone's interest to be legal, ethical, and respectful, should we not add a "license" stanza to the cask format? Most binaries will be covered by the top 10 standard licenses. That information could be used in various helpful ways, beginning with getting statistics on the scope of any licensing issues.

[1] http://packages.debian.org/wheezy/ttf-mscorefonts-installer

@rolandwalker
Copy link
Contributor Author

Ha, this issue just came up in #2075. Envy Code R is a font that didn't pass my review. It is probably legal to Cask it, but it doesn't seem respectful to do so.

@nanoxd
Copy link
Contributor

nanoxd commented Dec 13, 2013

@rolandwalker Agreed, I have asked @xcezx if he got permission from the author.

@kevinSuttle
Copy link

@rolandwalker I really like the license stanza idea.

@vitorgalvao
Copy link
Contributor

@nanoxd Even if permission was obtained, what if the author has a change of heart later on? Unless we can post proof of the permission as well, for posterity, I say we refuse any font that doesn’t meet the criteria.

@nanoxd
Copy link
Contributor

nanoxd commented Dec 13, 2013

@vitorgalvao That would be the most optimal approach. It stops PRs from sitting there for however long negotiations take 🏮

@phinze
Copy link
Contributor

phinze commented Dec 13, 2013

I propose we shift every font to a new tap, and clearly state in the README that the user should read the individual licenses before using them

+1 here -> I'm strapped for time at the moment but I spun up https://github.com/caskroom/homebrew-fonts in case someone else wants to shovel them over. Otherwise I can pick this up tonight or tomorrow.

@kevinSuttle
Copy link

The fonts in https://code.google.com/p/googlefontdirectory/ use 1 of 2 licenses (technically 3, but I'm disregarding Ubuntu). Either OFL or Apache.

A good FAQ on OFL here.

Both licenses seem to indicate that it's perfectly legal to redistribute the fonts within the repo as long as the original licenses are part of the distributions.

Even the copyrights seem to be congruent to this notion. What do you think?

@jgarber623
Copy link
Contributor

Quick question regarding installing fonts with brew cask install:

I'm on a fresh install of Mavericks, installed Homebrew (with brew-cask) and tapped caskroom/fonts. I successfully installed Source Code Pro (brew cask install font-source-code-pro) and the appropriate files were symlinked into ~/Library/Fonts.

Unfortunately, OS X doesn't appear to follow the symlinks in ~/Library/Fonts and doesn't recognize the fonts as being installed (for me, anyway). This may not be Mavericks-specific, but that's what I'm using.

Have I missed a step or a setting somewhere? Thanks for the help!

Painfully Detailed Steps to Reproduce

  1. Install OS X Mavericks (10.9.1) and Xcode (or Command Line Tools)
  2. Install Homebrew.
  3. brew install brew-cask
  4. brew tap caskroom/fonts
  5. brew cask install font-source-code-pro
  6. Observe that symlinks were correctly created in ~/Library/Fonts
  7. Open Font Book app and observe that Source Code Pro is not listed as an installed font.

@kevinSuttle
Copy link

This is true. I just noticed myself. How were you pulling this off @rolandwalker?

@rolandwalker
Copy link
Contributor Author

Strange -- I can duplicate the issue, though at the time of implementation this code was tested under a fresh user account. Furthermore, I had tested linking a containing dir under ~/Library/Fonts as well as linking the individual font files. That should have been under Mavericks. Maybe a recent OS X update changed something?

Some Googling suggests that symlinks and fonts don't always work together

http://www.ninisworld.com/thecorner/tutorials/osxfonts.html
http://www.macdevcenter.com/pub/a/mac/2001/07/24/osx_fonts1.html?page=2

In testing, I find that hard links to individual font files do always work as expected. Drawbacks: 1) can't hardlink if /opt/homebrew-cask is on a separate volume. 2) can't hardlink a containing directory.

Surprisingly, Finder aliases to font files do not work at all.

This link

http://www.jklstudios.com/misc/osxfonts.html

claims that a cache kept by Font Book can cause problems. I cannot duplicate that.

@kevinSuttle
Copy link

Interesting. A stop-gap would be to open the original source files from the shell after the package has been downloaded, and manually install it into Font Book.

The benefit of keeping track and automating downloads is still there. Thoughts?

@jgarber623
Copy link
Contributor

Just tested this in Mavericks, so YMMV depending on OS, but copying/moving files into ~/Library/Fonts and launching Font Book shows the fonts as installed (under "User" in Font Book). So it appears that moving the files to ~/Library/Fonts is the equivalent of installing the fonts.

Would it be possible with fonts to cp or mv the files in the downloaded package to the fonts directory (default or user-specified, of course)?

@rolandwalker
Copy link
Contributor Author

@phinze has said elsewhere he is willing to entertain the notion of cp into install directories (we would actually use ditto in practice). However, that is a major change to the brew-cask philosophy.

I propose incremental change instead: we ln (no -s) to create hard links as a special case for fonts. This will not work in the <<1% of cases where /opt/caskroom is on a different volume from /Users. We can add a note to that effect in the general fonts README. The individual font casks would also need to be updated to use file links instead of dir links. Lucklily, there are not very many casks to change.

@kevinSuttle
Copy link

@jgarber623 Definitely didn't work for me.

@rolandwalker I think hard links might work.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants