Erik_M
(Erik Moberg)
April 15, 2022, 8:13am
9
I wrote a script some time ago doing this. Haven’t used it in a while, but just did a quick test and seems to work with multiple axis. Can probably be greatly improved. Available from the Plugin manager (Scripts > TypeNurse).
#MenuTitle: Make Component Smart
# -*- coding: utf-8 -*-
__doc__="""
Turn the selected components into smart components, based on the axes defined in the font.
"""
selectedLayer = Font.selectedLayers[0]
processedGlyphs = []
for component in selectedLayer.components:
if component.selected:
componentGlyph = Font.glyphs[component.name]
# Check if component is already smart
if not componentGlyph.smartComponentAxes:
for i in range(len(Font.axes)):
axisValues = [m.axes[i] for m in Font.masters]
newAxis = GSSmartComponentAxis()
newAxis.name = Font.axes[i].name
newAxis.bottomValue = min(axisValues)
This file has been truncated. show original
3 Likes