Created
January 9, 2015 22:09
-
-
Save line0/717d0229b9f604a0c9bf to your computer and use it in GitHub Desktop.
fontlab macro: apply texture
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def process(f, g, t, index): | |
fl.SetUndo(index) | |
upm = f.upm | |
g.RemoveOverlap() | |
outlines = Glyph(g) | |
g.Distance(upm/100, upm/100, 1) | |
g.RemoveOverlap() | |
outlines.Bsubtract(t) | |
g.Bsubtract(outlines) | |
fl.UpdateGlyph(index) | |
return 1 | |
texture = next(glyph for glyph in fl.font.glyphs if glyph.name == "texture") | |
glyphs = fl.font.glyphs | |
for index in range(len(glyphs)): | |
if fl.Selected(index) and index != fl.iglyph : | |
process(fl.font, glyphs[index], texture, index) | |
fl.UpdateGlyph(index) | |
process(fl.font, glyphs[fl.iglyph], texture, fl.iglyph) | |
fl.UpdateGlyph() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment