Coder Social home page Coder Social logo

yanone-glyphsapp-scripts's Introduction

Collection of my Glyphs.app scripts.

If you like, you can clone this repository directly into Glyphs.app’s script folder which is normally located at ~/Application Support/Glyphs/Scripts.

In Glyphs.app, you will then find the scripts in the Scripts menu under Yanone-GlyphsApp-Scripts.

Contents

Interpolation

Create Missing Brace Layers in Components

This script goes through all component glyphs and adds missing intermediate masters (called "Brace Layers" in Glyphs) to the component glyphs where their respective base glyphs have them. For instance, if an e has a brace layer, all glyphs based on it such as é etc. also need a brace layer at the same value.

This is necessary to create correct Variable Fonts in environments outside Glyphs (such as googlefonts/fontmake, and even in Glyphs itself as of this writing, August 2019).

Otherwise, component glyphs’ metrics get interpolated linearly between the main masters, ignoring the intermediate masters, while the outlines get interpolated correctly. This leads to sidebearing discrepancies of component glyphs with base glyphs referencing intermediate masters.

Expand Intermediate Masters

This script takes all the intermediate masters it can find (called "Brace Layers" in Glyphs) and adds them as fully expanded masters to the font, then removes all brace layers.

This is necessary as a workaround for environments that can’t properly deal with brace layers, such as googlefonts/fontmake as of this writing, August 2019. Once the brace layers are flattened into the font as fully expanded masters, everything interpolates correctly.

The masters will simply be added to the font’s master list at the end, not their correct positions in the list, which does not affect the interpolation.

Use this script only to generate static instances, not a Variable Font, as otherwise the font file size will increase. To create Variable Fonts, use the Create Missing Brace Layers in Components script.

Create Axis Location Custom Parameters

In order to properly create instances from a VF using fontmake, the font needs to carry appropriate Axis Location custom parameters on the masters. This script creates them.

Create Instance weightClass Custom Parameters

In order to properly create instances from a VF using fontmake, the font needs to carry appropriate weightClass parameters on the instances. This script creates them.

OpenType Features

Mark Inaccessible Glyphs

Large fonts bear the potential to contain inaccessible glyphs. Those are glyphs that are neither encoded (have a Unicode value), nor are accessible through one of the OpenType features.

This script marks glyphs as white that are either encoded OR reachable through an OpenType substitution feature OR are contained in other glyphs as components. It marks glyphs red that are not encoded AND not reachable through OpenType AND not used as components.

Depending on the setup of your font, you may want to either delete the inaccessible glyphs from your font or make them accessible.

Tested only in Glyphs 3. This requires fontTools. Install it on the command line with pip install fontTools.

yanone-glyphsapp-scripts's People

Contributors

justinpenner avatar yanone avatar

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.