Some scripts for Glyphs font editor โ works with Glyphs 3 only.
Thanks to Georg Seifert and Rainer Erich Scheichelbauer for their help and for providing a great API and example scripts.
Scripts for Glyphs App
Some scripts for Glyphs font editor โ works with Glyphs 3 only.
Thanks to Georg Seifert and Rainer Erich Scheichelbauer for their help and for providing a great API and example scripts.
I've noticed an issue with Show Kerning Pairs.py. Kerning pairs which have a group name, other than its glyph name, are shown blank.
From what I can tell the if statement of the nameMaker() function returns the names of the kerning groups, and those names are then added into the kernPair string kernPair = "/%s/%s " % (thisGlyphName, nameMaker(R))
Does there have to be an additional loop of listing what at the members of each kerning group?
I've tried modifying the code by adding a loop that checks which glyphs are members of the returned kerning groups and inserting those into the string. I've got it working somewhat but have a feeling that there are things it may be missing. In any case, I've included the code below.
The issue is also posted in the Glyphs forum: https://forum.glyphsapp.com/t/show-kerning-pairs/10729/5
#MenuTitle: Show Kerning Pairs
# -*- coding: utf-8 -*-
__doc__="""
Show Kerning Pairs for this glyph in a new tab.
"""
import GlyphsApp
thisFont = Glyphs.font
Doc = Glyphs.currentDocument
selectedLayers = thisFont.selectedLayers
selectedMaster = thisFont.selectedFontMaster
masterID = selectedMaster.id
editStringLeft = ""
editStringRight = ""
def nameMaker(kernGlyph):
if kernGlyph[0] == "@":
return kernGlyph[7:]
else:
return thisFont.glyphForId_(kernGlyph).name
for thisLayer in selectedLayers:
thisGlyph = thisLayer.parent
thisGlyphName = thisGlyph.name
rGroupName = str(thisGlyph.rightKerningGroup)
lGroupName = str(thisGlyph.leftKerningGroup)
for L in thisFont.kerning[ masterID ]:
try:
# if the this kerning-pair's left glyph matches rGroupName (right side kerning group of thisGlyph)
if L[0] == "@" and rGroupName == L[7:] or rGroupName == thisFont.glyphForId_(L).name or thisFont.glyphForId_(L).name == thisGlyph.name:
# for every R counterpart to L in the kerning pairs of rGroupName
for R in thisFont.kerning[masterID][L]:
editStringLeft += '\n'
for g in thisFont.glyphs:
groupMembers = g.name
if g.leftKerningGroup == nameMaker(R):
kernPair = "/%s/%s " % (thisGlyphName, groupMembers)
editStringLeft += kernPair
except:
pass
for R in thisFont.kerning[masterID][L]:
try:
# if the R counterpart (class glyph) of L glyph is the selectedGlyph
if R[0] == "@" and lGroupName == R[7:] or lGroupName == thisFont.glyphForId_(R).name or thisFont.glyphForId_(R).name == thisGlyph.name:
editStringRight += '\n'
for g in thisFont.glyphs:
groupMembers = g.name
if g.rightKerningGroup == nameMaker(L):
kernPair = "/%s/%s " % (groupMembers, thisGlyphName)
#
editStringRight += kernPair
print editStringRight
except:
pass
thisFont.newTab("/%s/%s " % (editStringLeft, editStringRight))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.