Giter Site home page Giter Site logo

dtinth / yosemiteandelcapitansystemfontpatcher Goto Github PK

View Code? Open in Web Editor NEW
346.0 23.0 20.0 303 KB

Change the system font of Mac OS X Yosemite.

Home Page: https://medium.com/@dtinth/changing-the-system-font-on-yosemite-5870887e7b45

AppleScript 55.94% Python 44.06%

yosemiteandelcapitansystemfontpatcher's Introduction

Yosemite and El Capitan System Font Patcher

Change the system font of Mac OS X Yosemite and El Capitan. Inspired by FiraSystemFontReplacement.

Maybe it's just me, but for such a new and modern interface, Helvetica Neue feels… ancient, and Helvetica is already everywhere… A more futuristic font such as Avenir Next may be a better choice.

Replacing the system font with Avenir next

Project Status: Help Wanted

The software provided here works for me, and I get the Avenir Next font I wanted. You can also use this software to patch fonts for your own use as well. However, there are few minor issues, such as font baseline issue. I'd like some help from the community to resolve these, especially font experts.

New: Step by Step Tutorial (Yosemite Only)


Note: The convenient script and step by step tutorial currently only works for Yosemite. Contributions to help update this to also work with El Capitan would be much appreciated.

Step by Step Tutorial


Prerequisites

Using Homebrew (easy!)

Note: This method doesn't seem to work anymore on Yosemite 10.10.3. You can try installing using MacPorts (see the discussion) or if you don't like MacPorts, try running YosemiteSystemFontPatcher inside a Linux box.

First, install Homebrew and XQuartz. Then install FontForge with Python support.

brew install fontforge --with-python

Make sure FontForge works in Python:

python -c 'import fontforge; print "FontForge works in Python"'

Using MacPorts (for those who prefer)

Instructions provided by @AluminumPea. After installing MacPorts, install Fontforge with Python 2.7 support and switch to that Python. Make sure that you are not using Homebrew's Python!

sudo port install fontforge +python27
sudo port select --set python python27

New: Convenient Script (Yosemite Only)

Note: The convenient script and step by step tutorial currently only works for Yosemite. Contributions to help update this to also work with El Capitan would be much appreciated.

A convenient script is provided for you to convert fonts using a GUI wizard. In your Terminal, cd to the project folder and run:

bin/convenient-script

Patching a Font (Manual)

Copy HelveticaNeueDeskInterface.ttc from /System/Library/Fonts/ to the root of the repository. Then run the following command:

bin/patch 'System Font Name' 'Font To Use'

Where System Font Name is*:

System Font Name* Description  
System Font Regular Regular
System Font Bold Bold
System Font Italic Italic  
System Font Bold Italic Bold  
System Font Medium P4 Medium - used in notification title
System Font Medium Italic P4 Medium Italic  
システムフォント レギュラ ライト Light  
System Font Thin Thin  
System Font UltraLight Ultra Light  
System Font Heavy Heavy  

(* note: the above table is for English locale. For other locales, you must check the list of system font names by running bin/list-fonts HelveticaNeueDeskInterface.ttc — see issue #1)

...and Font To Use is the path to the font file you want to use. For example, Raleway-Medium.ttf.

Some fonts come in .ttc file format, which contains many fonts in one file. For instructions to use them, see below.

The font names that I did not put a star on are rarely used; you don't have to patch it.

The script will

  • open the font file to use,
  • scale and adjust the metrics to match that of the system font (that's why the script needs HelveticaNeueDeskInterface.ttc to be present),
  • adjust the PostScript name to match with the system font, and
  • save the font into current directory.

Specifying a .ttc File

A .ttc file contains several fonts in one file. Most fonts that comes with OS X come in this format. To select a font inside .ttc file, put the font name inside the parentheses. For example, Avenir Next.ttc(Avenir Next Medium).

Installation

Simply copy the generated font files to /Library/Fonts. Mac OS X will use these fonts instead of the system fonts.

Examples

El Capitan

The following Bash script converts Avenir Next into a system font usable with El Capitan.

patch-system-font() {
  BASE="$1"
  REPLACEMENT="$2"
  ./bin/patch "/System/Library/Fonts/$BASE" "/System/Library/Fonts/$REPLACEMENT"
}

patch-system-font 'SFNSDisplay-Black.otf' 'Avenir Next.ttc(Avenir Next Heavy)'
patch-system-font 'SFNSDisplay-Bold.otf' 'Avenir Next.ttc(Avenir Next Bold)'
patch-system-font 'SFNSDisplay-Heavy.otf' 'Avenir Next.ttc(Avenir Next Heavy)'
patch-system-font 'SFNSDisplay-Light.otf' 'Avenir Next.ttc(Avenir Next Regular)'
patch-system-font 'SFNSDisplay-Medium.otf' 'Avenir Next.ttc(Avenir Next Medium)'
patch-system-font 'SFNSDisplay-Regular.otf' 'Avenir Next.ttc(Avenir Next Medium)'
patch-system-font 'SFNSDisplay-Semibold.otf' 'Avenir Next.ttc(Avenir Next Demi Bold)'
patch-system-font 'SFNSDisplay-Thin.otf' 'Avenir Next.ttc(AvenirNext-UltraLight)'
patch-system-font 'SFNSDisplay-Ultralight.otf' 'Avenir Next.ttc(AvenirNext-UltraLight)'
patch-system-font 'SFNSText-Bold.otf' 'Avenir Next.ttc(Avenir Next Bold)'
patch-system-font 'SFNSText-BoldG1.otf' 'Avenir Next.ttc(Avenir Next Bold)'
patch-system-font 'SFNSText-BoldG2.otf' 'Avenir Next.ttc(Avenir Next Bold)'
patch-system-font 'SFNSText-BoldG3.otf' 'Avenir Next.ttc(Avenir Next Bold)'
patch-system-font 'SFNSText-BoldItalic.otf' 'Avenir Next.ttc(Avenir Next Bold Italic)'
patch-system-font 'SFNSText-BoldItalicG1.otf' 'Avenir Next.ttc(Avenir Next Bold Italic)'
patch-system-font 'SFNSText-BoldItalicG2.otf' 'Avenir Next.ttc(Avenir Next Bold Italic)'
patch-system-font 'SFNSText-BoldItalicG3.otf' 'Avenir Next.ttc(Avenir Next Bold Italic)'
patch-system-font 'SFNSText-Heavy.otf' 'Avenir Next.ttc(Avenir Next Heavy)'
patch-system-font 'SFNSText-HeavyItalic.otf' 'Avenir Next.ttc(Avenir Next Heavy Italic)'
patch-system-font 'SFNSText-Light.otf' 'Avenir Next.ttc(Avenir Next Regular)'
patch-system-font 'SFNSText-LightItalic.otf' 'Avenir Next.ttc(Avenir Next Italic)'
patch-system-font 'SFNSText-Medium.otf' 'Avenir Next.ttc(Avenir Next Demi Bold)'
patch-system-font 'SFNSText-MediumItalic.otf' 'Avenir Next.ttc(Avenir Next Demi Bold Italic)'
patch-system-font 'SFNSText-Regular.otf' 'Avenir Next.ttc(Avenir Next Medium)'
patch-system-font 'SFNSText-RegularG1.otf' 'Avenir Next.ttc(Avenir Next Medium)'
patch-system-font 'SFNSText-RegularG2.otf' 'Avenir Next.ttc(Avenir Next Medium)'
patch-system-font 'SFNSText-RegularG3.otf' 'Avenir Next.ttc(Avenir Next Medium)'
patch-system-font 'SFNSText-RegularItalic.otf' 'Avenir Next.ttc(Avenir Next Medium Italic)'
patch-system-font 'SFNSText-RegularItalicG1.otf' 'Avenir Next.ttc(Avenir Next Medium Italic)'
patch-system-font 'SFNSText-RegularItalicG2.otf' 'Avenir Next.ttc(Avenir Next Medium Italic)'
patch-system-font 'SFNSText-RegularItalicG3.otf' 'Avenir Next.ttc(Avenir Next Medium Italic)'
patch-system-font 'SFNSText-Semibold.otf' 'Avenir Next.ttc(Avenir Next Demi Bold)'
patch-system-font 'SFNSText-SemiboldItalic.otf' 'Avenir Next.ttc(Avenir Next Demi Bold Italic)'

After running this script, copy the resulting font files to /Library/Fonts.

Yosemite

To make Avenir Next your system font, copy Avenir Next.ttc from /System/Library/Fonts into the repository root, and then use this script:

#!/bin/bash -e
bin/patch 'System Font Regular'            'Avenir Next.ttc(Avenir Next Medium)'
bin/patch 'System Font Bold'               'Avenir Next.ttc(Avenir Next Bold)'
bin/patch 'System Font Italic'             'Avenir Next.ttc(Avenir Next Medium Italic)'
bin/patch 'System Font Bold Italic'        'Avenir Next.ttc(Avenir Next Bold Italic)'
bin/patch 'System Font Medium P4'          'Avenir Next.ttc(Avenir Next Demi Bold)'
bin/patch 'System Font Medium Italic P4'   'Avenir Next.ttc(Avenir Next Demi Bold Italic)'

It generates:

  • System Avenir Next Bold Italic.ttf
  • System Avenir Next Bold.ttf
  • System Avenir Next Demi Bold Italic.ttf
  • System Avenir Next Demi Bold.ttf
  • System Avenir Next Medium Italic.ttf
  • System Avenir Next Medium.ttf

Now you can copy these files into /Library/Fonts, log out, and log back in. You should see the font changed!

Thanks

I consulted these resources in creating the script:

Disclaimer

  • This software has been provided AS-IS. Use at your own risk.
  • I provide this software for people to patch fonts for their own use. I don't support redistributing patched licensed fonts.

yosemiteandelcapitansystemfontpatcher's People

Contributors

dtinth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yosemiteandelcapitansystemfontpatcher's Issues

Cannot Install Fontforge + Python Scripting Support

Hello fine sir,

I'm on the latest Yosemite beta (10.10.2) and I can't get the script to run properly. I've installed Homebrew, the latest version of Python, XQuartz, and even installed FontForge separately from it's git, but I still can't get the script to run.

When I attempt to run:

"brew install fontforge --with-python"

it spits out that my c compiler cannot create executables:

screen shot 2014-11-21 at 12 03 01 pm

If I try running the Font Patcher script even after that compiler error, it just gives me an error saying that FontForge with Python scripting support is not installed properly: (Which I'm guessing it's not.)

screen shot 2014-11-21 at 12 03 46 pm

I'm rather new to all this, but I'd really like to change my system font to Avenir Next, so if you could help me figure out what's wrong that would be supremely appreciated
.
Cheers,
~Mike

segv when importing font forge

Thanks for writing this up ...

i've installed fontforge --with-python.
python was previously installed.

initially, there was a complaint:

ImportError: dlopen(/usr/local/lib/python2.7/site-packages/fontforge.so, 2): Library not loaded: /usr/local/lib/libltdl.7.dylib

after creating a soft link:

sudo ln -s /usr/local/Cellar/libtool/2.4.2/lib/libltdl.7.dylib /usr/local/lib/libltdl.7.dylib

imports segv when importing:

$ python
Python 2.7.6 (default, Sep  9 2014, 15:04:36) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import fontforge
Segmentation fault: 11
$ 

convenient-script fails to work

REDACTED:~ REDACTED$ /Users/REDACTED/Desktop/YosemiteSystemFontPatcher-master/bin/convenient-script
2014-11-23 21:53:41.990 convenient-script[55939:2055329] warning: failed to get scripting definition from /usr/bin/osascript; it may not be scriptable.

Patch not working

I was trying to patch the Open Sans TTF file, but it says the follow:

patch unexpectedly ends in middle of line
patch: **** Only garbage was found in the patch input.

How can I fix it?

Custom Fonts Crash Google Chrome

Fixed

It has been accidently fixed in d9b7bba. Enjoy!!

Problem

When the font replacement is installed, Google Chrome crashes instantly. This only happens on some machines and some fonts.

Related Issues

Issue Reference Reporter
#10 @kemie
#3 (Comment № 4) @vistamin
seanmpuckett/Myriad-Pro-System-Font-for-Yosemite#1 @vincfleurette
kemie/Source-Sans-Yosemite-System-Font-Replacement#1 @hex

Current Status: Community Help Wanted

  • The patch script has been updated to change the SFNT table to a unique name. When non-unique name is used, it confuses some applications.
    • Although this fixes the issue where the wrong font is used, Chrome still crashes.
    • Since I don't know of any other potential fixes yet, this issue remains open. Any help or pull requests are much appreciated.

Error: failed to get scripting definition

Hi there, I'm trying to run the font patcher on OSX 10.10.5. I went through the steps of installing Homebrew and Quartz so I thought I was ready to go. But when I enter the command line:

mkdir -p /tmp/YosemiteSystemFontPatcher && cd /tmp/YosemiteSystemFontPatcher && curl -L https://github.com/dtinth/YosemiteSystemFontPatcher/archive/master.tar.gz | tar xvz --strip 1 && ./bin/convenient-script && open .

I get this error: failed to get scripting definition from /usr/bin/osascript; it may not be scriptable.

I went through all the steps described in Step-by-Step-Guide, so what's wrong and how can I fix this? TIA!

Font Baseline/Height/Scaling Issue

Problem

There are some differences in some metrics between the source font and target font in different weights, causing the baseline to be aligned improperly.

Related Issues

Issue Reference Reporter
#3 (with screenshots) @Ch33k1, @ddinh
jenskutilek/FiraSystemFontReplacement#17 (with screenshots) @vandrijevik
jenskutilek/FiraSystemFontReplacement#23 @mbrennwa
wr/YosemiteSanFranciscoFont#5 (with screenshots) @montanaflynn
wr/YosemiteSanFranciscoFont#4 (with screenshots) @Hawsome

Please reference future issues to this issue thread, so we can find the solution together.

Current Status: Font Expert and Community Help Wanted

  • I have tried to copy over the metrics from HelveticaNeueDeskInterface, including:
    • ascent, descent, hhea_ascent, hhea_ascent_add, hhea_descent, hhea_descent_add, os2_winascent, os2_winascent_add, os2_windescent, os2_windescent_add, os2_typoascent, os2_typoascent_add, os2_typodescent, and os2_typodescent_add.
    • However, the problem still persists.
  • This is beyond my knowledge now, and I don't have available time to do extensive research on this issue.
  • Therefore, community help would be much appreciated.
    • Pull requests welcome 😄

El Capitan Support

Hey, not an issue but I've been trying to get the same process working on El Capitan (and failing). Looks like they don't even list San Francisco in the font list in Font Book. Not sure how hard support would be? San Francisco font isn't amazing though and it'd be nice to use Avenir Next.

Not working

Hi,

followed the instruction step by step.
But the system only changes the bold one. The rest is still Helvetica Neue.

Best
Stefan

Segmentation Fault 11 on OSX 10.10.3

I have upgraded my system to 10.10.3 and I wanted to replace my font with a different one, but I have problems getting fontforge to work.

I installed homebrew, updated it and ran the fontforge install command:

brew install fontforge --with-python

This installs fontforge, but with the following messages:

==> Downloading https://homebrew.bintray.com/bottles/fontforge-20150330.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring fontforge-20150330.yosemite.bottle.tar.gz
Warning: fontforge dependency gettext was built with a different C++ standard
library (libc++ from clang). This may cause problems at runtime.
🍺  /usr/local/Cellar/fontforge/20150330: 1297 files, 35M

Once this is done, when I try to run the python command mentioned in the readme, Python crashes with a segmentation fault 11.

I do have Xcode 6.3 installed, might that be affecting this?

Instructions for macports

For macports, first check python version with:

python --version

then

sudo port install fontforge +python27

to match the version of python

Dialogs have missing fonts

Solved

Put the fonts in /Library/Fonts and don't put it anywhere else. You may also need to change the permissions. For more information, read on and see also wr/YosemiteSanFranciscoFont#3.

original issue below




Not sure if it's a font issue but I used a legit version of Avenir Next and everything works smoothly apart from login dialogs..

screen shot 2014-12-25 at 8 54 58 pm

Any ideas?

El Capitan + Safari

I am getting this error on two machines that have Avenir Next as the system font:

screen shot 2015-11-09 at 12 09 38 am

It looks like it's something to do with CoreText. Any ideas? Oddly it's only if I go to a Google site and try to login, e.g. Gmail, YouTube etc.

Generated fonts and chrome

I know this was mentioned in another thread, but I thought I'd open a separate issue from it.
I converted Source Sans to use as a system fonts and most Chrome users are reporting crashes when trying to open (for some strange reason it seems to work for me).

Minor font scaling issue!

Firstly you are a genius life saver for creating this highly efficient and helpful project, THANK YOU VERY MUCH. Just thought I'd give you some feed back, everything works great in the whole package, except:-

-: the user account name in the menu bar sits out of place, as shown in the screen shot:
screen shot 2014-11-03 at 01 10 55

-: the system font typefaces that are used in the UI are all of them so all 10 typefaces need patching. So you might want clarify and amend the section in your "manual" guide for the more novice users, like myself. Just a tip.

Thank you so much.

Complains about missing Helvetica Neue font (using macports and python27)

Maybe I missed something in the instructions, but I copied over "Avenir Next.ttc" like your example, but running

bin/patch 'System Font Regular'            'Avenir Next.ttc(Avenir Next Medium)'

gave me:

Couldn't find a font file named /Users/nic/Downloads/YosemiteSystemFontPatcher-master/HelveticaNeueDeskInterface.ttc(System Font Regular)
The requested file, HelveticaNeueDeskInterface.ttc(System Font Regular), does not exist
Traceback (most recent call last):
  File "bin/patch", line 38, in <module>
    main()
  File "bin/patch", line 11, in main
    convert(template_file_name, sys.argv[1], sys.argv[2])
  File "bin/patch", line 31, in convert
    template = fontforge.open("%s(%s)" % (template_file_name, template_font))
EnvironmentError: Open failed

Should the current system font really be required in the root or is this a problem with the the macports version of fontforge?

macOS Sierra

Any idea on this one? The El Capitan method doesn't seem to work unfortunately.

Couldn't find a font file names [...].ttc(System Font Regular)

I can't convert all fonts because these fonts are not found:

System Font Regular
System Font Bold
System Font Bold Italic

Exact error (I was using the bash script provided in the README.md):
bildschirmfoto 2014-10-24 um 22 56 30

The file is present in the root of the repository. Patching all other system fonts works.

How To Remove Adaptive Font Space?

Is there any idea how to remove adaptive font space? Normally, this is the window title font:
screen shot 2015-12-05 at 06 57 47

If we resize the window, the title font will look like this:
screen shot 2015-12-05 at 06 58 26

Or in Safari, if we have long URL, it will look like this:
screen shot 2015-12-05 at 06 59 59

Normally, the font space should remains static and change the trailling word into "..." like this:
screen shot 2015-12-05 at 07 01 32

I've used Robofont and Fontforge to compare Apple's San Francisco and my custom font, but still no idea. Thank you in advance...

macOS High Sierra

Dreaming I know but could we get support for Sierra? It'd probably work with High Sierra too given it's a minor update.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.