font ports?

René J.V. Bertin rjvbertin at gmail.com
Mon Nov 30 02:28:55 PST 2015


On Monday November 30 2015 09:58:01 Andrea D'Amore wrote:

For the record, I understand /Library/Fonts to be the system-wide location in which users with the appropriate status are allowed to (un)install fonts. The font directory they *own* is ~/Library/Fonts .
Doesn't FontBook ask for an admin password when you install a font system-wide, i.e. in /Library/Fonts, on a system where permissions on that location are "stock"?

Using /Library/Fonts/MacPorts seems like a good idea I should have suggested myself (I knew it'd work).

>Think for example of a port that is just a collection of fonts without
>a standalone application, how would you install that and then tell
>your regular Cocoa apps about the fonts?

There's no need to do that; the system does. In my experience (which stops at 10.9), copying a supported font into one of the font directories makes it available instantaneously to newly started applications (and IIRC even to currently running applications).

I don't know of any rules of precedence other than an assumed "fonts in ~/Library/Fonts are preferred over those in /Library/Fonts are preferred over those in /System/Library/Fonts". Other than that, my experience is that FontBook will signal duplicates, and you end up using one of the copies without much say over which.
The same applies to app bundles: there is very little you can do to ensure LaunchServices will use an app bundle from MacPorts instead of another one available elsewhere.

The reasons I've been considering fonts ports :
- doxygen uses a css style that calls for Google's Roboto font. Not necessarily as a "hard" dependency, though documentation created in Qt's help format *will* use the font if available.
- I'm working on ports for KF5, and one of them ("frameworkintegration") specifically mentions that the Noto and Oxygen Mono fonts are expected to be installed.

It would be nice to be able to install those fonts via MacPorts if the dependents are obtained that way too.

In both cases it'd require a *lot* of hacking to get those fonts to be found in a location that's not supported by the OS, hacking of a kind even I don't feel comfortable proposing as a port patch.

As to licensing issues ... the same principles apply that apply to other kinds of ports. Everyone can make a port that redistributes code that isn't supposed to be; it's up to MacPorts to prevent such ports from being included in the official repository. The fonts I mention can be redistributed, and ports could probably be written such that the font files are downloaded from the official repository rather than from a MacPorts mirror.

R.


More information about the macports-dev mailing list