GithubHelp home page GithubHelp logo

mekkablue / showinterpolations Goto Github PK

View Code? Open in Web Editor NEW
22.0 10.0 4.0 295 KB

Glyphs.app plugin for live-previewing all interpolated instances of the current glyph.

License: Apache License 2.0

Python 100.00%

showinterpolations's Introduction

Show Interpolations

This is a plugin for the Glyphs font editor by Georg Seifert. It calculates all active instances for the given glyph and draws them behind your paths. By default, it draws all active instances on top of each other using a transparent fuchsia/lavender color:

All instances are shown live.

After installation, it will add the menu item View > Show Interpolations (de: Interpolationen zeigen, fr: Montrer Interpolations, es: Mostrar Interpolaciones, zh: 💗插值). You can set a keyboard shortcut in System Preferences.

Installation

Please install the plugin via the built-in Plugin Manager, available via Window > Plugin Manager. If this is not possible for some reason or another, follow these steps:

  1. Download the complete ZIP file and unpack it, or clone the repository.
  2. Double click the .glyphsReporter file. Confirm the dialog that appears in Glyphs.
  3. Restart Glyphs

Usage Instructions

  1. Open a glyph in Edit View.
  2. Use View > Show Interpolations to toggle the preview of the instances.

To center the interpolations under the frontmost layer, Ctrl- or right-click anywhere in the canvas to invoke the context menu, and choose Center Interpolations (de: Interpolationen zentrieren, fr: Centrer interpolations, es: Centrar interpolaciones, zh: 以中心对齐).

Toggle the centering of interpolations via the context menu

Alternatively, you can also align at a certain node. To do that, select a node, bring up the context menu, and choose Align Interpolations at Selected Node (de: Interpolationen an ausgewähltem Punkt ausrichten, es: Alinear las interpolaciones a nodo seleccionado, fr: Aligner les interpolations au point selectionné, zh: 以所选点为基点对齐). The node in question will then be marked with a star. To cancel point alignment, select the starred node, and choose Do not Align Interpolations at Selected Node (de: Interpolationen nicht an ausgewähltem Punkt ausrichten, es: No alinear las interpolaciones a nodo seleccionado, fr: Ne pas aligner les interpolations au point selectionné, zh: 不以所选点为基点对齐) from the context menu.

Custom Parameter

To only view specific interpolations, add this custom parameter to the instance(s) you want to preview in File > Font Info > Exports:

Property: ShowStyles
Value: -
Value: .1;.8;.2
Value: 1;0.5;0;0.1

The Value defines the color of the instance. You can either leave the value blank to use the default color. Or, you can set semicolon-separated RGB values between 0 and 1. If you supply a fourth value, it will be interpreted as alpha (opacity: 1.0 = opaque, 0.0 = invisible).

If you want to change the color globally, add the parameter in File > Font Info > Font > Custom Parameters.

Legacy note: In Glyphs 2, the parameter is called ShowInterpolation.

Extra Settings

If you want the plug-in to also display inactive instances, run this in Macro Window:

Glyphs.defaults["com.mekkablue.ShowInterpolation.showDisabledInstances"]=True

Requirements

The plugin needs Glyphs 2.4 or higher, running on OS X 10.9.5 or later.

License

Copyright 2014-2018 Rainer Erich Scheichelbauer (@mekkablue). Based on sample code by Georg Seifert (@schriftgestalt) and Jan Gerner (@yanone).

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

See the License file included in this repository for further details.

showinterpolations's People

Contributors

kontur avatar mekkablue avatar rafalbuchner avatar schriftgestalt avatar

Stargazers

 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

showinterpolations's Issues

Corner Serifs

Hi,

I've trouble using the corner element in glyphs. Doesn't matter if I re-use one corner and turn around the position or make corners for top/bottom-right/left. Glyphs like "V" always cause bugs, corners on "p" or "q" are okay.
Can't really figure out the issue, hope you know whats wrong.

Thanks

screen shot 2017-03-02 at 10 44 24

menu titles

The context menu uses different text if an option is active or not. That should be indicated by a checkbox. Add the 'state' : True/False to the contextMenus dict.

Really slow with last update

Latest update is really slow, and slows Glyphs (983) down as well. Tried several projects with various amount of masters and instances with same result.

Plugin broken in Glyphs 2.6.2?

Open a font, e.g. https://github.com/googlefonts/noto-source/blob/master/src/NotoSans-MM.glyphs or https://github.com/IBM/plex/blob/master/IBM-Plex-Sans-Variable/sources/IBMPlexSansVar-Roman.designspace.

Showing interpolations does nothing (or just shows one layer and nothing for the others) or with the latter file displays the following backtrace:

Traceback (most recent call last):
  File "plugin.py", line 148, in glyphInterpolation
    interpolatedLayer = interpolatedFont.glyphForName_(thisGlyph.name).layers[0]
AttributeError: 'NoneType' object has no attribute 'glyphForName_'

[... repeated multiple times ...]

Centering broken

When I have centering turned on the alignment of the backgrounds seems to drift off screen with every screen update.

I was wondering if an update introduced this, so I rolled the plugin back to 4134ef8 which was a bugfix I submitted and know worked.

See in the video what is happening:
Without centering behavior as expected. Then turning on centering with every background update the centering function seems to further offset the backgrounds. Switching the master seems to affect the direction the backgrounds are drifting, so my assumption is that in the code determining the center the width of the current layer comes into the calculation somehow.

https://drive.google.com/open?id=1_kBZNIZFtR4NWlsuM88NHqTSVHR5AQIk

Can you reproduce this?

Since I rolled back to a commit I know worked I am wondering if you are aware of anything in Glyphs that has has recently changed that could affect this?

Rounding to integers

There seems to be a problem with the rounding of the interpolation-display. Best tested with rectangle shapes that align to another rectangles flank in all/both masters. See Glyphs forum thread

Center Interpolation

When Align Interpolation at Selected Node

screen shot 2017-07-24 at 2 20 18 pm

It becomes passive when clicking Center Interpolation again
The command does not respond to default position of centered interpolations.

Interpolating anchor positions

Have you considered also rendering anchors' interpolated positions? I occasionally find myself wanting to see that, but wonder if you'd feel this should be in the plugin?

Allow displaying disabled instances?

I have a three master setup where I commonly adjust the extremes to more closely match the middle master. I made a fake middle instance that disables interpolation from the actual middle master to get something to compare against and set the ShowInterpolations parameter to both real and fake middle instances, but the plugin actively skips disabled instances. I have to keep the fake instance enabled and would need to toggle it off before export etc. Would it make sense to change this plugin to also look for disabled instances (maybe with a ShowInterpolationEvenWhenDisabled parameter) or is there a better way to do this?

Not working in Glyphs2

When activating in G2, I get this error message:
glyphInterpolation: 'NSKVONotifying_GSGlyph' object has no attribute 'decomposedInterpolate_'

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.