Skip to content

Instantly share code, notes, and snippets.

@kateliev
Created April 15, 2022 20:46
Show Gist options
  • Save kateliev/02475049270354954fee8e240522ebf2 to your computer and use it in GitHub Desktop.
Save kateliev/02475049270354954fee8e240522ebf2 to your computer and use it in GitHub Desktop.
FontLab Select Auto Layers
#FLM: Select Auto Layers
#-----------------------------------------------------------
# (C) Vassil Kateliev, 2022 (http://www.kateliev.com)
#------------------------------------------------------------
# No warranties. By using this you agree
# that you use it at your own risk!
# - Dependencies -----------------
from __future__ import absolute_import
import fontlab as fl6
import fontgate as fgt
from typerig.proxy.fl.objects.glyph import pGlyph
from typerig.proxy.fl.objects.font import pFont
# - Run ---------------------------
font = pFont()
select_glyphs = []
for glyph in font.pGlyphs():
if glyph.layer().autoLayer:
select_glyphs.append(glyph.name)
if len(select_glyphs):
font.selectGlyphs(select_glyphs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment